From 4320b1d82da1bfe1519800ae3ac35b6b59a9da56 Mon Sep 17 00:00:00 2001 From: Thomas Loimer Date: Fri, 8 Sep 2023 18:43:00 +0200 Subject: [PATCH 2/3] Use pkg-config to set fontconfig CFLAGS and LIBS --- configure.ac | 16 +++++++++++++--- src/Makefile.am | 8 +++----- tests/Makefile.am | 4 ++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 47452c5..3113db8 100644 --- a/configure.ac +++ b/configure.ac @@ -81,11 +81,23 @@ AC_PROG_SED AM_PROG_AR # Search for pkg-config and set PKG_CONFIG to the path found, else empty. -# PKG_PROG_PKG_CONFIG +PKG_PROG_PKG_CONFIG # On debian, pkg-config does not find xaw3d. On archlinux, pkg-config # --libs xaw3d yields -lXaw3d -lXmu -lXt -lX11 -- but -lXmu is not # strictly necessary. Use hard-coded paths instead of pkg-config. +# First try pkg-config, as a side-effect this might set flags that are +# useful later, e.g., for libpng. +dnl Under archlinux, PKG_CHECK_MODULES(FT, fontconfig) would write during +dnl ./configure "checking for FT...", under debian the line is +dnl "checking for fontconfig...". Stay on the comprehensible side. +AS_IF([test "x$PKG_CONFIG" != x], + [PKG_CHECK_MODULES([fontconfig], [fontconfig])], + [fontconfig_CFLAGS='-I$(oldincludedir)/freetype2 ' + AC_SEARCH_LIBS([FcInit], [fontconfig])]) +AC_SUBST([fontconfig_CFLAGS]) +AC_SUBST([fontconfig_LIBS]) + dnl Not useful for packagers. dnl AC_CHECK_PROG(XDG_ICON, [xdg-icon-resource], [xdg-icon-resource]) dnl AC_CHECK_PROG(XDG_MENU, [xdg-desktop-menu], [xdg-desktop-menu]) @@ -93,8 +105,6 @@ dnl AC_CHECK_PROG(XDG_MENU, [xdg-desktop-menu], [xdg-desktop-menu]) # Checks for libraries. AC_SEARCH_LIBS([pow], [m])dnl -dnl AC_SEARCH_LIBS([deflate], [z]) # libz is not needed. -AC_SEARCH_LIBS([FcInit], [fontconfig]) # Checks for header files. diff --git a/src/Makefile.am b/src/Makefile.am index 3cbd5ee..73d5132 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,13 +23,11 @@ # "`u' modifier ignored since `D' is the default...". ARFLAGS = cr -# Xft #includes , not , hence freetype2 -# must be put into the search path. - -AM_CPPFLAGS = -I$(oldincludedir)/freetype2 $(XCPPFLAGS) -DNDEBUG -DXFIGLIBDIR="\"$(compkeydbdir)\"" \ +AM_CPPFLAGS = $(fontconfig_CFLAGS) $(XCPPFLAGS) -DNDEBUG \ + -DXFIGLIBDIR="\"$(compkeydbdir)\"" \ -DOBJLIBDIR="\"$(pkgdatadir)/Libraries\"" -DXFIGDOCDIR="\"$(docdir)\"" -AM_LDFLAGS = $(XLDFLAGS) +AM_LDFLAGS = $(fontconfig_LIBS) $(XLDFLAGS) # LIBOBJS must be placed in LDADD or xfig_LDADD - otherwise, the # lib-dir is not distributed diff --git a/tests/Makefile.am b/tests/Makefile.am index 2f529ac..c158806 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -39,9 +39,9 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac echo 'm4_define([AT_PACKAGE_URL], [@PACKAGE_URL@])'; \ } >'$(srcdir)/package.m4' -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(oldincludedir)/freetype2 $(XCPPFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/src $(fontconfig_CFLAGS) $(XCPPFLAGS) -AM_LDFLAGS = $(XLDFLAGS) +AM_LDFLAGS = $(fontconfig_LIBS) $(XLDFLAGS) LDADD = $(top_builddir)/src/libxfig.a $(XLIBS) check_PROGRAMS = test1 test2 test3 test4 -- 2.40.1 ocess-spawned-hook and honor it. * gnu/system/linux-container.scm (container-script)[script]: Define 'explain' and pass it as #:process-spawned-hook'. 2019-07-06linux-container: Mount a new /dev/pts instance in the container.Ludovic Courtès Fixes <https://bugs.gnu.org/36463>. Reported by Steffen Rytter Postas <nc@scalehost.eu>. * gnu/build/linux-container.scm (mount-file-systems): When /dev/ptmx exists on the host, explicitly mount a new instance of devpts and make /dev/ptmx a symlink to /dev/pts/ptmx. 2019-06-23linux-container: Remove dependency on (guix utils).Ludovic Courtès Fixes a bug whereby derivations importing (gnu build linux-container), such as the 'bitlbee' and 'tor' services, would depend on the user's (guix config) file, which was pulled as a dependency of (guix utils). As a result, those derivations would vary from user to user. * gnu/build/linux-container.scm (call-with-temporary-directory): New procedure. 2019-04-02linux-container: Make the guest UID and GID a parameter.Ludovic Courtès * gnu/build/linux-container.scm (initialize-user-namespace): Add #:guest-uid and #:guest-gid parameters and honor them. (run-container): Likewise. (call-with-container): Likewise. * tests/containers.scm ("call-with-container, user namespace, guest UID/GID"): New test. 2018-01-15linux-container: Work around EBADF errors upon exit.Ludovic Courtès Typically 'read-pid-file/container' would fail when starting services in containers such as BitlBee. * gnu/build/linux-container.scm (call-with-clean-exit): Use 'primitive-_exit' instead of 'primitive-exit'. (container-excursion*): Close OUT. 2017-10-11file-systems: 'mount-file-system' now takes a <file-system> object.Ludovic Courtès * gnu/build/file-systems.scm (mount-file-system): Rename 'spec' to 'fs' and assume it's a <file-system>. * gnu/build/linux-boot.scm (boot-system): Assume MOUNTS is a list of <file-system> and adjust accordingly. * gnu/build/linux-container.scm (mount-file-systems): Remove 'file-system->spec' call. * gnu/services/base.scm (file-system-shepherd-service): Add 'spec->file-system' call. Add (gnu system file-systems) to 'modules'. * gnu/system/linux-initrd.scm (raw-initrd): Use (gnu system file-systems). Add 'spec->file-system' call for #:mounts.