commit:     5b4e41636160c276f88c65e903b2c32ee5ecdd69
Author:     Brian Norris <briannorris <AT> chromium <DOT> org>
AuthorDate: Thu Mar 24 23:47:08 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Mar 24 23:51:06 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b4e4163

net-print/cups-filters: add upstream fixes for pkg-config handling

 .../cups-filters/cups-filters-1.8.2-r1.ebuild      |   1 +
 .../cups-filters-1.8.2-configure-PKG_CONFIG.patch  | 107 +++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/net-print/cups-filters/cups-filters-1.8.2-r1.ebuild 
b/net-print/cups-filters/cups-filters-1.8.2-r1.ebuild
index 276c3a0..b8ea043 100644
--- a/net-print/cups-filters/cups-filters-1.8.2-r1.ebuild
+++ b/net-print/cups-filters/cups-filters-1.8.2-r1.ebuild
@@ -50,6 +50,7 @@ DEPEND="${RDEPEND}
 src_prepare() {
        epatch "${FILESDIR}"/${P}-disable-ijs.patch #574992
        epatch "${FILESDIR}"/${P}-gstoraster.patch
+       epatch "${FILESDIR}"/${P}-configure-PKG_CONFIG.patch
        eautoreconf
 }
 

diff --git 
a/net-print/cups-filters/files/cups-filters-1.8.2-configure-PKG_CONFIG.patch 
b/net-print/cups-filters/files/cups-filters-1.8.2-configure-PKG_CONFIG.patch
new file mode 100644
index 0000000..6263c4a
--- /dev/null
+++ b/net-print/cups-filters/files/cups-filters-1.8.2-configure-PKG_CONFIG.patch
@@ -0,0 +1,107 @@
+Use PKG_CHECK_MODULES() / $PKG_CONFIG
+
+Autotools docs suggest that the $PKG_CONFIG variable should be respected:
+
+https://autotools.io/pkgconfig/cross-compiling.html
+
+However, we aren't using the autotools macros properly, and we ignore
+$PKG_CONFIG for the most part. This causes problems for some cross-compilation
+environments which rely on it.
+
+This patch fixes up configure.ac to use PKG_CHECK_MODULES() for most things,
+and to appropriately use $PKG_CONFIG (instead of self-derived $PKGCONFIG) for
+the remainder.
+
+Reported (and accepted) here:
+
+  https://bugs.linuxfoundation.org/show_bug.cgi?id=1347
+
+---
+=== modified file 'configure.ac'
+--- configure.ac       2016-03-03 19:46:43 +0000
++++ configure.ac       2016-03-21 20:59:37 +0000
+@@ -249,9 +249,6 @@
+ # Check for modules needed by utils/
+ # ==================================
+ 
+-dnl Check for pkg-config, which is used for some other tests later on...
+-AC_PATH_PROG(PKGCONFIG, pkg-config)
+-
+ dnl Avahi for cups-browsed
+ AVAHI_LIBS=""
+ AVAHI_CFLAGS=""
+@@ -272,17 +269,9 @@
+       [AS_HELP_STRING([--with-avahi-includes], [Set directory for Avahi 
includes])],
+       AVAHI_CFLAGS="-I$withval $AVAHI_CFLAGS",)
+ 
+-if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
+-      AC_MSG_CHECKING(for Avahi)
+-      if $PKGCONFIG --exists avahi-client; then
+-              AC_MSG_RESULT(yes)
+-              AVAHI_CFLAGS="$AVAHI_CFLAGS `$PKGCONFIG --cflags avahi-client`"
+-              AVAHI_LIBS="$AVAHI_LIBS `$PKGCONFIG --libs avahi-client`"
+-              AC_DEFINE(HAVE_AVAHI, [], [Define if you have the avahi 
library])
+-      else
+-              AC_MSG_RESULT(no)
+-              enable_avahi=no
+-      fi
++if test "x$enable_avahi" != xno; then
++      PKG_CHECK_MODULES(AVAHI, avahi-client,
++              [AC_DEFINE(HAVE_AVAHI, [], [Define if you have the avahi 
library])])
+ fi
+ 
+ AC_SUBST(AVAHI_LIBS)
+@@ -336,26 +325,18 @@
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ 
+-if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
++if test x$enable_avahi != xno; then
+       PKG_CHECK_MODULES(AVAHI_GLIB, [avahi-glib])
+ fi
+ 
+ AC_SUBST(AVAHI_GLIB_CFLAGS)
+ AC_SUBST(AVAHI_GLIB_LIBS)
+ 
+-GIO_CFLAGS=""
+-GIO_LIBS=""
+-if test "x$PKGCONFIG" != x; then
+-      PKG_CHECK_MODULES(GIO, [gio-2.0])
+-fi
++PKG_CHECK_MODULES(GIO, [gio-2.0])
+ AC_SUBST(GIO_CFLAGS)
+ AC_SUBST(GIO_LIBS)
+ 
+-GIO_UNIX_CFLAGS=""
+-GIO_UNIX_LIBS=""
+-if test "x$PKGCONFIG" != x; then
+-      PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
+-fi
++PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
+ AC_SUBST(GIO_UNIX_CFLAGS)
+ AC_SUBST(GIO_UNIX_LIBS)
+ 
+@@ -715,17 +696,17 @@
+ AC_ARG_ENABLE(braille, AS_HELP_STRING([--enable-braille],[enable Braille 
embosing filters, requires liblouis]),
+             enable_braille=$enableval,enable_braille=yes)
+ AC_MSG_CHECKING(for liblouis)
+-if $PKGCONFIG --exists liblouis; then
++PKG_CHECK_EXISTS([liblouis], [
+       AC_MSG_RESULT(yes)
+-      if test "x$PKGCONFIG" != x -a "x$enable_braille" = xyes; then
+-              TABLESDIR=`$PKGCONFIG --variable=tablesdir liblouis`
++      if test "x$enable_braille" = xyes; then
++              TABLESDIR=`$PKG_CONFIG --variable=tablesdir liblouis`
+       else
+               TABLESDIR=/usr/share/liblouis/tables
+       fi
+-else
++], [
+       AC_MSG_RESULT(no)
+       TABLESDIR=/usr/share/liblouis/tables
+-fi
++])
+ AM_CONDITIONAL(ENABLE_BRAILLE, test "x$enable_braille" = xyes)
+ AC_SUBST(TABLESDIR)
+ 
+

Reply via email to