grub: Add subpackage build grub-i386-efi

This commit is contained in:
Evan Deaubl 2015-09-04 21:21:06 -07:00
parent e3f5b976d0
commit 5b793ec158
2 changed files with 33 additions and 4 deletions

1
srcpkgs/grub-i386-efi Symbolic link
View file

@ -0,0 +1 @@
grub

View file

@ -1,7 +1,7 @@
# Template file for 'grub'
pkgname=grub
version=2.00
revision=21
revision=22
hostmakedepends="flex"
makedepends="libusb-compat-devel ncurses-devel freetype-devel
liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel"
@ -15,7 +15,7 @@ distfiles="$GNU_SITE/grub/grub-$version.tar.xz"
checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
subpackages="grub-utils"
subpackages="grub-utils grub-i386-efi"
case "$XBPS_TARGET_MACHINE" in
x86_64*) subpackages+=" grub-x86_64-efi"; _GRUBX64=1;;
esac
@ -40,6 +40,12 @@ do_configure() {
cd $wrksrc/bios_build
../configure ${configure_args} --with-platform=pc
# build i386 EFI version
mkdir $wrksrc/efi_i386_build
cd $wrksrc/efi_i386_build
../configure ${configure_args} --with-platform=efi \
--target=i386 --disable-efiemu --libdir=/usr/lib
if [ -n "${_GRUBX64}" ]; then
mkdir $wrksrc/efi_build
cd $wrksrc/efi_build
@ -56,6 +62,10 @@ do_build() {
cd $wrksrc/bios_build
make ${makejobs}
msg_normal "Building i386 EFI grub...\n"
cd $wrksrc/efi_i386_build
make ${makejobs}
if [ -n "${_GRUBX64}" ]; then
msg_normal "Building EFI grub...\n"
cd $wrksrc/efi_build
@ -74,9 +84,19 @@ do_install() {
rm -rf ${DESTDIR}/efi/{boot,etc,usr/{share,bin}}
rm -f ${DESTDIR}/efi/usr/lib/grub/x86_64-efi/x86_64-*
rm -f ${DESTDIR}/efi/usr/lib/grub/x86_64-efi/*.{module,image}
mv ${DESTDIR}/efi/* ${DESTDIR}
rmdir ${DESTDIR}/efi
cp -r ${DESTDIR}/efi/* ${DESTDIR}
rm -rf ${DESTDIR}/efi
fi
cd $wrksrc/efi_i386_build
make DESTDIR=$DESTDIR/efi_i386 install
# Remove non-platform specific files
rm -rf ${DESTDIR}/efi_i386/{boot,etc,usr/{share,bin}}
rm -f ${DESTDIR}/efi_i386/usr/lib/grub/i386-efi/i386-*
rm -f ${DESTDIR}/efi_i386/usr/lib/grub/i386-efi/*.{module,image}
cp -r ${DESTDIR}/efi_i386/* ${DESTDIR}
rm -rf ${DESTDIR}/efi_i386
cd $wrksrc/bios_build
make DESTDIR=$DESTDIR install
@ -123,3 +143,11 @@ grub-x86_64-efi_package() {
vmove usr/lib/grub/x86_64-efi
}
}
grub-i386-efi_package() {
noarch=yes
depends="grub>=$version dosfstools efibootmgr"
short_desc+=" - i386 EFI support"
pkg_install() {
vmove usr/lib/grub/i386-efi
}
}