pkgname=grub pkgver=2.12 _unifont_ver=16.0.01 pkgrel=1 pkgdesc="GNU GRand Unified Bootloader, version 2 (EFI version)" arch=('x86_64') url="https://www.gnu.org/software/grub/" license=('GPL-3.0-or-later') depends=('bash' 'device-mapper' 'efibootmgr' 'gettext' 'xz') makedepends=('dejavu-fonts-ttf' 'fuse' 'freetype2' 'python' 'texinfo' 'rsync') backup=(etc/default/grub etc/grub.d/40_custom) options=('!makeflags') source=(https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz https://unifoundry.com/pub/unifont/unifont-${pkgver}/font-builds/unifont-${_unifont_ver}.pcf.gz grub-00_header-add-GRUB_COLOR_-variables.patch grub-10_linux-detect-initramfs.patch grub.default grub.hook) sha256sums=(f3c97391f7c4eaa677a78e090c7e97e6dc47b16f655f04683ebd37bef7fe0faa e756045ba0893ee2e8369b27afc02436bed90299db4e1672ce766e0470cd9825 27ea7681dda8767579e47c38ef5f0d79ab1f8f9ce74751b7aaaf4223fdb5871f 3f878fa67529c841bdcff67ae00b146039f1b19cc48df0d6d0f452969150cfbb 842ec9749e6f7efc2fe861c9a89232b6e92699d6a38cb13a7cde6382cb5b3f09 bb537329e43b1a040e6360379da645a61e3f4c7ed203a987c67a9f2df12017e4) prepare() { cd ${pkgname}-${pkgver} echo depends bli part_gpt > grub-core/extra_deps.lst patch -Np1 -i ${srcdir}/grub-00_header-add-GRUB_COLOR_-variables.patch patch -Np1 -i ${srcdir}/grub-10_linux-detect-initramfs.patch sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "configure.ac" sed 's| ro | rw |g' -i util/grub.d/10_linux.in autoreconf -fiv gzip -cd ${srcdir}/unifont-${_unifont_ver}.pcf.gz > unifont.pcf ./linguas.sh } build() { cd ${pkgname}-${pkgver} unset {C,CPP,CXX,LD}FLAGS local configure_args=( --bindir=/usr/bin --sbindir=/usr/sbin --mandir=/usr/share/man --infodir=/usr/share/info --datarootdir=/usr/share --sysconfdir=/etc --disable-efiemu --enable-grub-mkfont --enable-grub-mount --with-platform=efi --target=x86_64 --disable-werror --enable-nls --enable-cache-stats --enable-boot-time --enable-device-mapper --disable-silent-rules --with-bootdir=/boot --with-grubdir=grub PACKAGE_VERSION="${pkgver}-${pkgrel}" FREETYPE="${CHOST}-pkg-config freetype2" BUILD_FREETYPE="${CHOST}-pkg-config freetype2" ${configure_options} ) ./configure ${configure_args[@]} make } package() { cd ${pkgname}-${pkgver} make DESTDIR=${pkgdir} bashcompletiondir=/usr/share/bash-completion/completions install install -D -m0644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub install -vDm644 ${srcdir}/grub.hook ${pkgdir}/usr/share/libalpm/hooks/grub.hook }