commit:     71ef0a9d7feaa6bc13c22a33267a1bd496d98e8d
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Fri May  4 21:03:32 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Fri May  4 21:03:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71ef0a9d

dev-lang/php: Fix building with freetype 2.9.1 by using pkgconfig

Closes: https://bugs.gentoo.org/654794
Package-Manager: Portage-2.3.36, Repoman-2.3.9

 dev-lang/php/files/php-freetype-2.9.1.patch | 231 ++++++++++++++++++++++++++++
 dev-lang/php/php-5.6.35-r1.ebuild           |   1 +
 dev-lang/php/php-5.6.36.ebuild              |   1 +
 dev-lang/php/php-7.0.29.ebuild              |   1 +
 dev-lang/php/php-7.0.30.ebuild              |   1 +
 dev-lang/php/php-7.1.16.ebuild              |   1 +
 dev-lang/php/php-7.1.17.ebuild              |   1 +
 dev-lang/php/php-7.2.5.ebuild               |   1 +
 8 files changed, 238 insertions(+)

diff --git a/dev-lang/php/files/php-freetype-2.9.1.patch 
b/dev-lang/php/files/php-freetype-2.9.1.patch
new file mode 100644
index 00000000000..3ddf8d1154d
--- /dev/null
+++ b/dev-lang/php/files/php-freetype-2.9.1.patch
@@ -0,0 +1,231 @@
+--- a/ext/gd/config.m4 2018-04-24 11:09:54.000000000 -0400
++++ b/ext/gd/config.m4 2018-05-04 15:18:49.867283889 -0400
+@@ -186,21 +186,35 @@
+ AC_DEFUN([PHP_GD_FREETYPE2],[
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++    AC_MSG_CHECKING(for freetype2)
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      AC_MSG_RESULT(from pkgconfig: version $FREETYPE2_VERSION found)
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        AC_MSG_ERROR([freetype-config not found.])
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      AC_MSG_ERROR([freetype-config not found.])
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      AC_MSG_RESULT(found via freetype-config)
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+     PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
+     PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
+     AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+--- a/configure        2018-04-24 11:10:05.000000000 -0400
++++ b/configure        2018-05-04 15:18:45.626367913 -0400
+@@ -34348,21 +34348,78 @@
+ 
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    # Extract the first word of "pkg-config", so it can be a program name 
with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $PKG_CONFIG in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a 
path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found 
$as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
++  ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
++$as_echo_n "checking for freetype2... " >&6; }
++
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: 
version $FREETYPE2_VERSION found" >&5
++$as_echo "from pkgconfig: version $FREETYPE2_VERSION found" >&6; }
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        as_fn_error $? "freetype-config not found." "$LINENO" 5
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      as_fn_error $? "freetype-config not found." "$LINENO" 5
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via 
freetype-config" >&5
++$as_echo "found via freetype-config" >&6; }
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+ 
+   for ac_i in $FREETYPE2_CFLAGS; do
+     case $ac_i in
+@@ -36019,21 +36076,78 @@
+ 
+   if test "$PHP_FREETYPE_DIR" != "no"; then
+ 
+-    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+-      if test -f "$i/bin/freetype-config"; then
+-        FREETYPE2_DIR=$i
+-        FREETYPE2_CONFIG="$i/bin/freetype-config"
+-        break
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2" >&5
++$as_echo_n "checking for freetype2... " >&6; }
++    # Extract the first word of "pkg-config", so it can be a program name 
with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $PKG_CONFIG in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a 
path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found 
$as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
++  ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++
++    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then
++
++      FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2`
++      FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
++      FREETYPE2_VERSION=`$PKG_CONFIG --modversion freetype2`
++
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: from pkgconfig: 
version $FREETYPE_VERSON found" >&5
++$as_echo "from pkgconfig: version $FREETYPE_VERSON found" >&6; }
++    else
++
++      for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++        if test -f "$i/bin/freetype-config"; then
++          FREETYPE2_DIR=$i
++          FREETYPE2_CONFIG="$i/bin/freetype-config"
++          break
++        fi
++      done
++
++      if test -z "$FREETYPE2_DIR"; then
++        as_fn_error $? "freetype-config not found." "$LINENO" 5
+       fi
+-    done
+ 
+-    if test -z "$FREETYPE2_DIR"; then
+-      as_fn_error $? "freetype-config not found." "$LINENO" 5
++      FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
++      FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found via 
freetype-config" >&5
++$as_echo "found via freetype-config" >&6; }
+     fi
+ 
+-    FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
+-    FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
+-
+ 
+   for ac_i in $FREETYPE2_CFLAGS; do
+     case $ac_i in

diff --git a/dev-lang/php/php-5.6.35-r1.ebuild 
b/dev-lang/php/php-5.6.35-r1.ebuild
index 8f87fde7f25..e5d5dafb0a8 100644
--- a/dev-lang/php/php-5.6.35-r1.ebuild
+++ b/dev-lang/php/php-5.6.35-r1.ebuild
@@ -232,6 +232,7 @@ php_set_ini_dir() {
 
 src_prepare() {
        eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
+       eapply "${FILESDIR}/php-freetype-2.9.1.patch"
 
        # Change PHP branding
        # Get the alpha/beta/rc version

diff --git a/dev-lang/php/php-5.6.36.ebuild b/dev-lang/php/php-5.6.36.ebuild
index 97094f855af..fbcbe63b2d1 100644
--- a/dev-lang/php/php-5.6.36.ebuild
+++ b/dev-lang/php/php-5.6.36.ebuild
@@ -233,6 +233,7 @@ php_set_ini_dir() {
 src_prepare() {
        eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch"
        eapply "${FILESDIR}/5.6-mbstring-oniguruma-6.8.patch"
+       eapply "${FILESDIR}/php-freetype-2.9.1.patch"
 
        # Change PHP branding
        # Get the alpha/beta/rc version

diff --git a/dev-lang/php/php-7.0.29.ebuild b/dev-lang/php/php-7.0.29.ebuild
index f0c6303f1cb..1ad39e6fafc 100644
--- a/dev-lang/php/php-7.0.29.ebuild
+++ b/dev-lang/php/php-7.0.29.ebuild
@@ -168,6 +168,7 @@ PATCHES=(
        # hopefully upstream will include the same version check fixes in 
upcoming releases
        # patch added 20180429
        "${FILESDIR}/libressl-compatibility.patch"
+       "${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.0.30.ebuild b/dev-lang/php/php-7.0.30.ebuild
index 8de4204d1c0..5a851d1f41e 100644
--- a/dev-lang/php/php-7.0.30.ebuild
+++ b/dev-lang/php/php-7.0.30.ebuild
@@ -168,6 +168,7 @@ PATCHES=(
        # hopefully upstream will include the same version check fixes in 
upcoming releases
        # patch added 20180429
        "${FILESDIR}/libressl-compatibility.patch"
+       "${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.1.16.ebuild b/dev-lang/php/php-7.1.16.ebuild
index 0075b8f5bd7..7dbfde0cd8b 100644
--- a/dev-lang/php/php-7.1.16.ebuild
+++ b/dev-lang/php/php-7.1.16.ebuild
@@ -150,6 +150,7 @@ PATCHES=(
        # hopefully upstream will include the same version check fixes in 
upcoming releases
        # patch added 20180429
        "${FILESDIR}/libressl-compatibility.patch"
+       "${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.1.17.ebuild b/dev-lang/php/php-7.1.17.ebuild
index fcd553f3148..39336570acb 100644
--- a/dev-lang/php/php-7.1.17.ebuild
+++ b/dev-lang/php/php-7.1.17.ebuild
@@ -148,6 +148,7 @@ PATCHES=(
        # hopefully upstream will include the same version check fixes in 
upcoming releases
        # patch added 20180429
        "${FILESDIR}/libressl-compatibility.patch"
+       "${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

diff --git a/dev-lang/php/php-7.2.5.ebuild b/dev-lang/php/php-7.2.5.ebuild
index 558d91754f3..f781eb4d803 100644
--- a/dev-lang/php/php-7.2.5.ebuild
+++ b/dev-lang/php/php-7.2.5.ebuild
@@ -153,6 +153,7 @@ PATCHES=(
        # hopefully upstream will include the same version check fixes in 
upcoming releases
        # patch added 20180429
        "${FILESDIR}/libressl-compatibility.patch"
+       "${FILESDIR}/php-freetype-2.9.1.patch"
 )
 
 PHP_MV="$(get_major_version)"

Reply via email to