diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2016-09-27 15:57:10 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2016-09-27 15:57:18 +0200 |
commit | 0192e157d5950f264e69aaf71ea1363393efab42 (patch) | |
tree | 8cb21f54d1538717b337a5f0e81ca9b4d4abc927 /testing | |
parent | 4e4177028186ed6f871cf8569c6b53e187d59987 (diff) | |
download | aports-0192e157d5950f264e69aaf71ea1363393efab42.tar.bz2 aports-0192e157d5950f264e69aaf71ea1363393efab42.tar.xz |
testing/grub: add efi and bios subpkgs
Diffstat (limited to 'testing')
-rw-r--r-- | testing/grub/APKBUILD | 80 |
1 files changed, 73 insertions, 7 deletions
diff --git a/testing/grub/APKBUILD b/testing/grub/APKBUILD index a3ab245169..f05a0d329b 100644 --- a/testing/grub/APKBUILD +++ b/testing/grub/APKBUILD @@ -3,7 +3,7 @@ pkgname=grub _ver=2.02~beta3 pkgver=2.02_beta3 -pkgrel=0 +pkgrel=1 pkgdesc="Bootloader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" arch="all !armhf" @@ -13,17 +13,21 @@ depends_dev="" makedepends="$depends_dev bison flex linux-headers xz-dev lvm2-dev automake autoconf libtool" install="" -subpackages="$pkgname-dev $pkgname-doc" +subpackages="$pkgname-dev $pkgname-doc $pkgname-efi" source="ftp://alpha.gnu.org/gnu/grub/grub-$_ver.tar.xz 2.02_beta3-gcc6-ld-no-pie.patch fix-gcc-no-pie-specs.patch " builddir="$srcdir/grub-$_ver" -build() { - cd "$builddir" - autoreconf -vif - #export CFLAGS="$CFLAGS -no-pie" +# currently grub only builds on x86* and aarch64 systems +# aarch64 is not supported on pc/bios platform. +if [ ! "$CARCH" = aarch64 ]; then + subpackages="$subpackages $pkgname-bios" +fi + +_build_bios() { + cd $builddir/bios ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -31,16 +35,78 @@ build() { --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var \ + --disable-nls \ + --disable-werror \ + --with-platform=pc \ || return 1 make || return 1 } -package() { +_build_efi() { + cd $builddir/efi + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-nls \ + --disable-werror \ + --with-platform=efi \ + --disable-efiemu \ + || return 1 + make || return 1 +} + +build() { cd "$builddir" + autoreconf -vif || return 1 + + # BIOS build + if [ ! "$CARCH" = aarch64 ]; then + msg "Building grub for platform BIOS" + cp -r "$builddir" "$builddir"/bios + _build_bios || return 1 + fi + + # EFI build + msg "Building grub for platform EFI" + cp -r "$builddir" "$builddir"/efi + _build_efi || return 1 +} + +package() { + # install both version into the same directory + # and overwrite similar files. + + # BIOS install + if [ ! "$CARCH" = aarch64 ]; then + cd "$builddir"/bios + make DESTDIR="$pkgdir" install || return 1 + fi + + # EFI install + cd "$builddir"/efi make DESTDIR="$pkgdir" install || return 1 + rm -f "$pkgdir"/usr/lib/charset.alias } +bios() { + pkgdesc="$pkgdesc (BIOS version)" + depends="$pkgname" + mkdir -p $subpkgdir/usr/lib/grub + mv $pkgdir/usr/lib/grub/*-pc $subpkgdir/usr/lib/grub/ +} + +efi() { + pkgdesc="$pkgdesc (EFI version)" + depends="$pkgname" + mkdir -p $subpkgdir/usr/lib/grub + mv $pkgdir/usr/lib/grub/*-efi $subpkgdir/usr/lib/grub/ +} + md5sums="ab399fc6f74a97d66ff77f04b743149c grub-2.02~beta3.tar.xz 7a09f166141e2a57f1829dd6cf1424fa 2.02_beta3-gcc6-ld-no-pie.patch 632f1e9dee0f8a4a52e592cb29cdf8cc fix-gcc-no-pie-specs.patch" |