template (2584B)
1 # Template file for 'efivar' 2 pkgname=efivar 3 version=39 4 revision=0 5 short_desc="EFI variable filesystem library and tools" 6 maintainer="finwo <finwo@pm.me>" 7 license="LGPL-2.1-or-later" 8 homepage="https://github.com/rhboot/efivar" 9 distfiles="https://github.com/rhboot/efivar/archive/refs/tags/39.tar.gz" 10 checksum=c9edd15f2eeeea63232f3e669a48e992c7be9aff57ee22672ac31f5eca1609a6 11 # glibc + busybox first: the post-install runs /sbin/ldconfig under 12 # /bin/sh (ordering, not just runtime truth - see libmnl). 13 depends="glibc busybox" 14 15 # Notes: 16 # - No configure step upstream; plain make with PREFIX/LIBDIR (defaults 17 # would land libs in lib64). Docs stay on (host mandoc present). 18 # - -Werror is upstream default; if a newer host gcc trips it, evaluate 19 # the warning before reaching for overrides (grub precedent: 20 # --disable-werror exists because vintage code + new gcc). 21 # - Shared + static both build; the .a files are removed per the 22 # shared-only policy. Sysroot seed + .pc rewrites (three .pc files, 23 # fixed centrally by the driver) so efibootmgr's build finds them via 24 # PKG_CONFIG_PATH. 25 # - Upstream efivar.pc/efiboot.pc spell Cflags as -I${includedir}/efivar 26 # only. That works on a host where /usr/include is an implicit search 27 # path (so `#include <efivar/efivar.h>` inside efiboot.h resolves), but 28 # in a sysroot build the bare /usr/include is NOT searched and consumers 29 # that only `pkg-config efivar efiboot` (e.g. efibootmgr itself) fail. 30 # Patch the .pc.in files to expose BOTH -I${includedir} and the subdir. 31 # - The `efivar` CLI ships too (reading/writing EFI vars from UNOS itself). 32 # - Every UNOS library package carries the ldconfig post-install. 33 34 do_build() { 35 cd "${WRKSRC}" 36 # Expose the parent include dir too (see Notes above); .pc.in are 37 # templated with @@PLACEHOLDERS@@, so patch the source before any 38 # generation step writes the final .pc files. 39 for pc in src/efivar.pc.in src/efiboot.pc.in src/efisec.pc.in; do 40 [ -f "${pc}" ] || continue 41 sed -i 's|Cflags: -I${includedir}/efivar|Cflags: -I${includedir} -I${includedir}/efivar|' "${pc}" 42 done 43 make -j"$(nproc)" PREFIX=/usr LIBDIR=/usr/lib 44 [ -f src/libefivar.so ] || die "efivar: shared lib missing after build" 45 } 46 47 do_install() { 48 cd "${WRKSRC}" 49 make install PREFIX=/usr LIBDIR=/usr/lib DESTDIR="${DESTDIR}" 50 make install PREFIX=/usr LIBDIR=/usr/lib DESTDIR="${SYSROOT}" 51 rm -f "${DESTDIR}"/usr/lib/*.a "${SYSROOT}"/usr/lib/*.a 52 for pc in efivar.pc efiboot.pc efisec.pc; do 53 [ -f "${SYSROOT}/usr/lib/pkgconfig/${pc}" ] || die "efivar: no sysroot ${pc}" 54 done 55 }