summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-07-03 18:20:46 +0200
committerVladimír Čunát <vcunat@gmail.com>2014-07-03 18:20:46 +0200
commit5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5 (patch)
tree3c3f43ff96fb4642a56f3bc2d1add6d0d6b4743f /pkgs
parentaceb30cd9373b9ab5fc4ac4a027474f4d6263510 (diff)
downloadnixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar.gz
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar.bz2
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar.lz
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar.xz
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.tar.zst
nixpkgs-5d2ff3b5c2fd17472b9b1ba22b2a806701326ed5.zip
php-5.3: fix build with freetype-2.5 (by Gentoo patch)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/interpreters/php/5.3-freetype-dirs.patch64
-rw-r--r--pkgs/development/interpreters/php/5.3.nix3
2 files changed, 65 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/php/5.3-freetype-dirs.patch b/pkgs/development/interpreters/php/5.3-freetype-dirs.patch
new file mode 100644
index 00000000000..3b78f9b309b
--- /dev/null
+++ b/pkgs/development/interpreters/php/5.3-freetype-dirs.patch
@@ -0,0 +1,64 @@
+From a0955f351c7eb1022da7ae36970ffef3b00c8aff Mon Sep 17 00:00:00 2001
+From: Adam Harvey <aharvey@php.net>
+Date: Sat, 7 Dec 2013 19:39:40 -0800
+Subject: [PATCH] Switch to using freetype-config for freetype detection.
+
+This fixes GD compilation against libfreetype 2.5.1 and later after they made
+the rather interesting decision to change their include directory layout in a
+point release.
+
+The original suggestion in the bug was to use pkg-config, but my inclination is
+to use freetype-config instead: we should be able to get the same configuration
+information without actually needing pkg-config installed, since pkg-config is
+by no means guaranteed to exist on many Unices and distros, whereas
+freetype-config should always be present if a libfreetype build environment is
+installed. Let's try it out and see what happens.
+
+Fixes bug #64405 (Use freetype-config for determining freetype2 dir(s)).
+
+diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
+index 0e35ece..732e14c 100644
+--- a/ext/gd/config.m4
++++ b/ext/gd/config.m4
+@@ -193,30 +193,25 @@ 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/include/freetype2/freetype/freetype.h"; then
++      if test -f "$i/bin/freetype-config"; then
+         FREETYPE2_DIR=$i
+-        FREETYPE2_INC_DIR=$i/include/freetype2
++        FREETYPE2_CONFIG="$i/bin/freetype-config"
+         break
+       fi
+     done
+ 
+     if test -z "$FREETYPE2_DIR"; then
+-      AC_MSG_ERROR([freetype.h not found.])
++      AC_MSG_ERROR([freetype-config not found.])
+     fi
+ 
+-    PHP_CHECK_LIBRARY(freetype, FT_New_Face,
+-    [
+-      PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
+-      PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
+-      PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
+-      AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
+-      AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
+-      AC_DEFINE(ENABLE_GD_TTF,1,[ ])
+-    ],[
+-      AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.])
+-    ],[
+-      -L$FREETYPE2_DIR/$PHP_LIBDIR
+-    ])
++    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(USE_GD_IMGSTRTTF, 1, [ ])
++    AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
++    AC_DEFINE(ENABLE_GD_TTF,1,[ ])
+   else
+     AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
+   fi
diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix
index 86782117097..ed5feeacf61 100644
--- a/pkgs/development/interpreters/php/5.3.nix
+++ b/pkgs/development/interpreters/php/5.3.nix
@@ -104,7 +104,6 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
       gd = {
         configureFlags = [
           "--with-gd=${gd}"
-          "--with-freetype-dir=${freetype}"
           "--with-png-dir=${libpng}"
           "--with-jpeg-dir=${libjpeg}"
         ];
@@ -241,6 +240,6 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
     platforms   = stdenv.lib.platforms.unix;
   };
 
-  patches = [./fix.patch];
+  patches = [ ./fix.patch ./5.3-freetype-dirs.patch ];
 
 })