x11-misc/xfe: Use pkg-cofing to find freetype and xft.
authorLars Wendler <polynomial-c@gentoo.org>
Thu, 10 May 2018 20:16:05 +0000 (22:16 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Thu, 10 May 2018 20:16:22 +0000 (22:16 +0200)
Closes: https://bugs.gentoo.org/514800
Package-Manager: Portage-2.3.36, Repoman-2.3.9

x11-misc/xfe/files/xfe-1.42-use_pkgconfig_for_freetype_and_xft.patch [new file with mode: 0644]
x11-misc/xfe/xfe-1.42.ebuild

diff --git a/x11-misc/xfe/files/xfe-1.42-use_pkgconfig_for_freetype_and_xft.patch b/x11-misc/xfe/files/xfe-1.42-use_pkgconfig_for_freetype_and_xft.patch
new file mode 100644 (file)
index 0000000..1394f59
--- /dev/null
@@ -0,0 +1,57 @@
+--- xfe-1.42/configure.ac
++++ xfe-1.42/configure.ac
+@@ -29,6 +29,7 @@
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
++PKG_PROG_PKG_CONFIG
+ # Internationalization
+@@ -109,16 +110,13 @@
+       
+       echo "checking whether FOX was compiled with Xft support... yes"
+-      # Check for FreeType2 headers
+-      freetype_config=''
+-      AC_CHECK_PROGS(freetype_config,freetype-config,)
+-      if test -n "$freetype_config"; then
+-        freetype_cflags=`$freetype_config --cflags`
+-        freetype_libs=`$freetype_config --libs`
+-        LIBS="$LIBS $freetype_libs"
+-        CPPFLAGS="$freetype_cflags $CPPFLAGS"
+-      fi
+-      AC_CHECK_HEADER(config/ftheader.h,,[AC_CHECK_HEADER(freetype/config/ftheader.h,,AC_MSG_ERROR("ftheader.h not found"))])
++      # Check for FreeType2
++      PKG_CHECK_MODULES(FREETYPE, freetype2, [
++              freetype_cflags="$FREETYPE_CFLAGS"
++              freetype_libs="$FREETYPE_LIBS"
++              LIBS="$LIBS $freetype_libs"
++              CPPFLAGS="$freetype_cflags $CPPFLAGS"
++      ], AC_MSG_ERROR("freetype not found"))
+       # Check for Xft headers
+       xft_config=''
+@@ -131,15 +129,13 @@
+         CXXFLAGS="${CXXFLAGS} -DHAVE_XFT_H"
+       else
+               # On some systems (e.g. Fedora) xft-config is deprecated and pkg-config should be used instead
+-              pkg_config=''
+-              AC_CHECK_PROGS(pkg_config,pkg-config,)
+-              if test -n "$pkg_config"; then
+-                xft_cflags=`$pkg_config --cflags xft`
+-                xft_libs=`$pkg_config --libs xft`
+-                LIBS="$LIBS $xft_libs"
+-                CPPFLAGS="$xft_cflags $CPPFLAGS"
+-                CXXFLAGS="${CXXFLAGS} -DHAVE_XFT_H"
+-              fi
++              PKG_CHECK_MODULES(XFT, xft, [
++                      xft_cflags="$XFT_CFLAGS"
++                      xft_libs="$XFT_LIBS"
++                      LIBS="$LIBS $xft_libs"
++                      CPPFLAGS="$xft_cflags $CPPFLAGS"
++                      CXXFLAGS="$CXXFLAGS -DHAVE_XFT_H"
++              ], AC_MSG_ERROR("Xft not found"))
+       fi
+       AC_CHECK_HEADER(X11/Xft/Xft.h,,AC_MSG_ERROR("Xft.h not found"))
index df2bd089efc3b7a650276639c2b79e98e6220761..dd6e5a79a2ded281c06a304e73803f8f368bd0ae 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -36,6 +36,8 @@ DEPEND="
 
 DOCS=( AUTHORS BUGS ChangeLog README TODO )
 
+PATCHES=( "${FILESDIR}/${PN}-1.42-use_pkgconfig_for_freetype_and_xft.patch" )
+
 src_prepare() {
        default
 
@@ -62,15 +64,15 @@ src_prepare() {
                -e 's|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|g' \
                configure.ac || die
 
-       eapply_user
-
        eautoreconf
 }
 
 src_configure() {
-       econf \
-               $(use_enable debug) \
-               $(use_enable nls) \
-               $(use_enable startup-notification sn) \
+       local myeconfargs=(
+               $(use_enable debug)
+               $(use_enable nls)
+               $(use_enable startup-notification sn)
                --enable-minimalflags
+       )
+       econf "${myeconfargs[@]}"
 }