about summary refs log tree commit diff
path: root/pkgs/development/interpreters/php
diff options
context:
space:
mode:
authorJason "Don" O'Conal <lovek323@gmail.com>2013-06-15 21:57:05 +1000
committerJason "Don" O'Conal <lovek323@gmail.com>2013-06-19 14:15:55 +1000
commited3a63b5d7aec50f803e3e91fcb71a001a7ebe78 (patch)
tree78b7c6776dec6b6d19e1e386bd5bc304d097ba6b /pkgs/development/interpreters/php
parent2735e9c8d6aa444f4a07c26563cda71774d2ca0a (diff)
downloadnixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar.gz
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar.bz2
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar.lz
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar.xz
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.tar.zst
nixlib-ed3a63b5d7aec50f803e3e91fcb71a001a7ebe78.zip
php53: fix on darwin
* add libssh2 to build inputs (configure fails without this)
* link with stdc++
* add icu/lib directory to DYLD_LIBRARY_PATH (and wrap binaries with this
  environment variable
* add libiconv to build inputs
* fix --with-iconv configure flag (was --with-iconv-dir which is not a valid
  flag)
Diffstat (limited to 'pkgs/development/interpreters/php')
-rw-r--r--pkgs/development/interpreters/php/5.3.nix43
1 files changed, 31 insertions, 12 deletions
diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix
index 35508230ebdf..1625c924cbb3 100644
--- a/pkgs/development/interpreters/php/5.3.nix
+++ b/pkgs/development/interpreters/php/5.3.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
 , apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
-, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype
-, libxslt, libmcrypt, bzip2, icu }:
+, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype, libxslt
+, libmcrypt, bzip2, icu, libssh2, makeWrapper, libiconvOrEmpty, libiconv }:
 
 let
   libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
@@ -15,7 +15,15 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
 
   enableParallelBuilding = true;
 
-  buildInputs = ["flex" "bison" "pkgconfig"];
+  buildInputs
+    = [ flex bison pkgconfig ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ libssh2 makeWrapper ];
+
+  # need to include the C++ standard library when compiling on darwin
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lstdc++";
+
+  # need to specify where the dylib for icu is stored
+  DYLD_LIBRARY_PATH = stdenv.lib.optionalString stdenv.isDarwin "${icu}/lib";
 
   flags = {
 
@@ -41,11 +49,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
       };
 
       libxml2 = {
-        configureFlags = [
-          "--with-libxml-dir=${libxml2}"
-          #"--with-iconv-dir=${libiconv}"
-          ];
-        buildInputs = [ libxml2 ];
+        configureFlags
+          = [ "--with-libxml-dir=${libxml2}" ]
+            ++ stdenv.lib.optional (libiconvOrEmpty != [])
+              [ "--with-iconv=${libiconv}" ];
+        buildInputs = [ libxml2 ] ++ libiconvOrEmpty;
       };
 
       readline = {
@@ -89,7 +97,12 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
       };
 
       gd = {
-        configureFlags = ["--with-gd=${gd} --with-freetype-dir=${freetype}"];
+        configureFlags = [
+          "--with-gd"
+          "--with-freetype-dir=${freetype}"
+          "--with-png-dir=${libpng}"
+          "--with-jpeg-dir=${libjpeg}"
+        ];
         buildInputs = [gd libpng libjpeg freetype];
       };
 
@@ -197,7 +210,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
   installPhase = ''
     unset installPhase; installPhase;
     cp php.ini-production $iniFile
-  '';
+  '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "$DYLD_LIBRARY_PATH"
+    done
+  '' );
 
   src = fetchurl {
     url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
@@ -207,8 +224,10 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
 
   meta = {
     description = "The PHP language runtime engine";
-    homepage = http://www.php.net/;
-    license = "PHP-3";
+    homepage    = http://www.php.net/;
+    license     = "PHP-3";
+    maintainers = with stdenv.lib.maintainers; [ lovek323 ];
+    platforms   = stdenv.lib.platforms.unix;
   };
 
   patches = [./fix.patch];