diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-10-19 07:38:39 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-10-19 07:52:46 +0000 |
commit | 1fcb8f13319a1aea3c4912000dd2f194413d3eda (patch) | |
tree | 23295d7f18a3257ab39a3adb21e2153d2dc6621a /main/grub | |
parent | f8c030e5470e0ce7dc7766539df5076fc4c05aef (diff) | |
download | aports-1fcb8f13319a1aea3c4912000dd2f194413d3eda.tar.bz2 aports-1fcb8f13319a1aea3c4912000dd2f194413d3eda.tar.xz |
main/grub: simplify, enable on arm, take maintainership
Diffstat (limited to 'main/grub')
-rw-r--r-- | main/grub/APKBUILD | 198 |
1 files changed, 46 insertions, 152 deletions
diff --git a/main/grub/APKBUILD b/main/grub/APKBUILD index 117d39a4bb..3520a0a3b0 100644 --- a/main/grub/APKBUILD +++ b/main/grub/APKBUILD @@ -1,11 +1,11 @@ # Contributor: Carlo Landmeter <clandmeter@gmail.com> -# Maintainer: +# Maintainer: Timo Teräs <timo.teras@iki.fi> pkgname=grub pkgver=2.02 -pkgrel=2 +pkgrel=3 pkgdesc="Bootloader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" -arch="all !armhf !s390x" +arch="all !s390x" license="GPLv3+" depends="" depends_dev="" @@ -17,14 +17,17 @@ options="!strip" subpackages="$pkgname-dev $pkgname-doc" # currently grub only builds on x86*, aarch64 and ppc64le systems +flavors="" case "$CARCH" in -x86) subpackages="$subpackages $pkgname-efi $pkgname-bios" ;; -x86_64) subpackages="$subpackages $pkgname-efi $pkgname-bios $pkgname-xenhost" ;; -aarch64) subpackages="$subpackages $pkgname-efi" ;; -ppc64le) subpackages="$subpackages $pkgname-ieee1275" - makedepends="$makedepends powerpc-utils" ;; -s390x) subpackages="$subpackages $pkgname-emu" ;; +x86) flavors="efi bios";; +x86_64) flavors="efi bios xenhost";; +aarch64|arm*) flavors="efi";; +ppc64le) flavors="ieee1275"; makedepends="$makedepends powerpc-utils" ;; +s390x) flavors="emu" ;; esac +for f in $flavors; do + subpackages="$subpackages $pkgname-$f" +done source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz fix-gcc-no-pie-specs.patch @@ -34,139 +37,46 @@ source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz " builddir="$srcdir/grub-$pkgver" - -_build_bios() { - msg "Building grub for platform BIOS" - cd $builddir/bios - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --disable-nls \ - --disable-werror \ - --with-platform=pc \ - || return 1 - make || return 1 +prepare() { + default_prepare + autoreconf -vif } -_build_efi() { - msg "Building grub for platform 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_flavor() { + local flavor="$1" + shift + local _configure="$@" -_build_xen() { - msg "Building grub for platform XEN" - cd $builddir/xen - ./configure \ + msg "Building grub for platform $flavor" + mkdir -p "$srcdir"/build-$flavor + cd "$srcdir"/build-$flavor + $builddir/configure \ --build=$CBUILD \ --host=$CHOST \ + --target=$CTARGET \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var \ --disable-nls \ --disable-werror \ - --with-platform=xen \ - --target=$CARCH \ - || return 1 - make || return 1 -} - -_build_ieee1275() { - msg "Building grub for platform IEEE1275" - cd $builddir/ieee1275 - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --disable-nls \ - --disable-werror \ - --with-platform=ieee1275 \ - || return 1 - make || return 1 -} - -_build_emu() { - msg "Building grub for platform EMU" - cd $builddir/emu - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --disable-nls \ - --disable-werror \ - --with-platform=emu \ - || return 1 - make || return 1 + $_configure + make } build() { - cd "$builddir" - autoreconf -vif || return 1 - - cd "$srcdir" - tmpdir="$srcdir"/tmp - mv "$builddir" "$tmpdir" - - mkdir "$builddir" - cp -r "$tmpdir" "$builddir"/bios - cp -r "$tmpdir" "$builddir"/efi - cp -r "$tmpdir" "$builddir"/xen - cp -r "$tmpdir" "$builddir"/emu - mv "$tmpdir" "$builddir"/ieee1275 - - case "$CARCH" in - x86) - _build_bios || return 1 - _build_efi || return 1 ;; - x86_64) - _build_bios || return 1 - _build_efi || return 1 - _build_xen || return 1 ;; - aarch64) - _build_efi || return 1 ;; - ppc64le) - _build_ieee1275 || return 1 ;; - s390x) - _build_emu || return 1;; - esac -} - -_install_bios() { - cd "$builddir"/bios - make DESTDIR="$pkgdir" install-strip || return 1 -} - -_install_efi() { - cd "$builddir"/efi - make DESTDIR="$pkgdir" install-strip || return 1 + local f + for f in $flavors; do + case "$f" in + bios) _build_flavor $f --with-platform=pc;; + efi) _build_flavor $f --with-platform=efi --disable-efiemu;; + xenhost) _build_flavor $f --with-platform=xen;; + *) _build_flavor $f --with-platform=$f;; + esac + done } _install_xen() { - cd "$builddir"/xen - grub_dir=`mktemp -d` cfg=`mktemp` grub_memdisk=`mktemp` @@ -186,42 +96,26 @@ _install_xen() { -o $pkgdir/grub-$CARCH-xen.bin rm -r "$grub_dir" - rm "$cfg" - rm "$grub_memdisk" + rm "$cfg" "$grub_memdisk" } -_install_ieee1275() { - cd "$builddir"/ieee1275 - make DESTDIR="$pkgdir" install-strip || return 1 -} - -_install_emu() { - cd "$builddir"/emu - make DESTDIR="$pkgdir" install-strip || return 1 +_install_flavor() { + local flavor="$1" + cd "$srcdir"/build-$flavor + case $flavor in + xenhost) _install_xen;; + *) make DESTDIR="$pkgdir" install-strip;; + esac } package() { # install BIOS & EFI version into the same directory # and overwrite similar files. - - case "$CARCH" in - x86) - _install_bios - _install_efi ;; - x86_64) - _install_bios - _install_efi - _install_xen ;; - aarch64) - _install_efi ;; - ppc64le) - _install_ieee1275 ;; - s390x) - _install_emu ;; - esac + for f in $flavors; do + _install_flavor $f + done rm -f "$pkgdir"/usr/lib/charset.alias - # remove grub-install warning of missing directory mkdir -p "$pkgdir"/usr/share/locale } |