Peter Hutterer 4e595ce
From e67e988730346c63d2f0cdf2531ed36b0c7ad5a6 Mon Sep 17 00:00:00 2001
Peter Hutterer 4e595ce
From: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer 4e595ce
Date: Wed, 23 Nov 2022 14:50:29 +1000
Peter Hutterer 4e595ce
Subject: [PATCH xserver] configure.ac: search for the fontrootdir ourselves
Peter Hutterer 4e595ce
Peter Hutterer 4e595ce
This replaces the use of font-utils' .m4 macro set with a copy of the
Peter Hutterer 4e595ce
only one we actually want: the bit for the fontrootpath.
Peter Hutterer 4e595ce
Peter Hutterer 4e595ce
We don't need configure options for every single subfont directory, so
Peter Hutterer 4e595ce
let's hardcode those in the default font path. Like meson does upstream
Peter Hutterer 4e595ce
too.
Peter Hutterer 4e595ce
Peter Hutterer 4e595ce
With this patch we no longer require the font-utils dependency.
Peter Hutterer 4e595ce
Peter Hutterer 4e595ce
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer 4e595ce
---
Peter Hutterer 4e595ce
 configure.ac | 28 +++++++++++++++++-----------
Peter Hutterer 4e595ce
 1 file changed, 17 insertions(+), 11 deletions(-)
Peter Hutterer 4e595ce
Peter Hutterer 4e595ce
diff --git a/configure.ac b/configure.ac
Peter Hutterer 4e595ce
index 0909cc5b4d..2349320888 100644
Peter Hutterer 4e595ce
--- a/configure.ac
Peter Hutterer 4e595ce
+++ b/configure.ac
Peter Hutterer 4e595ce
@@ -49,9 +49,6 @@ XORG_WITH_XSLTPROC
Peter Hutterer 4e595ce
 XORG_ENABLE_UNIT_TESTS
Peter Hutterer 4e595ce
 XORG_LD_WRAP([optional])
Peter Hutterer 4e595ce
 
Peter Hutterer 4e595ce
-m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])])
Peter Hutterer 4e595ce
-XORG_FONT_MACROS_VERSION(1.1)
Peter Hutterer 4e595ce
-
Peter Hutterer 4e595ce
 dnl this gets generated by autoheader, and thus contains all the defines.  we
Peter Hutterer 4e595ce
 dnl don't ever actually use it, internally.
Peter Hutterer 4e595ce
 AC_CONFIG_HEADERS(include/do-not-use-config.h)
Peter Hutterer 4e595ce
@@ -450,18 +447,27 @@ AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER])
Peter Hutterer 4e595ce
 AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ])
Peter Hutterer 4e595ce
 
Peter Hutterer 4e595ce
 dnl Determine font path
Peter Hutterer 4e595ce
-XORG_FONTROOTDIR
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc)
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF)
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF)
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
Peter Hutterer 4e595ce
-XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
Peter Hutterer 4e595ce
+dnl This is a copy of XORG_FONTROOTDIR from font-utils so we can drop the dependency
Peter Hutterer 4e595ce
+AC_MSG_CHECKING([for root directory for font files])
Peter Hutterer 4e595ce
+AC_ARG_WITH(fontrootdir,
Peter Hutterer 4e595ce
+	    AS_HELP_STRING([--with-fontrootdir=DIR],
Peter Hutterer 4e595ce
+		   [Path to root directory for font files]),
Peter Hutterer 4e595ce
+	    [FONTROOTDIR="$withval"])
Peter Hutterer 4e595ce
+# if --with-fontrootdir not specified...
Peter Hutterer 4e595ce
+if test "x${FONTROOTDIR}" = "x"; then
Peter Hutterer 4e595ce
+	FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
Peter Hutterer 4e595ce
+fi
Peter Hutterer 4e595ce
+# ...and if pkg-config didn't find fontdir in fontutil.pc...
Peter Hutterer 4e595ce
+if test "x${FONTROOTDIR}" = "x"; then
Peter Hutterer 4e595ce
+	FONTROOTDIR="${datadir}/fonts/X11"
Peter Hutterer 4e595ce
+fi
Peter Hutterer 4e595ce
+AC_SUBST(FONTROOTDIR)
Peter Hutterer 4e595ce
+AC_MSG_RESULT([${FONTROOTDIR}])
Peter Hutterer 4e595ce
 
Peter Hutterer 4e595ce
 dnl Uses --with-default-font-path if set, otherwise uses standard
Peter Hutterer 4e595ce
 dnl subdirectories of FONTROOTDIR. Some distros set the default font path to
Peter Hutterer 4e595ce
 dnl "catalogue:/etc/X11/fontpath.d,built-ins"
Peter Hutterer 4e595ce
-DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
Peter Hutterer 4e595ce
+DEFAULT_FONT_PATH="${FONTROOTDIR}/misc,${FONTROOTDIR}/OTF,${FONTROOTDIR}/TTF,${FONTROOTDIR}/Type1,${FONTROOTDIR}/75dpi,${FONTROOTDIR}/100dpi"
Peter Hutterer 4e595ce
 case $host_os in
Peter Hutterer 4e595ce
     darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
Peter Hutterer 4e595ce
 esac
Peter Hutterer 4e595ce
-- 
Peter Hutterer 4e595ce
2.38.1
Peter Hutterer 4e595ce