2010-02-18 04:53:10 +01:00
|
|
|
# Template file for 'grub'
|
|
|
|
pkgname=grub
|
2012-06-28 09:56:53 +02:00
|
|
|
version="2.00"
|
2013-01-16 19:03:16 +01:00
|
|
|
revision=9
|
2009-10-04 08:04:12 +02:00
|
|
|
short_desc="GRand Unified Bootloader 2"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2012-03-19 10:20:19 +01:00
|
|
|
license="GPL-3"
|
2012-06-18 08:38:47 +02:00
|
|
|
homepage="http://www.gnu.org/software/grub/"
|
2012-06-28 09:56:53 +02:00
|
|
|
distfiles="$GNU_SITE/grub/grub-$version.tar.xz"
|
|
|
|
checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
|
2009-10-04 08:04:12 +02:00
|
|
|
|
2012-12-14 12:29:04 +01:00
|
|
|
makedepends="flex libusb-compat-devel ncurses-devel freetype-devel
|
|
|
|
liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel"
|
|
|
|
|
|
|
|
depends="os-prober"
|
|
|
|
conf_files="/etc/default/grub /etc/grub.d/40_custom"
|
|
|
|
|
2012-07-05 13:40:27 +02:00
|
|
|
if [ "$XBPS_MACHINE" = "x86_64" ]; then
|
2012-07-06 09:58:56 +02:00
|
|
|
subpackages="grub-x86_64-efi"
|
2012-07-05 13:40:27 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
do_configure() {
|
|
|
|
local sharedargs="--enable-device-mapper --enable-cache-stats --enable-nls \
|
|
|
|
--enable-grub-mkfont --enable-grub-mount --disable-werror"
|
|
|
|
|
2011-10-18 17:55:28 +02:00
|
|
|
# fix unifont.bdf location so grub-mkfont can create *.pf2 files
|
|
|
|
sed -i 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|' configure
|
2012-07-05 13:40:27 +02:00
|
|
|
|
|
|
|
# build BIOS version
|
|
|
|
mkdir $wrksrc/bios_build && cd $wrksrc/bios_build
|
|
|
|
../configure ${CONFIGURE_SHARED_ARGS} --with-platform=pc $sharedargs
|
|
|
|
|
|
|
|
if [ "$XBPS_MACHINE" = "x86_64" ]; then
|
|
|
|
mkdir $wrksrc/efi_build && cd $wrksrc/efi_build
|
|
|
|
../configure ${CONFIGURE_SHARED_ARGS} --with-platform=efi \
|
|
|
|
--target="x86_64" --disable-efiemu $sharedargs
|
|
|
|
fi
|
2011-10-18 17:55:28 +02:00
|
|
|
}
|
|
|
|
|
2012-07-05 13:40:27 +02:00
|
|
|
do_build() {
|
|
|
|
msg_normal "Building BIOS grub...\n"
|
|
|
|
cd $wrksrc/bios_build && make ${makejobs}
|
|
|
|
if [ "$XBPS_MACHINE" = "x86_64" ]; then
|
|
|
|
msg_normal "Building EFI grub...\n"
|
|
|
|
cd $wrksrc/efi_build && make ${makejobs}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
if [ "$XBPS_MACHINE" = "x86_64" ]; then
|
|
|
|
cd $wrksrc/efi_build && make DESTDIR=$DESTDIR/efi install
|
|
|
|
# Remove non-platform specific files
|
|
|
|
rm -rf ${DESTDIR}/efi/{boot,etc,usr/{share,bin,sbin}}
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
cd $wrksrc/bios_build && make DESTDIR=$DESTDIR install
|
|
|
|
|
2011-07-10 00:03:36 +02:00
|
|
|
# Required to compress info files.
|
|
|
|
vmkdir usr/share/info
|
|
|
|
touch -f ${DESTDIR}/usr/share/info/dir
|
|
|
|
|
|
|
|
vinstall ${FILESDIR}/grub.default 644 etc/default grub
|
|
|
|
# Kernel hooks.
|
|
|
|
vinstall ${FILESDIR}/kernel.d/grub.post 750 \
|
|
|
|
etc/kernel.d/post-install 50-grub
|
|
|
|
vinstall ${FILESDIR}/kernel.d/grub.post 750 \
|
|
|
|
etc/kernel.d/post-remove 50-grub
|
2012-07-02 19:41:40 +02:00
|
|
|
|
|
|
|
# update-grub for noobs.
|
|
|
|
printf "#!/bin/sh\ngrub-mkconfig -o /boot/grub/grub.cfg\nexit \$?\n" >> \
|
|
|
|
${DESTDIR}/usr/sbin/update-grub
|
|
|
|
chmod 755 ${DESTDIR}/usr/sbin/update-grub
|
2009-10-04 08:04:12 +02:00
|
|
|
}
|