media-libs/ming: Use pkg-config to find freetype
authorLars Wendler <polynomial-c@gentoo.org>
Mon, 7 May 2018 21:16:33 +0000 (23:16 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Mon, 7 May 2018 21:16:48 +0000 (23:16 +0200)
Bug: https://bugs.gentoo.org/654828
Package-Manager: Portage-2.3.36, Repoman-2.3.9

media-libs/ming/files/ming-0.4.8-freetype_pkgconfig.patch [new file with mode: 0644]
media-libs/ming/ming-0.4.8-r1.ebuild

diff --git a/media-libs/ming/files/ming-0.4.8-freetype_pkgconfig.patch b/media-libs/ming/files/ming-0.4.8-freetype_pkgconfig.patch
new file mode 100644 (file)
index 0000000..5c2de75
--- /dev/null
@@ -0,0 +1,47 @@
+From ef3719d39e8bb7e96c6ec57d60261f1516353460 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Fri, 4 May 2018 17:40:04 +0200
+Subject: [PATCH] Use pkg-config to find freetype
+
+As of freetype-2.9.1 the freetype-config script has been deprecated and
+is no longer shipped by default.
+---
+ configure.in | 22 ++--------------------
+ 1 file changed, 2 insertions(+), 20 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 95943a0b..f1685c26 100644
+--- a/configure.in
++++ b/configure.in
+@@ -257,26 +257,8 @@ freetype_support=yes)
+ if test "$freetype_support" = "yes"; then
+       dnl Check for the freetype library
+-      AC_ARG_WITH(freetype-config, [  --with-freetype-config=PROG   Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
+-      if test "$freetype_config" = "yes"; then 
+-              AC_PATH_PROG(ft_config,freetype-config,no)
+-              if test "$ft_config" = "no"; then
+-                      echo "To compile ming please install freetype:"
+-                      echo " as .deb user: sudo apt-get install libfreetype6 libfreetype6-dev"
+-                      echo ""
+-                      echo "or disable the freetype configuration option:"
+-                      echo " --disable-freetype"
+-                      AC_MSG_ERROR([Could not detect freetype-config!])
+-              fi
+-      else
+-              ft_config="$freetype_config"
+-      fi
+-
+-      FREETYPE_CFLAGS="`$ft_config --cflags`"
+-      FREETYPE_LIBS="`$ft_config --libs`"
+-
+-      AC_SUBST(FREETYPE_LIBS)
+-      AC_SUBST(FREETYPE_CFLAGS)
++      PKG_PROG_PKG_CONFIG
++      PKG_CHECK_MODULES(FREETYPE, freetype2,, AC_MSG_ERROR([Could not find freetype]))
+ fi
+ dnl Check for the ungif or gif (new or old) libraries
+-- 
+2.17.0
+
index 8015aff99bfa72bcbc8a9e43f9429f9eeca91291..eba066b844855a19a2f478288edee250e13e06a1 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
@@ -28,13 +28,17 @@ RDEPEND="perl? ( dev-lang/perl:= )
        !media-libs/libswf"
 DEPEND="${RDEPEND}
        sys-devel/flex
+       virtual/pkgconfig
        virtual/yacc"
 PDEPEND="php? ( dev-php/ming-php )"
 
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 S=${WORKDIR}/${P//./_}
 
-PATCHES=( "${FILESDIR}"/${PN}-0.4.8-CVE-2017-8782.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.4.8-CVE-2017-8782.patch
+       "${FILESDIR}"/${PN}-0.4.8-freetype_pkgconfig.patch
+)
 
 # Tests only work when the package is tested on a system
 # which does not presently have any version of ming installed.