template (2087B)
1 # Template file for 'grub' 2 pkgname=grub 3 version=2.14 4 revision=0 5 short_desc="Bootloader with support for BIOS and UEFI" 6 maintainer="finwo <finwo@pm.me>" 7 license="GPL-3.0-or-later" 8 homepage="https://www.gnu.org/software/grub/" 9 # NOTE: gnu publishes PGP .sig only, no sha256 file - TOFU pin. 10 distfiles="https://ftp.gnu.org/gnu/grub/grub-2.14.tar.xz" 11 checksum=bc8d3c73535b8838d8c8e2654d73edc4e6ae8c8acdb45d5df5dc9a1547446d43 12 # xz: grub-install links liblzma (readelf-proven, not guessed). 13 depends="xz" 14 makedepends="xz linux-headers" 15 hostmakedepends="bison flex" 16 17 # x86_64-efi only: grub 2.14's i386-pc kernel.img links .text at 0x9074 18 # instead of 0x9000 under binutils 2.44, and grub-mkimage rejects it. Do not 19 # "fix" by shipping it anyway - the resulting images do not boot. 20 # 21 # Disabled options are the ones whose auto-detection would otherwise add a 22 # host-dependent runtime dep: freetype, tasn1, FUSE, ZFS, device-mapper. 23 do_configure() { 24 mkdir -p "${WORK}/build-efi" 25 cd "${WORK}/build-efi" 26 "${WRKSRC}/configure" --prefix=/usr --with-platform=efi \ 27 --disable-nls --disable-werror \ 28 --disable-grub-mkfont --disable-grub-mount --disable-grub-protect \ 29 --disable-libzfs --disable-device-mapper 30 } 31 32 do_build() { 33 make -C "${WORK}/build-efi" -j"$(nproc)" 34 [ -x "${WORK}/build-efi/grub-mkimage" ] || die "grub: efi grub-mkimage missing" 35 } 36 37 do_install() { 38 # install-strip: upstream binaries ship with debug_info; strip programs. 39 # (.mod files install as data and stay unstripped - measured acceptable.) 40 make -C "${WORK}/build-efi" install-strip DESTDIR="${DESTDIR}" 41 # prune: docs, themes, locales - serial/console boot needs none of them 42 rm -rf "${DESTDIR}/usr/share/info" "${DESTDIR}/usr/share/grub/themes" \ 43 "${DESTDIR}/usr/share/locale" 44 # no probing config generation on a switch (see Notes) 45 rm -f "${DESTDIR}"/usr/sbin/grub-mkconfig "${DESTDIR}"/usr/share/man/man8/grub-mkconfig.8 46 [ -x "${DESTDIR}/usr/sbin/grub-install" ] || die "grub: grub-install missing" 47 [ -d "${DESTDIR}/usr/lib/grub/x86_64-efi" ] || die "grub: x86_64-efi modules missing" 48 }