diff options
-rw-r--r-- | sys-boot/grub/files/08-find-freetype.patch | 114 | ||||
-rw-r--r-- | sys-boot/grub/grub-2.02-r1337.ebuild | 9 |
2 files changed, 122 insertions, 1 deletions
diff --git a/sys-boot/grub/files/08-find-freetype.patch b/sys-boot/grub/files/08-find-freetype.patch new file mode 100644 index 00000000..83b55449 --- /dev/null +++ b/sys-boot/grub/files/08-find-freetype.patch @@ -0,0 +1,114 @@ +diff -Nur a/configure.ac b/configure.ac +--- a/configure.ac 2017-04-24 12:30:15.000000000 +0100 ++++ b/configure.ac 2019-11-17 10:48:41.595490019 +0000 +@@ -50,6 +50,8 @@ + AC_CONFIG_SRCDIR([include/grub/dl.h]) + AC_CONFIG_HEADER([config-util.h]) + ++PKG_PROG_PKG_CONFIG ++ + # Program name transformations + AC_ARG_PROGRAM + grub_TRANSFORM([grub-bios-setup]) +@@ -1493,29 +1495,22 @@ + grub_mkfont_excuse="explicitly disabled" + fi + +-if test x"$grub_mkfont_excuse" = x ; then +- # Check for freetype libraries. +- AC_CHECK_TOOLS([FREETYPE], [freetype-config]) +- if test "x$FREETYPE" = x ; then +- grub_mkfont_excuse=["need freetype2 library"] +- fi +-fi +- + unset ac_cv_header_ft2build_h + + if test x"$grub_mkfont_excuse" = x ; then + # Check for freetype libraries. +- freetype_cflags=`$FREETYPE --cflags` +- freetype_libs=`$FREETYPE --libs` +- SAVED_CPPFLAGS="$CPPFLAGS" +- SAVED_LIBS="$LIBS" +- CPPFLAGS="$CPPFLAGS $freetype_cflags" +- LIBS="$LIBS $freetype_libs" +- AC_CHECK_HEADERS([ft2build.h], [], +- [grub_mkfont_excuse=["need freetype2 headers"]]) +- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]]) +- CPPFLAGS="$SAVED_CPPFLAGS" +- LIBS="$SAVED_LIBS" ++ PKG_CHECK_MODULES([FREETYPE], [freetype2], [ ++ SAVED_CPPFLAGS="$CPPFLAGS" ++ SAVED_LIBS="$LIBS" ++ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" ++ LIBS="$LIBS $FREETYPE_LIBS" ++ AC_CHECK_HEADERS([ft2build.h], [], ++ [grub_mkfont_excuse=["need freetype2 headers"]]) ++ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], ++ [grub_mkfont_excuse=["freetype2 library unusable"]]) ++ CPPFLAGS="$SAVED_CPPFLAGS" ++ LIBS="$SAVED_LIBS" ++ ], [grub_mkfont_excuse=["need freetype2 library"]]) + fi + + if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then +@@ -1527,8 +1522,6 @@ + enable_grub_mkfont=no + fi + AC_SUBST([enable_grub_mkfont]) +-AC_SUBST([freetype_cflags]) +-AC_SUBST([freetype_libs]) + + SAVED_CC="$CC" + SAVED_CPP="$CPP" +@@ -1558,25 +1551,21 @@ + + if test x"$grub_build_mkfont_excuse" = x ; then + # Check for freetype libraries. +- AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config]) +- if test "x$BUILD_FREETYPE" = x ; then +- grub_build_mkfont_excuse=["need freetype2 library"] +- fi +-fi +- +-if test x"$grub_build_mkfont_excuse" = x ; then +- # Check for freetype libraries. +- build_freetype_cflags=`$BUILD_FREETYPE --cflags` +- build_freetype_libs=`$BUILD_FREETYPE --libs` +- SAVED_CPPFLAGS_2="$CPPFLAGS" +- SAVED_LIBS="$LIBS" +- CPPFLAGS="$CPPFLAGS $build_freetype_cflags" +- LIBS="$LIBS $build_freetype_libs" +- AC_CHECK_HEADERS([ft2build.h], [], +- [grub_build_mkfont_excuse=["need freetype2 headers"]]) +- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]]) +- LIBS="$SAVED_LIBS" +- CPPFLAGS="$SAVED_CPPFLAGS_2" ++ SAVED_PKG_CONFIG="$PKG_CONFIG" ++ test -z "$BUILD_PKG_CONFIG" || PKG_CONFIG="$BUILD_PKG_CONFIG" ++ PKG_CHECK_MODULES([BUILD_FREETYPE], [freetype2], [ ++ SAVED_CPPFLAGS_2="$CPPFLAGS" ++ SAVED_LIBS="$LIBS" ++ CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS" ++ LIBS="$LIBS $BUILD_FREETYPE_LIBS" ++ AC_CHECK_HEADERS([ft2build.h], [], ++ [grub_build_mkfont_excuse=["need freetype2 headers"]]) ++ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], ++ [grub_build_mkfont_excuse=["freetype2 library unusable"]]) ++ LIBS="$SAVED_LIBS" ++ CPPFLAGS="$SAVED_CPPFLAGS_2" ++ ], [grub_build_mkfont_excuse=["need freetype2 library"]]) ++ PKG_CONFIG="$SAVED_PKG_CONFIG" + fi + + if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then +@@ -1595,9 +1584,6 @@ + fi + fi + +-AC_SUBST([build_freetype_cflags]) +-AC_SUBST([build_freetype_libs]) +- + CC="$SAVED_CC" + CPP="$SAVED_CPP" + CFLAGS="$SAVED_CFLAGS" diff --git a/sys-boot/grub/grub-2.02-r1337.ebuild b/sys-boot/grub/grub-2.02-r1337.ebuild index 7752a693..927538f0 100644 --- a/sys-boot/grub/grub-2.02-r1337.ebuild +++ b/sys-boot/grub/grub-2.02-r1337.ebuild @@ -40,6 +40,7 @@ PATCHES=( "${FILESDIR}"/05-gfxpayload.patch "${FILESDIR}"/06-KERNEL_GLOBS.patch "${FILESDIR}"/07-Allow_GRUB_to_mount_ext234_filesystems_that_have_the_encryption_feature.patch + "${FILESDIR}"/08-find-freetype.patch ) DEJAVU=dejavu-sans-ttf-2.37 @@ -88,7 +89,10 @@ DEPEND="${RDEPEND} sys-apps/help2man sys-apps/texinfo sys-boot/grub-config-redcore - fonts? ( media-libs/freetype:2 ) + fonts? ( + media-libs/freetype:2 + virtual/pkgconfig + ) grub_platforms_xen? ( app-emulation/xen-tools:= ) grub_platforms_xen-32? ( app-emulation/xen-tools:= ) static? ( @@ -97,6 +101,7 @@ DEPEND="${RDEPEND} app-arch/bzip2[static-libs(+)] media-libs/freetype[static-libs(+)] sys-libs/zlib[static-libs(+)] + virtual/pkgconfig ) ) test? ( @@ -196,6 +201,8 @@ grub_configure() { esac local myeconfargs=( + FREETYPE="pkg-config freetype2" + BUILD_FREETYPE="pkg-config freetype2" --disable-werror --program-prefix= --libdir="${EPREFIX}"/usr/lib |