2010-02-18 03:53:10 +00:00
|
|
|
# Template file for 'grub'
|
|
|
|
pkgname=grub
|
2013-05-29 18:36:19 +00:00
|
|
|
version=2.00
|
2014-09-23 14:26:31 +00:00
|
|
|
revision=16
|
2014-01-01 15:10:11 +00:00
|
|
|
hostmakedepends="flex"
|
|
|
|
makedepends="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"
|
2009-10-04 06:04:12 +00:00
|
|
|
short_desc="GRand Unified Bootloader 2"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2012-03-19 09:20:19 +00:00
|
|
|
license="GPL-3"
|
2012-06-18 06:38:47 +00:00
|
|
|
homepage="http://www.gnu.org/software/grub/"
|
2012-06-28 07:56:53 +00:00
|
|
|
distfiles="$GNU_SITE/grub/grub-$version.tar.xz"
|
|
|
|
checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
|
2014-08-27 16:07:41 +00:00
|
|
|
only_for_archs="i686 x86_64"
|
2009-10-04 06:04:12 +00:00
|
|
|
|
2014-08-07 15:24:03 +00:00
|
|
|
post_extract() {
|
|
|
|
sed -i -e 's,freetype/ftsynth.h,freetype2/ftsynth.h,' util/grub-mkfont.c
|
|
|
|
}
|
|
|
|
|
2012-07-05 11:40:27 +00:00
|
|
|
do_configure() {
|
2013-05-29 18:36:19 +00:00
|
|
|
unset CC AS LD RANLIB CPP
|
2014-08-07 15:24:03 +00:00
|
|
|
CFLAGS="$CFLAGS -fno-stack-protector"
|
2013-05-29 18:36:19 +00:00
|
|
|
|
2013-05-26 08:41:55 +00:00
|
|
|
configure_args+=" --enable-device-mapper --enable-cache-stats --enable-nls
|
|
|
|
--enable-grub-mkfont --enable-grub-mount --disable-werror "
|
2012-07-05 11:40:27 +00:00
|
|
|
|
2011-10-18 15:55:28 +00: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 11:40:27 +00:00
|
|
|
|
|
|
|
# build BIOS version
|
2013-05-26 08:41:55 +00:00
|
|
|
mkdir $wrksrc/bios_build
|
|
|
|
cd $wrksrc/bios_build
|
|
|
|
../configure ${configure_args} --with-platform=pc
|
2012-07-05 11:40:27 +00:00
|
|
|
|
2013-04-12 13:11:12 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2013-05-26 08:41:55 +00:00
|
|
|
mkdir $wrksrc/efi_build
|
|
|
|
cd $wrksrc/efi_build
|
|
|
|
../configure ${configure_args} --with-platform=efi \
|
|
|
|
--target="x86_64" --disable-efiemu
|
2012-07-05 11:40:27 +00:00
|
|
|
fi
|
2011-10-18 15:55:28 +00:00
|
|
|
}
|
|
|
|
|
2012-07-05 11:40:27 +00:00
|
|
|
do_build() {
|
|
|
|
msg_normal "Building BIOS grub...\n"
|
2013-05-26 08:41:55 +00:00
|
|
|
cd $wrksrc/bios_build
|
2013-05-29 18:36:19 +00:00
|
|
|
make ${makejobs}
|
2013-05-26 08:41:55 +00:00
|
|
|
|
2013-04-12 13:11:12 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2012-07-05 11:40:27 +00:00
|
|
|
msg_normal "Building EFI grub...\n"
|
2013-05-26 08:41:55 +00:00
|
|
|
cd $wrksrc/efi_build
|
2013-05-29 18:36:19 +00:00
|
|
|
make ${makejobs}
|
2012-07-05 11:40:27 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2013-04-12 13:11:12 +00:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2013-05-26 08:41:55 +00:00
|
|
|
cd $wrksrc/efi_build
|
2013-05-29 18:36:19 +00:00
|
|
|
make DESTDIR=$DESTDIR/efi install
|
2012-07-05 11:40:27 +00:00
|
|
|
# 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
|
2013-05-26 08:41:55 +00:00
|
|
|
cd $wrksrc/bios_build
|
2013-05-29 18:36:19 +00:00
|
|
|
make DESTDIR=$DESTDIR install
|
2012-07-05 11:40:27 +00:00
|
|
|
|
2011-07-09 22:03:36 +00: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 17:41:40 +00: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
|
2013-09-14 02:52:47 +00:00
|
|
|
|
|
|
|
vmkdir usr/share/bash-completion/completions
|
|
|
|
mv ${DESTDIR}/etc/bash_completion.d/grub \
|
|
|
|
${DESTDIR}/usr/share/bash-completion/completions
|
2014-08-28 21:08:06 +00:00
|
|
|
|
|
|
|
# Remove useless tools
|
|
|
|
rm ${DESTDIR}/usr/sbin/grub-ofpathname
|
|
|
|
rm ${DESTDIR}/usr/sbin/grub-sparc64-setup
|
|
|
|
}
|
|
|
|
|
|
|
|
grub-utils_package() {
|
|
|
|
short_desc+=" - additional utilities"
|
|
|
|
depends="grub>=${version}"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/bin/grub-menulst2cfg
|
|
|
|
vmove usr/bin/grub-fstest
|
|
|
|
vmove usr/bin/grub-mkfont
|
|
|
|
vmove usr/bin/grub-mount
|
|
|
|
}
|
2009-10-04 06:04:12 +00:00
|
|
|
}
|
2013-04-12 13:11:12 +00:00
|
|
|
|
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2014-01-01 15:10:11 +00:00
|
|
|
grub-x86_64-efi_package() {
|
|
|
|
noarch=yes
|
|
|
|
depends="grub>=$version dosfstools efibootmgr"
|
|
|
|
short_desc+=" - x86_64 EFI support"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/lib/grub/x86_64-efi
|
|
|
|
}
|
2013-04-12 13:11:12 +00:00
|
|
|
}
|
|
|
|
fi # !x86_64
|