Drop dependency on xorg-x11-font-utils, it was only there for one

build-time variable that's always the same value anyway (#2145088)
This commit is contained in:
Peter Hutterer 2022-11-23 14:57:50 +10:00
parent 9fc1d98575
commit 4e595ce4fd
2 changed files with 83 additions and 2 deletions

View File

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

View File

@ -46,7 +46,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.20.14
Release: 9%{?gitdate:.%{gitdate}}%{?dist}
Release: 10%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
@ -92,6 +92,12 @@ Patch5: 0001-autobind-GPUs-to-the-screen.patch
# because the display-managers are not ready yet, do not upstream
Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
# Not sure anyone else cares about this so let's keep this Fedora-only for now
# Upstream PR for the meson.build equivalent is here, so we can drop this patch
# when we start building with meson.
# https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1001`
Patch7: 0001-configure.ac-search-for-the-fontrootdir-ourselves.patch
# Backports from current stable "server-1.20-branch":
# <empty>
@ -118,7 +124,6 @@ BuildRequires: automake autoconf libtool pkgconfig
BuildRequires: xorg-x11-util-macros >= 1.17
BuildRequires: xorg-x11-proto-devel >= 7.7-10
BuildRequires: xorg-x11-font-utils >= 7.2-11
BuildRequires: dbus-devel libepoxy-devel systemd-devel
BuildRequires: xorg-x11-xtrans-devel >= 1.3.2
@ -525,6 +530,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Wed Nov 23 2022 Peter Hutterer <peter.hutterer@redhat.com> - 1.20.14-10
- Drop dependency on xorg-x11-font-utils, it was only there for on
build-time variable that's always the same value anyway (#2145088)
* Tue Nov 8 2022 Olivier Fourdan <ofourdan@redhat.com> - 1.20.14-9
- Fix CVE-2022-3550, CVE-2022-3551