grub: portability patch to unbreak musl builds.

This commit is contained in:
Juan RP 2014-12-28 09:15:45 +01:00
parent c29cfb8eac
commit b4ea5ed61f
2 changed files with 43 additions and 15 deletions

View file

@ -0,0 +1,26 @@
Portability fixes:
- Do not assume that if !__GLIBC__ lseek() cannot handle 64-bit offsets.
--- grub-core/kern/emu/hostdisk.c.orig 2012-06-25 10:32:04.000000000 +0200
+++ grub-core/kern/emu/hostdisk.c 2014-12-28 09:06:09.224044788 +0100
@@ -44,8 +44,7 @@
#ifdef __linux__
# include <sys/ioctl.h> /* ioctl */
# include <sys/mount.h>
-# if !defined(__GLIBC__) || \
- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
+# if ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
/* Maybe libc doesn't have large file support. */
# include <linux/unistd.h> /* _llseek */
# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
@@ -761,8 +760,7 @@ linux_find_partition (char *dev, grub_di
}
#endif /* __linux__ */
-#if defined(__linux__) && (!defined(__GLIBC__) || \
- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
+#if (defined(__linux__) && defined(__GLIBC__)) && (((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
/* Maybe libc doesn't have large file support. */
grub_err_t
grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)

View file

@ -1,7 +1,7 @@
# Template file for 'grub'
pkgname=grub
version=2.00
revision=16
revision=17
hostmakedepends="flex"
makedepends="libusb-compat-devel ncurses-devel freetype-devel
liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel"
@ -13,7 +13,12 @@ license="GPL-3"
homepage="http://www.gnu.org/software/grub/"
distfiles="$GNU_SITE/grub/grub-$version.tar.xz"
checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
only_for_archs="i686 x86_64"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
subpackages="grub-utils"
case "$XBPS_TARGET_MACHINE" in
x86_64*) subpackages+=" grub-x86_64-efi"; _GRUBX64=1;;
esac
post_extract() {
sed -i -e 's,freetype/ftsynth.h,freetype2/ftsynth.h,' util/grub-mkfont.c
@ -34,7 +39,7 @@ do_configure() {
cd $wrksrc/bios_build
../configure ${configure_args} --with-platform=pc
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
if [ -n "${_GRUBX64}" ]; then
mkdir $wrksrc/efi_build
cd $wrksrc/efi_build
../configure ${configure_args} --with-platform=efi \
@ -47,7 +52,7 @@ do_build() {
cd $wrksrc/bios_build
make ${makejobs}
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
if [ -n "${_GRUBX64}" ]; then
msg_normal "Building EFI grub...\n"
cd $wrksrc/efi_build
make ${makejobs}
@ -55,7 +60,7 @@ do_build() {
}
do_install() {
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
if [ -n "${_GRUBX64}" ]; then
cd $wrksrc/efi_build
make DESTDIR=$DESTDIR/efi install
# Remove non-platform specific files
@ -103,14 +108,11 @@ grub-utils_package() {
vmove usr/bin/grub-mount
}
}
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
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
}
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
}
fi # !x86_64
}