1 |
commit: b6db5c287b3e0a43f2254376e32ea6ffe8a45dcf |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 4 15:46:06 2018 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 4 15:50:03 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6db5c28 |
7 |
|
8 |
sys-boot/grub: use pkg-config to find freetype2 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/654788 |
11 |
Package-Manager: Portage-2.3.31_p60, Repoman-2.3.9_p116 |
12 |
|
13 |
sys-boot/grub/files/2.02-freetype-pkg-config.patch | 73 ++++++++++++++++++++++ |
14 |
sys-boot/grub/grub-2.02-r1.ebuild | 14 ++++- |
15 |
sys-boot/grub/grub-9999.ebuild | 12 +++- |
16 |
3 files changed, 96 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/sys-boot/grub/files/2.02-freetype-pkg-config.patch b/sys-boot/grub/files/2.02-freetype-pkg-config.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..bc2f91759be |
21 |
--- /dev/null |
22 |
+++ b/sys-boot/grub/files/2.02-freetype-pkg-config.patch |
23 |
@@ -0,0 +1,73 @@ |
24 |
+From 3b0a266dead87906bcf440fd9ef12e1a514320ab Mon Sep 17 00:00:00 2001 |
25 |
+From: Mike Gilbert <floppym@g.o> |
26 |
+Date: Fri, 4 May 2018 13:43:59 +0200 |
27 |
+Subject: [PATCH] Use pkg-config to find freetype |
28 |
+ |
29 |
+As of freetype-2.9.1 the freetype-config script has been deprecated and |
30 |
+is no longer shipped by default. |
31 |
+ |
32 |
+Based on a patch by Lars Wendler <polynomial-c@g.o>. |
33 |
+--- |
34 |
+ configure.ac | 27 +++++++++++++++++++-------- |
35 |
+ 1 file changed, 19 insertions(+), 8 deletions(-) |
36 |
+ |
37 |
+diff --git a/configure.ac b/configure.ac |
38 |
+index c7888e40f..220f5ffc1 100644 |
39 |
+--- a/configure.ac |
40 |
++++ b/configure.ac |
41 |
+@@ -1510,7 +1510,8 @@ fi |
42 |
+ |
43 |
+ if test x"$grub_mkfont_excuse" = x ; then |
44 |
+ # Check for freetype libraries. |
45 |
+- AC_CHECK_TOOLS([FREETYPE], [freetype-config]) |
46 |
++ PKG_PROG_PKG_CONFIG |
47 |
++ PKG_CHECK_MODULES(FREETYPE2, freetype2, FREETYPE=yes) |
48 |
+ if test "x$FREETYPE" = x ; then |
49 |
+ grub_mkfont_excuse=["need freetype2 library"] |
50 |
+ fi |
51 |
+@@ -1520,8 +1521,8 @@ unset ac_cv_header_ft2build_h |
52 |
+ |
53 |
+ if test x"$grub_mkfont_excuse" = x ; then |
54 |
+ # Check for freetype libraries. |
55 |
+- freetype_cflags=`$FREETYPE --cflags` |
56 |
+- freetype_libs=`$FREETYPE --libs` |
57 |
++ freetype_cflags="$FREETYPE2_CFLAGS" |
58 |
++ freetype_libs="$FREETYPE2_LIBS" |
59 |
+ SAVED_CPPFLAGS="$CPPFLAGS" |
60 |
+ SAVED_LIBS="$LIBS" |
61 |
+ CPPFLAGS="$CPPFLAGS $freetype_cflags" |
62 |
+@@ -1573,16 +1574,26 @@ AC_SUBST([BUILD_WORDS_BIGENDIAN]) |
63 |
+ |
64 |
+ if test x"$grub_build_mkfont_excuse" = x ; then |
65 |
+ # Check for freetype libraries. |
66 |
+- AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config]) |
67 |
+- if test "x$BUILD_FREETYPE" = x ; then |
68 |
+- grub_build_mkfont_excuse=["need freetype2 library"] |
69 |
++ if test -z "$BUILD_FREETYPE2_CFLAGS" || test -z "$BUILD_FREETYPE2_LIBS" ; then |
70 |
++ AC_CHECK_PROGS([BUILD_PKGCONFIG], [pkg-config]) |
71 |
++ if test -z "$BUILD_PKGCONFIG" ; then |
72 |
++ grub_build_mkfont_excuse=["need pkg-config"] |
73 |
++ elif ! "$BUILD_PKGCONFIG" --exists freetype2 ; then |
74 |
++ grub_build_mkfont_excuse=["need freetype2 library"] |
75 |
++ fi |
76 |
+ fi |
77 |
+ fi |
78 |
+ |
79 |
+ if test x"$grub_build_mkfont_excuse" = x ; then |
80 |
+ # Check for freetype libraries. |
81 |
+- build_freetype_cflags=`$BUILD_FREETYPE --cflags` |
82 |
+- build_freetype_libs=`$BUILD_FREETYPE --libs` |
83 |
++ if test -z "$BUILD_FREETYPE2_CFLAGS" ; then |
84 |
++ BUILD_FREETYPE2_CFLAGS=`$BUILD_PKGCONFIG --cflags freetype2` |
85 |
++ fi |
86 |
++ if test -z "$BUILD_FREETYPE2_LIBS" ; then |
87 |
++ BUILD_FREETYPE2_LIBS=`$BUILD_PKGCONFIG --libs freetype2` |
88 |
++ fi |
89 |
++ build_freetype_cflags="$BUILD_FREETYPE2_CFLAGS" |
90 |
++ build_freetype_libs="$BUILD_FREETYPE2_LIBS" |
91 |
+ SAVED_CPPFLAGS_2="$CPPFLAGS" |
92 |
+ SAVED_LIBS="$LIBS" |
93 |
+ CPPFLAGS="$CPPFLAGS $build_freetype_cflags" |
94 |
+-- |
95 |
+2.17.0 |
96 |
+ |
97 |
|
98 |
diff --git a/sys-boot/grub/grub-2.02-r1.ebuild b/sys-boot/grub/grub-2.02-r1.ebuild |
99 |
index 7b3b5251bc1..a82ceccfbd2 100644 |
100 |
--- a/sys-boot/grub/grub-2.02-r1.ebuild |
101 |
+++ b/sys-boot/grub/grub-2.02-r1.ebuild |
102 |
@@ -5,12 +5,20 @@ EAPI=6 |
103 |
|
104 |
if [[ ${PV} == 9999 ]]; then |
105 |
GRUB_AUTOGEN=1 |
106 |
+ GRUB_AUTORECONF=1 |
107 |
fi |
108 |
|
109 |
+# 2.02-grub-pkg-config.patch modifies configure.ac |
110 |
+GRUB_AUTORECONF=1 |
111 |
+ |
112 |
if [[ -n ${GRUB_AUTOGEN} ]]; then |
113 |
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) |
114 |
+ inherit python-any-r1 |
115 |
+fi |
116 |
+ |
117 |
+if [[ -n ${GRUB_AUTORECONF} ]]; then |
118 |
WANT_LIBTOOL=none |
119 |
- inherit autotools python-any-r1 |
120 |
+ inherit autotools |
121 |
fi |
122 |
|
123 |
inherit autotools bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs versionator |
124 |
@@ -36,6 +44,7 @@ PATCHES=( |
125 |
"${FILESDIR}"/gfxpayload.patch |
126 |
"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch |
127 |
"${FILESDIR}"/2.02-multiple-early-initrd.patch |
128 |
+ "${FILESDIR}"/2.02-freetype-pkg-config.patch |
129 |
) |
130 |
|
131 |
DEJAVU=dejavu-sans-ttf-2.37 |
132 |
@@ -154,6 +163,9 @@ src_prepare() { |
133 |
if [[ -n ${GRUB_AUTOGEN} ]]; then |
134 |
python_setup |
135 |
bash autogen.sh || die |
136 |
+ fi |
137 |
+ |
138 |
+ if [[ -n ${GRUB_AUTORECONF} ]]; then |
139 |
autopoint() { :; } |
140 |
eautoreconf |
141 |
fi |
142 |
|
143 |
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild |
144 |
index cc6db989c6e..d5bfc5ad9ac 100644 |
145 |
--- a/sys-boot/grub/grub-9999.ebuild |
146 |
+++ b/sys-boot/grub/grub-9999.ebuild |
147 |
@@ -1,16 +1,21 @@ |
148 |
-# Copyright 1999-2017 Gentoo Foundation |
149 |
+# Copyright 1999-2018 Gentoo Foundation |
150 |
# Distributed under the terms of the GNU General Public License v2 |
151 |
|
152 |
EAPI=6 |
153 |
|
154 |
if [[ ${PV} == 9999 ]]; then |
155 |
GRUB_AUTOGEN=1 |
156 |
+ GRUB_AUTORECONF=1 |
157 |
fi |
158 |
|
159 |
if [[ -n ${GRUB_AUTOGEN} ]]; then |
160 |
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) |
161 |
+ inherit python-any-r1 |
162 |
+fi |
163 |
+ |
164 |
+if [[ -n ${GRUB_AUTORECONF} ]]; then |
165 |
WANT_LIBTOOL=none |
166 |
- inherit autotools python-any-r1 |
167 |
+ inherit autotools |
168 |
fi |
169 |
|
170 |
inherit autotools bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs versionator |
171 |
@@ -153,6 +158,9 @@ src_prepare() { |
172 |
if [[ -n ${GRUB_AUTOGEN} ]]; then |
173 |
python_setup |
174 |
bash autogen.sh || die |
175 |
+ fi |
176 |
+ |
177 |
+ if [[ -n ${GRUB_AUTORECONF} ]]; then |
178 |
autopoint() { :; } |
179 |
eautoreconf |
180 |
fi |