[Buildroot] [PATCH v2, 1/1] package/cups-filters: fix build without dejavu font

Fabrice Fontaine fontaine.fabrice at gmail.com
Tue Jul 14 13:09:25 UTC 2020


Hi Thomas,

Le mar. 14 juil. 2020 à 14:47, Thomas Petazzoni
<thomas.petazzoni at bootlin.com> a écrit :
>
> On Tue, 14 Jul 2020 13:23:07 +0200
> Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:
>
> > +-AS_IF([test -f "$with_test_font_path"],
> > +-    [AC_DEFINE_UNQUOTED([TESTFONT], ["$with_test_font_path"], [Path to font used in tests])],
> > ++AS_IF([test "x$cross_compiling" != "xyes" && ! test -f "$with_test_font_path"],
> > +     [AC_MSG_ERROR(DejaVuSans.ttf font file is missing. Please install a package providing it.)]
> > + )
> > ++AC_DEFINE_UNQUOTED([TESTFONT], ["$with_test_font_path"], [Path to font used in tests])
>
> While I understand this is "fixing" the build issue, I don't understand
> how it makes sense. The ttfread program, built from fontembed/main.c,
> will use the TESTFONT macro.
>
> So it means that your program on the target will point to a font on the
> target that may not exists as its path was detected on the build
> machine.
>
> This doesn't seem right. Am I missing something here ?
This font is only used for test programs and Yann even suggested me to
point to /dev/null in the first review of this patch.
In particular, TESTFONT is used by fontembed/main.c only if the user
does not provide any arguments:

const char *fn=TESTFONT;
if (argc==2) {
fn=argv[1];
}

However, if you think it's better to use --with-test-font-path to set
the test font path to /usr/share/fonts/dejavu/DejaVuSans.ttf (i.e. the
default value when cups-filters does not find it on the build
machine), I can send a v3.
But this does not seem better to hardcode this path without adding a
dependency on dejavu ...
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice



More information about the buildroot mailing list