summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Schmidt <git@ryandesign.com>2021-07-08 15:45:18 -0500
committerAkira TAGOH <akira@tagoh.org>2021-10-05 08:51:52 +0000
commit889097353ecd7b061ae7cf677e3db56db77a135f (patch)
treefd904c851272ac9e543d430856c3fd34bc614afb
parent6e414d61c77b2e6c08d0694ae61b848ee836b7eb (diff)
downloadfontconfig-889097353ecd7b061ae7cf677e3db56db77a135f.tar.gz
Fix FC_DEFAULT_FONTS on macOS and with BSD sed
Fix processing of FC_DEFAULT_FONTS when it contains multiple comma- separated values (i.e. on macOS/Darwin) and fix inserting it into fonts.conf when using BSD sed. Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/287
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac7
2 files changed, 6 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 1ef3669..2f75fc9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,7 +114,7 @@ FC_CONFIGDIR = $(subst $(BASECONFIGDIR)/,,$(CONFIGDIR))
fonts.conf: fonts.conf.in Makefile
sed \
-e 's,@FC_CACHEDIR\@,$(FC_CACHEDIR),g' \
- -e 's,@FC_DEFAULT_FONTS\@,$(FC_DEFAULT_FONTS),g' \
+ -e 's,@FC_DEFAULT_FONTS\@, $(FC_DEFAULT_FONTS),g' \
-e 's,@FC_FONTPATH\@,$(FC_FONTPATH),g' \
-e 's,@CONFIGDIR\@,$(FC_CONFIGDIR),g' \
-e 's,@PACKAGE\@,$(PACKAGE),g' \
diff --git a/configure.ac b/configure.ac
index 3bbd969..af2fd44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -499,8 +499,11 @@ FC_DEFAULT_FONTS=""
if test x${default_fonts+set} = xset; then
fc_IFS=$IFS
IFS=","
- for p in "$default_fonts"; do
- FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS\t<dir>$p</dir>\n"
+ for p in $default_fonts; do
+ if test x"$FC_DEFAULT_FONTS" != x; then
+ FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS "
+ fi
+ FC_DEFAULT_FONTS="$FC_DEFAULT_FONTS<dir>$p</dir>"
done
IFS=$fc_IFS
fi