Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
Date: Fri, 04 May 2018 16:28:11
Message-Id: 1525451248.bdb2b41526b488a76a41ce55ab3a20f13b9a5cbf.floppym@gentoo
1 commit: bdb2b41526b488a76a41ce55ab3a20f13b9a5cbf
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 4 16:27:28 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri May 4 16:27:28 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdb2b415
7
8 sys-boot/grub: replace pkg-config patch with a series from Debian
9
10 Package-Manager: Portage-2.3.31_p60, Repoman-2.3.9_p116
11
12 .../files/2.02-freetype-capitalise-variables.patch | 126 ++++++++++++
13 sys-boot/grub/files/2.02-freetype-pkg-config.patch | 225 ++++++++++++++++-----
14 sys-boot/grub/grub-2.02-r1.ebuild | 8 +-
15 3 files changed, 301 insertions(+), 58 deletions(-)
16
17 diff --git a/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch b/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch
18 new file mode 100644
19 index 00000000000..9aa7f54f32a
20 --- /dev/null
21 +++ b/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch
22 @@ -0,0 +1,126 @@
23 +From ba84c8d1b4830e9fcb14d9f0e4a36e03ac40a09d Mon Sep 17 00:00:00 2001
24 +From: Colin Watson <cjwatson@××××××.com>
25 +Date: Tue, 30 Jan 2018 14:08:26 +0000
26 +Subject: build: Capitalise *freetype_* variables
27 +
28 +Using FREETYPE_CFLAGS and FREETYPE_LIBS is more in line with the naming
29 +scheme used by pkg-config macros.
30 +
31 +Bug-Debian: https://bugs.debian.org/887721
32 +Last-Update: 2018-02-11
33 +
34 +Patch-Name: freetype-capitalise-variables.patch
35 +---
36 + Makefile.am | 6 +++---
37 + Makefile.util.def | 4 ++--
38 + configure.ac | 24 ++++++++++++------------
39 + 3 files changed, 17 insertions(+), 17 deletions(-)
40 +
41 +diff --git a/Makefile.am b/Makefile.am
42 +index f0ab1adc3..b47b4b1ac 100644
43 +--- a/Makefile.am
44 ++++ b/Makefile.am
45 +@@ -71,7 +71,7 @@ endif
46 + starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/
47 themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0
48 +
49 + build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c
50 +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs)
51 ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS)
52 + CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT)
53 +
54 + garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c
55 +@@ -80,11 +80,11 @@ CLEANFILES += garbage-gen$(BUILD_EXEEXT)
56 + EXTRA_DIST += util/garbage-gen.c
57 +
58 + build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c
59 +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
60 ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS) -Wall -Werror
61 + CLEANFILES += build-grub-gen-asciih$(BUILD_EXEEXT)
62 +
63 + build-grub-gen-widthspec$(BUILD_EXEEXT): util/grub-gen-widthspec.c
64 +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
65 ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS) -Wall -Werror
66 + CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT)
67 +
68 + if COND_STARFIELD
69 +diff --git a/Makefile.util.def b/Makefile.util.def
70 +index 168acbe59..fa39d8bd1 100644
71 +--- a/Makefile.util.def
72 ++++ b/Makefile.util.def
73 +@@ -302,14 +302,14 @@ program = {
74 + common = grub-core/kern/emu/argp_common.c;
75 + common = grub-core/osdep/init.c;
76 +
77 +- cflags = '$(freetype_cflags)';
78 ++ cflags = '$(FREETYPE_CFLAGS)';
79 + cppflags = '-DGRUB_MKFONT=1';
80 +
81 + ldadd = libgrubmods.a;
82 + ldadd = libgrubgcry.a;
83 + ldadd = libgrubkern.a;
84 + ldadd = grub-core/gnulib/libgnu.a;
85 +- ldadd = '$(freetype_libs)';
86 ++ ldadd = '$(FREETYPE_LIBS)';
87 + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
88 + condition = COND_GRUB_MKFONT;
89 + };
90 +diff --git a/configure.ac b/configure.ac
91 +index cd1f49837..85c23bd62 100644
92 +--- a/configure.ac
93 ++++ b/configure.ac
94 +@@ -1505,12 +1505,12 @@ unset ac_cv_header_ft2build_h
95 +
96 + if test x"$grub_mkfont_excuse" = x ; then
97 + # Check for freetype libraries.
98 +- freetype_cflags=`$FREETYPE --cflags`
99 +- freetype_libs=`$FREETYPE --libs`
100 ++ FREETYPE_CFLAGS=`$FREETYPE --cflags`
101 ++ FREETYPE_LIBS=`$FREETYPE --libs`
102 + SAVED_CPPFLAGS="$CPPFLAGS"
103 + SAVED_LIBS="$LIBS"
104 +- CPPFLAGS="$CPPFLAGS $freetype_cflags"
105 +- LIBS="$LIBS $freetype_libs"
106 ++ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
107 ++ LIBS="$LIBS $FREETYPE_LIBS"
108 + AC_CHECK_HEADERS([ft2build.h], [],
109 + [grub_mkfont_excuse=["need freetype2 headers"]])
110 + AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]])
111 +@@ -1527,8 +1527,8 @@ else
112 + enable_grub_mkfont=no
113 + fi
114 + AC_SUBST([enable_grub_mkfont])
115 +-AC_SUBST([freetype_cflags])
116 +-AC_SUBST([freetype_libs])
117 ++AC_SUBST([FREETYPE_CFLAGS])
118 ++AC_SUBST([FREETYPE_LIBS])
119 +
120 + SAVED_CC="$CC"
121 + SAVED_CPP="$CPP"
122 +@@ -1566,12 +1566,12 @@ fi
123 +
124 + if test x"$grub_build_mkfont_excuse" = x ; then
125 + # Check for freetype libraries.
126 +- build_freetype_cflags=`$BUILD_FREETYPE --cflags`
127 +- build_freetype_libs=`$BUILD_FREETYPE --libs`
128 ++ BUILD_FREETYPE_CFLAGS=`$BUILD_FREETYPE --cflags`
129 ++ BUILD_FREETYPE_LIBS=`$BUILD_FREETYPE --libs`
130 + SAVED_CPPFLAGS_2="$CPPFLAGS"
131 + SAVED_LIBS="$LIBS"
132 +- CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
133 +- LIBS="$LIBS $build_freetype_libs"
134 ++ CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS"
135 ++ LIBS="$LIBS $BUILD_FREETYPE_LIBS"
136 + AC_CHECK_HEADERS([ft2build.h], [],
137 + [grub_build_mkfont_excuse=["need freetype2 headers"]])
138 + AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]])
139 +@@ -1595,8 +1595,8 @@ if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || tes
140 + fi
141 + fi
142 +
143 +-AC_SUBST([build_freetype_cflags])
144 +-AC_SUBST([build_freetype_libs])
145 ++AC_SUBST([BUILD_FREETYPE_CFLAGS])
146 ++AC_SUBST([BUILD_FREETYPE_LIBS])
147 +
148 + CC="$SAVED_CC"
149 + CPP="$SAVED_CPP"
150
151 diff --git a/sys-boot/grub/files/2.02-freetype-pkg-config.patch b/sys-boot/grub/files/2.02-freetype-pkg-config.patch
152 index bc2f91759be..94437f073c4 100644
153 --- a/sys-boot/grub/files/2.02-freetype-pkg-config.patch
154 +++ b/sys-boot/grub/files/2.02-freetype-pkg-config.patch
155 @@ -1,73 +1,194 @@
156 -From 3b0a266dead87906bcf440fd9ef12e1a514320ab Mon Sep 17 00:00:00 2001
157 -From: Mike Gilbert <floppym@g.o>
158 -Date: Fri, 4 May 2018 13:43:59 +0200
159 -Subject: [PATCH] Use pkg-config to find freetype
160 +From 3eec911197081a63d9dae28f1784ad01a06fb60a Mon Sep 17 00:00:00 2001
161 +From: Colin Watson <cjwatson@××××××.com>
162 +Date: Tue, 30 Jan 2018 21:54:17 +0000
163 +Subject: build: Use pkg-config to find FreeType
164
165 -As of freetype-2.9.1 the freetype-config script has been deprecated and
166 -is no longer shipped by default.
167 +pkg-config is apparently preferred over freetype-config these days (see
168 +the BUGS section of freetype-config(1)). pkg-config support was added
169 +to FreeType in version 2.1.5, which was released in 2003, so it should
170 +comfortably be available everywhere by now.
171
172 -Based on a patch by Lars Wendler <polynomial-c@g.o>.
173 +We no longer need to explicitly substitute FREETYPE_CFLAGS and
174 +FREETYPE_LIBS, since PKG_CHECK_MODULES does that automatically.
175 +
176 +Fixes Debian bug #887721.
177 +
178 +Reported-by: Hugh McMaster <hugh.mcmaster@×××××××.com>
179 +Signed-off-by: Colin Watson <cjwatson@××××××.com>
180 +
181 +Bug-Debian: https://bugs.debian.org/887721
182 +Last-Update: 2018-02-11
183 +
184 +Patch-Name: freetype-pkg-config.patch
185 ---
186 - configure.ac | 27 +++++++++++++++++++--------
187 - 1 file changed, 19 insertions(+), 8 deletions(-)
188 + INSTALL | 11 +++++----
189 + configure.ac | 74 +++++++++++++++++++++++++-----------------------------------
190 + 2 files changed, 37 insertions(+), 48 deletions(-)
191
192 +diff --git a/INSTALL b/INSTALL
193 +index f3c20edc8..b370d7753 100644
194 +--- a/INSTALL
195 ++++ b/INSTALL
196 +@@ -37,6 +37,7 @@ configuring the GRUB.
197 + * GNU gettext 0.17 or later
198 + * GNU binutils 2.9.1.0.23 or later
199 + * Flex 2.5.35 or later
200 ++* pkg-config
201 + * Other standard GNU/Unix tools
202 + * a libc with large file support (e.g. glibc 2.1 or later)
203 +
204 +@@ -52,7 +53,7 @@ For optional grub-emu features, you need:
205 +
206 + To build GRUB's graphical terminal (gfxterm), you need:
207 +
208 +-* FreeType 2 or later
209 ++* FreeType 2.1.5 or later
210 + * GNU Unifont
211 +
212 + If you use a development snapshot or want to hack on GRUB you may
213 +@@ -158,8 +159,8 @@ For this example the configure line might look like (more details below)
214 + (some options are optional and included here for completeness but some rarely
215 + used options are omitted):
216 +
217 +-./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu
218 +-CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config
219 ++./configure BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config --host=amd64-linux-gnu
220 ++CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" PKG_CONFIG=amd64-linux-gnu-pkg-config
221 + --target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc
222 + TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6"
223 + TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip"
224 +@@ -176,7 +177,7 @@ corresponding platform are not needed for the platform in question.
225 + 2. BUILD_CFLAGS= for C options for build.
226 + 3. BUILD_CPPFLAGS= for C preprocessor options for build.
227 + 4. BUILD_LDFLAGS= for linker options for build.
228 +- 5. BUILD_FREETYPE= for freetype-config for build (optional).
229 ++ 5. BUILD_PKG_CONFIG= for pkg-config for build (optional).
230 +
231 + - For host
232 + 1. --host= to autoconf name of host.
233 +@@ -184,7 +185,7 @@ corresponding platform are not needed for the platform in question.
234 + 3. HOST_CFLAGS= for C options for host.
235 + 4. HOST_CPPFLAGS= for C preprocessor options for host.
236 + 5. HOST_LDFLAGS= for linker options for host.
237 +- 6. FREETYPE= for freetype-config for host (optional).
238 ++ 6. PKG_CONFIG= for pkg-config for host (optional).
239 + 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional).
240 + 8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
241 + 9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
242 diff --git a/configure.ac b/configure.ac
243 -index c7888e40f..220f5ffc1 100644
244 +index 85c23bd62..f102b7024 100644
245 --- a/configure.ac
246 +++ b/configure.ac
247 -@@ -1510,7 +1510,8 @@ fi
248 +@@ -50,6 +50,10 @@ AC_PREREQ(2.60)
249 + AC_CONFIG_SRCDIR([include/grub/dl.h])
250 + AC_CONFIG_HEADER([config-util.h])
251
252 - if test x"$grub_mkfont_excuse" = x ; then
253 - # Check for freetype libraries.
254 ++# Explicitly check for pkg-config early on, since otherwise conditional
255 ++# calls are problematic.
256 ++PKG_PROG_PKG_CONFIG
257 ++
258 + # Program name transformations
259 + AC_ARG_PROGRAM
260 + grub_TRANSFORM([grub-bios-setup])
261 +@@ -1493,29 +1497,22 @@ if test x"$enable_grub_mkfont" = xno ; then
262 + grub_mkfont_excuse="explicitly disabled"
263 + fi
264 +
265 +-if test x"$grub_mkfont_excuse" = x ; then
266 +- # Check for freetype libraries.
267 - AC_CHECK_TOOLS([FREETYPE], [freetype-config])
268 -+ PKG_PROG_PKG_CONFIG
269 -+ PKG_CHECK_MODULES(FREETYPE2, freetype2, FREETYPE=yes)
270 - if test "x$FREETYPE" = x ; then
271 - grub_mkfont_excuse=["need freetype2 library"]
272 - fi
273 -@@ -1520,8 +1521,8 @@ unset ac_cv_header_ft2build_h
274 +- if test "x$FREETYPE" = x ; then
275 +- grub_mkfont_excuse=["need freetype2 library"]
276 +- fi
277 +-fi
278 +-
279 + unset ac_cv_header_ft2build_h
280
281 if test x"$grub_mkfont_excuse" = x ; then
282 # Check for freetype libraries.
283 -- freetype_cflags=`$FREETYPE --cflags`
284 -- freetype_libs=`$FREETYPE --libs`
285 -+ freetype_cflags="$FREETYPE2_CFLAGS"
286 -+ freetype_libs="$FREETYPE2_LIBS"
287 - SAVED_CPPFLAGS="$CPPFLAGS"
288 - SAVED_LIBS="$LIBS"
289 - CPPFLAGS="$CPPFLAGS $freetype_cflags"
290 -@@ -1573,16 +1574,26 @@ AC_SUBST([BUILD_WORDS_BIGENDIAN])
291 +- FREETYPE_CFLAGS=`$FREETYPE --cflags`
292 +- FREETYPE_LIBS=`$FREETYPE --libs`
293 +- SAVED_CPPFLAGS="$CPPFLAGS"
294 +- SAVED_LIBS="$LIBS"
295 +- CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
296 +- LIBS="$LIBS $FREETYPE_LIBS"
297 +- AC_CHECK_HEADERS([ft2build.h], [],
298 +- [grub_mkfont_excuse=["need freetype2 headers"]])
299 +- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]])
300 +- CPPFLAGS="$SAVED_CPPFLAGS"
301 +- LIBS="$SAVED_LIBS"
302 ++ PKG_CHECK_MODULES([FREETYPE], [freetype2], [
303 ++ SAVED_CPPFLAGS="$CPPFLAGS"
304 ++ SAVED_LIBS="$LIBS"
305 ++ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
306 ++ LIBS="$LIBS $FREETYPE_LIBS"
307 ++ AC_CHECK_HEADERS([ft2build.h], [],
308 ++ [grub_mkfont_excuse=["need freetype2 headers"]])
309 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [],
310 ++ [grub_mkfont_excuse=["freetype2 library unusable"]])
311 ++ CPPFLAGS="$SAVED_CPPFLAGS"
312 ++ LIBS="$SAVED_LIBS"
313 ++ ], [grub_mkfont_excuse=["need freetype2 library"]])
314 + fi
315 +
316 + if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
317 +@@ -1527,8 +1524,6 @@ else
318 + enable_grub_mkfont=no
319 + fi
320 + AC_SUBST([enable_grub_mkfont])
321 +-AC_SUBST([FREETYPE_CFLAGS])
322 +-AC_SUBST([FREETYPE_LIBS])
323 +
324 + SAVED_CC="$CC"
325 + SAVED_CPP="$CPP"
326 +@@ -1558,25 +1553,21 @@ AC_SUBST([BUILD_WORDS_BIGENDIAN])
327
328 if test x"$grub_build_mkfont_excuse" = x ; then
329 # Check for freetype libraries.
330 - AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config])
331 - if test "x$BUILD_FREETYPE" = x ; then
332 - grub_build_mkfont_excuse=["need freetype2 library"]
333 -+ if test -z "$BUILD_FREETYPE2_CFLAGS" || test -z "$BUILD_FREETYPE2_LIBS" ; then
334 -+ AC_CHECK_PROGS([BUILD_PKGCONFIG], [pkg-config])
335 -+ if test -z "$BUILD_PKGCONFIG" ; then
336 -+ grub_build_mkfont_excuse=["need pkg-config"]
337 -+ elif ! "$BUILD_PKGCONFIG" --exists freetype2 ; then
338 -+ grub_build_mkfont_excuse=["need freetype2 library"]
339 -+ fi
340 +- fi
341 +-fi
342 +-
343 +-if test x"$grub_build_mkfont_excuse" = x ; then
344 +- # Check for freetype libraries.
345 +- BUILD_FREETYPE_CFLAGS=`$BUILD_FREETYPE --cflags`
346 +- BUILD_FREETYPE_LIBS=`$BUILD_FREETYPE --libs`
347 +- SAVED_CPPFLAGS_2="$CPPFLAGS"
348 +- SAVED_LIBS="$LIBS"
349 +- CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS"
350 +- LIBS="$LIBS $BUILD_FREETYPE_LIBS"
351 +- AC_CHECK_HEADERS([ft2build.h], [],
352 +- [grub_build_mkfont_excuse=["need freetype2 headers"]])
353 +- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]])
354 +- LIBS="$SAVED_LIBS"
355 +- CPPFLAGS="$SAVED_CPPFLAGS_2"
356 ++ SAVED_PKG_CONFIG="$PKG_CONFIG"
357 ++ test -z "$BUILD_PKG_CONFIG" || PKG_CONFIG="$BUILD_PKG_CONFIG"
358 ++ PKG_CHECK_MODULES([BUILD_FREETYPE], [freetype2], [
359 ++ SAVED_CPPFLAGS_2="$CPPFLAGS"
360 ++ SAVED_LIBS="$LIBS"
361 ++ CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS"
362 ++ LIBS="$LIBS $BUILD_FREETYPE_LIBS"
363 ++ AC_CHECK_HEADERS([ft2build.h], [],
364 ++ [grub_build_mkfont_excuse=["need freetype2 headers"]])
365 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [],
366 ++ [grub_build_mkfont_excuse=["freetype2 library unusable"]])
367 ++ LIBS="$SAVED_LIBS"
368 ++ CPPFLAGS="$SAVED_CPPFLAGS_2"
369 ++ ], [grub_build_mkfont_excuse=["need freetype2 library"]])
370 ++ PKG_CONFIG="$SAVED_PKG_CONFIG"
371 + fi
372 +
373 + if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
374 +@@ -1595,9 +1586,6 @@ if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || tes
375 fi
376 fi
377
378 - if test x"$grub_build_mkfont_excuse" = x ; then
379 - # Check for freetype libraries.
380 -- build_freetype_cflags=`$BUILD_FREETYPE --cflags`
381 -- build_freetype_libs=`$BUILD_FREETYPE --libs`
382 -+ if test -z "$BUILD_FREETYPE2_CFLAGS" ; then
383 -+ BUILD_FREETYPE2_CFLAGS=`$BUILD_PKGCONFIG --cflags freetype2`
384 -+ fi
385 -+ if test -z "$BUILD_FREETYPE2_LIBS" ; then
386 -+ BUILD_FREETYPE2_LIBS=`$BUILD_PKGCONFIG --libs freetype2`
387 -+ fi
388 -+ build_freetype_cflags="$BUILD_FREETYPE2_CFLAGS"
389 -+ build_freetype_libs="$BUILD_FREETYPE2_LIBS"
390 - SAVED_CPPFLAGS_2="$CPPFLAGS"
391 - SAVED_LIBS="$LIBS"
392 - CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
393 ---
394 -2.17.0
395 -
396 +-AC_SUBST([BUILD_FREETYPE_CFLAGS])
397 +-AC_SUBST([BUILD_FREETYPE_LIBS])
398 +-
399 + CC="$SAVED_CC"
400 + CPP="$SAVED_CPP"
401 + CFLAGS="$SAVED_CFLAGS"
402
403 diff --git a/sys-boot/grub/grub-2.02-r1.ebuild b/sys-boot/grub/grub-2.02-r1.ebuild
404 index a82ceccfbd2..d18b6e78cb6 100644
405 --- a/sys-boot/grub/grub-2.02-r1.ebuild
406 +++ b/sys-boot/grub/grub-2.02-r1.ebuild
407 @@ -3,12 +3,7 @@
408
409 EAPI=6
410
411 -if [[ ${PV} == 9999 ]]; then
412 - GRUB_AUTOGEN=1
413 - GRUB_AUTORECONF=1
414 -fi
415 -
416 -# 2.02-grub-pkg-config.patch modifies configure.ac
417 +GRUB_AUTOGEN=1
418 GRUB_AUTORECONF=1
419
420 if [[ -n ${GRUB_AUTOGEN} ]]; then
421 @@ -44,6 +39,7 @@ PATCHES=(
422 "${FILESDIR}"/gfxpayload.patch
423 "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
424 "${FILESDIR}"/2.02-multiple-early-initrd.patch
425 + "${FILESDIR}"/2.02-freetype-capitalise-variables.patch
426 "${FILESDIR}"/2.02-freetype-pkg-config.patch
427 )