* fix unifont with recent freetype2

* put common configure options in an array variable
* general cleanups
This commit is contained in:
Christian Hesse 2018-06-24 22:35:42 +00:00
parent 6e612bc870
commit 62fb5b43d0

124
PKGBUILD
View File

@ -22,7 +22,7 @@ _UNIFONT_VER="10.0.06"
pkgname="grub" pkgname="grub"
pkgdesc="GNU GRand Unified Bootloader (2)" pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.02 pkgver=2.02
pkgrel=6 pkgrel=7
epoch=2 epoch=2
url="https://www.gnu.org/software/grub/" url="https://www.gnu.org/software/grub/"
arch=('x86_64') arch=('x86_64')
@ -84,31 +84,50 @@ sha256sums=('810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f'
'fcd5a626d4af33665d041ce42df813f1f198d8230ea186481b155a5b676f3b87' 'fcd5a626d4af33665d041ce42df813f1f198d8230ea186481b155a5b676f3b87'
'74e5dd2090a153c10a7b9599b73bb09e70fddc6a019dd41641b0f10b9d773d82' '74e5dd2090a153c10a7b9599b73bb09e70fddc6a019dd41641b0f10b9d773d82'
'c5e4f3836130c6885e9273c21f057263eba53f4b7c0e2f111f6e5f2e487a47ad') 'c5e4f3836130c6885e9273c21f057263eba53f4b7c0e2f111f6e5f2e487a47ad')
_configure_options=(
FREETYPE="pkg-config freetype2"
BUILD_FREETYPE="pkg-config freetype2"
--enable-mm-debug
--enable-nls
--enable-device-mapper
--enable-cache-stats
--enable-grub-mkfont
--enable-grub-mount
--prefix="/usr"
--bindir="/usr/bin"
--sbindir="/usr/bin"
--mandir="/usr/share/man"
--infodir="/usr/share/info"
--datarootdir="/usr/share"
--sysconfdir="/etc"
--program-prefix=""
--with-bootdir="/boot"
--with-grubdir="grub"
--disable-silent-rules
--disable-werror
)
prepare() { prepare() {
cd "${srcdir}/grub-${pkgver}/" cd "${srcdir}/grub-${pkgver}/"
msg "Patch to detect of Arch Linux initramfs images by grub-mkconfig" msg "Patch to detect of Arch Linux initramfs images by grub-mkconfig"
patch -Np1 -i "${srcdir}/0003-10_linux-detect-archlinux-initramfs.patch" patch -Np1 -i "${srcdir}/0003-10_linux-detect-archlinux-initramfs.patch"
echo
msg "Patch to enable GRUB_COLOR_* variables in grub-mkconfig" msg "Patch to enable GRUB_COLOR_* variables in grub-mkconfig"
## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html ## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html
patch -Np1 -i "${srcdir}/0004-add-GRUB_COLOR_variables.patch" patch -Np1 -i "${srcdir}/0004-add-GRUB_COLOR_variables.patch"
echo
msg "Patch to allow GRUB to mount ext2/3/4 filesystems that have the encryption feature" msg "Patch to allow GRUB to mount ext2/3/4 filesystems that have the encryption feature"
patch -Np1 -i "${srcdir}/0005-Allow_GRUB_to_mount_ext234_filesystems_that_have_the_encryption_feature.patch" patch -Np1 -i "${srcdir}/0005-Allow_GRUB_to_mount_ext234_filesystems_that_have_the_encryption_feature.patch"
echo
msg "Patch to change default tsc calibration method to pmtimer on EFI systems" msg "Patch to change default tsc calibration method to pmtimer on EFI systems"
patch -Np1 -i "${srcdir}/0006-tsc-Change-default-tsc-calibration-method-to-pmtimer-on-EFI-systems.patch" patch -Np1 -i "${srcdir}/0006-tsc-Change-default-tsc-calibration-method-to-pmtimer-on-EFI-systems.patch"
echo
msg "Support multiple early initrd images" msg "Patch to Support multiple early initrd images"
patch -Np1 -i "${srcdir}/0007-grub-mkconfig_10_linux_Support_multiple_early_initrd_images.patch" patch -Np1 -i "${srcdir}/0007-grub-mkconfig_10_linux_Support_multiple_early_initrd_images.patch"
msg "Fix packed-not-aligned error on GCC 8" msg "Patch to fix packed-not-aligned error on GCC 8"
patch -Np1 -i "${srcdir}/0008-Fix-packed-not-aligned-error-on-GCC-8.patch" patch -Np1 -i "${srcdir}/0008-Fix-packed-not-aligned-error-on-GCC-8.patch"
msg "xfs: Accept filesystem with sparse inodes" msg "xfs: Accept filesystem with sparse inodes"
@ -125,7 +144,6 @@ prepare() {
msg "Pull in latest language files" msg "Pull in latest language files"
./linguas.sh ./linguas.sh
echo
msg "Remove not working langs which need LC_ALL=C.UTF-8" msg "Remove not working langs which need LC_ALL=C.UTF-8"
sed -e 's#en@cyrillic en@greek##g' -i "po/LINGUAS" sed -e 's#en@cyrillic en@greek##g' -i "po/LINGUAS"
@ -133,6 +151,9 @@ prepare() {
msg "Avoid problem with unifont during compile of grub" msg "Avoid problem with unifont during compile of grub"
# http://savannah.gnu.org/bugs/?40330 and https://bugs.archlinux.org/task/37847 # http://savannah.gnu.org/bugs/?40330 and https://bugs.archlinux.org/task/37847
cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf" "unifont.bdf" cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf" "unifont.bdf"
msg "Run autogen.sh"
./autogen.sh
} }
_build_grub-common_and_bios() { _build_grub-common_and_bios() {
@ -160,40 +181,16 @@ _build_grub-common_and_bios() {
unset LDFLAGS unset LDFLAGS
unset MAKEFLAGS unset MAKEFLAGS
msg "Run autogen.sh for bios build"
./autogen.sh
echo
msg "Run ./configure for bios build" msg "Run ./configure for bios build"
./configure \ ./configure \
FREETYPE="pkg-config freetype2" \
--with-platform="pc" \ --with-platform="pc" \
--target="i386" \ --target="i386" \
"${_EFIEMU}" \ "${_EFIEMU}" \
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-boot-time \ --enable-boot-time \
--enable-grub-mkfont \ "${_configure_options[@]}"
--enable-grub-mount \
--prefix="/usr" \
--bindir="/usr/bin" \
--sbindir="/usr/bin" \
--mandir="/usr/share/man" \
--infodir="/usr/share/info" \
--datarootdir="/usr/share" \
--sysconfdir="/etc" \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-silent-rules \
--disable-werror
echo
msg "Run make for bios build" msg "Run make for bios build"
make make
echo
} }
_build_grub-efi() { _build_grub-efi() {
@ -208,40 +205,16 @@ _build_grub-efi() {
unset LDFLAGS unset LDFLAGS
unset MAKEFLAGS unset MAKEFLAGS
msg "Run autogen.sh for ${_EFI_ARCH} efi build"
./autogen.sh
echo
msg "Run ./configure for ${_EFI_ARCH} efi build" msg "Run ./configure for ${_EFI_ARCH} efi build"
./configure \ ./configure \
FREETYPE="pkg-config freetype2" \
--with-platform="efi" \ --with-platform="efi" \
--target="${_EFI_ARCH}" \ --target="${_EFI_ARCH}" \
--disable-efiemu \ --disable-efiemu \
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-boot-time \ --enable-boot-time \
--enable-grub-mkfont \ "${_configure_options[@]}"
--enable-grub-mount \
--prefix="/usr" \
--bindir="/usr/bin" \
--sbindir="/usr/bin" \
--mandir="/usr/share/man" \
--infodir="/usr/share/info" \
--datarootdir="/usr/share" \
--sysconfdir="/etc" \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-silent-rules \
--disable-werror
echo
msg "Run make for ${_EFI_ARCH} efi build" msg "Run make for ${_EFI_ARCH} efi build"
make make
echo
} }
_build_grub-emu() { _build_grub-emu() {
@ -256,41 +229,17 @@ _build_grub-emu() {
unset LDFLAGS unset LDFLAGS
unset MAKEFLAGS unset MAKEFLAGS
msg "Run autogen.sh for emu build"
./autogen.sh
echo
msg "Run ./configure for emu build" msg "Run ./configure for emu build"
./configure \ ./configure \
FREETYPE="pkg-config freetype2" \
--with-platform="emu" \ --with-platform="emu" \
--target="${_EMU_ARCH}" \ --target="${_EMU_ARCH}" \
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-grub-mkfont \
--enable-grub-mount \
--enable-grub-emu-usb=no \ --enable-grub-emu-usb=no \
--enable-grub-emu-sdl=no \ --enable-grub-emu-sdl=no \
--disable-grub-emu-pci \ --disable-grub-emu-pci \
--prefix="/usr" \ "${_configure_options[@]}"
--bindir="/usr/bin" \
--sbindir="/usr/bin" \
--mandir="/usr/share/man" \
--infodir="/usr/share/info" \
--datarootdir="/usr/share" \
--sysconfdir="/etc" \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-silent-rules \
--disable-werror
echo
msg "Run make for emu build" msg "Run make for emu build"
make make
echo
} }
build() { build() {
@ -298,22 +247,18 @@ build() {
msg "Build grub bios stuff" msg "Build grub bios stuff"
_build_grub-common_and_bios _build_grub-common_and_bios
echo
msg "Build grub ${_EFI_ARCH} efi stuff" msg "Build grub ${_EFI_ARCH} efi stuff"
_build_grub-efi _build_grub-efi
echo
if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
msg "Build grub i386 efi stuff" msg "Build grub i386 efi stuff"
_EFI_ARCH="i386" _build_grub-efi _EFI_ARCH="i386" _build_grub-efi
echo
fi fi
if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
msg "Build grub emu stuff" msg "Build grub emu stuff"
_build_grub-emu _build_grub-emu
echo
fi fi
} }
@ -322,7 +267,6 @@ _package_grub-common_and_bios() {
msg "Run make install for bios build" msg "Run make install for bios build"
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo
msg "Remove gdb debugging related files for bios build" msg "Remove gdb debugging related files for bios build"
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.module || true rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.module || true
@ -341,7 +285,6 @@ _package_grub-efi() {
msg "Run make install for ${_EFI_ARCH} efi build" msg "Run make install for ${_EFI_ARCH} efi build"
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo
msg "Remove gdb debugging related files for ${_EFI_ARCH} efi build" msg "Remove gdb debugging related files for ${_EFI_ARCH} efi build"
rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.module || true rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.module || true
@ -354,7 +297,6 @@ _package_grub-emu() {
msg "Run make install for emu build" msg "Run make install for emu build"
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo
msg "Remove gdb debugging related files for emu build" msg "Remove gdb debugging related files for emu build"
rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.module || true rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.module || true
@ -371,13 +313,11 @@ package() {
if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
msg "Package grub i386 efi stuff" msg "Package grub i386 efi stuff"
_EFI_ARCH="i386" _package_grub-efi _EFI_ARCH="i386" _package_grub-efi
echo
fi fi
if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
msg "Package grub emu stuff" msg "Package grub emu stuff"
_package_grub-emu _package_grub-emu
echo
fi fi
msg "Package grub bios stuff" msg "Package grub bios stuff"