From c756efe696c83a26ebc2b529d3c11ae35ea00e4f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 17 Nov 2019 11:06:37 +0000 Subject: sys-boot/grub : backport 7e23437df3ad7572756102f3ab1063f284b57983 build Use pkg-config to find FreeType --- sys-boot/grub/files/08-find-freetype.patch | 114 +++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sys-boot/grub/files/08-find-freetype.patch (limited to 'sys-boot/grub/files') 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" -- cgit v1.2.3