Blame SOURCES/0001-configure.ac-search-for-the-fontrootdir-ourselves.patch

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