Files
BMLFS/build-scripts/efivar.build
2023-10-28 20:42:28 -05:00

69 lines
2.5 KiB
Bash

#! /bin/bash
# efivar
# Source: https://github.com/rhboot/efivar/releases/download/37/efivar-37.tar.bz2
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
# Apply patches from Chimera Linux
patch -Np1 -i ../patches/efivar-chimera/0001-Support-custom-cflags-for-CC_FOR_BUILD-and-CCLD_FOR_.patch
patch -Np1 -i ../patches/efivar-chimera/0002-Replace-call-to-strncpy-by-memcpy-to-fix-some-GCC8-w.patch
export CFLAGS="-D_GNU_SOURCE -Wno-error=address-of-packed-member" && \
read -p "Compile?" && make ERRORS= LIBDIR=/usr/lib && \
sudo -S make PREFIX=/usr DESTDIR=$BUILD LIBDIR=/usr/lib install && \
case $(uname -m) in
x86_64 | aarch64 sudo -S mv ${BUILD}/usr/lib64 ${BUILD}/usr/lib ;;
esac && \
sudo -S mkdir -pv /BMAN/install && \
sudo -S mkdir -pv /BMAN/usr && \
sudo -S mv /BUILD/usr/share /BMAN/usr/ && \
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
efivar: efivar (library and utilities to handle UEFI variables)
efivar:
efivar: The efivar package contains a library and utilities for manipulating
efivar: UEFI (Unified Extensible Firmware Interface) variables.
efivar:
efivar: Homepage: https://github.com/rhboot/efivar
efivar:
efivar:
efivar:
efivar:
efivar:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/efivar-37-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
efivar-doc: Manuals for efivar (library and utilities to handle UEFI variables)
efivar-doc:
efivar-doc: The efivar package contains a library and utilities for manipulating
efivar-doc: UEFI (Unified Extensible Firmware Interface) variables.
efivar-doc:
efivar-doc: Homepage: https://github.com/rhboot/efivar
efivar-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/efivar-doc-37-$NOSPUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*