@@ -1,245 +0,0 @@
1−{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
2−, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
3−, openssl, pkgconfig, sqlite, config, libjpeg, libpng, freetype, libxslt
4−, libmcrypt, bzip2, icu, libssh2, makeWrapper, libiconvOrEmpty, libiconv, uwimap
8− libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
11−composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
15− name = "php-${version}";
17− enableParallelBuilding = true;
20− = [ flex bison pkgconfig ]
21− ++ stdenv.lib.optionals stdenv.isDarwin [ libssh2 makeWrapper ];
23− # need to include the C++ standard library when compiling on darwin
24− NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lstdc++";
26− # need to specify where the dylib for icu is stored
27− DYLD_LIBRARY_PATH = stdenv.lib.optionalString stdenv.isDarwin "${icu}/lib";
31− # much left to do here...
36− configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
37− buildInputs = [apacheHttpd];
43− configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
44− buildInputs = [curl openssl];
48− configureFlags = [ "--enable-pcntl" ];
52− configureFlags = ["--with-zlib=${zlib}"];
53− buildInputs = [zlib];
58− = [ "--with-libxml-dir=${libxml2}" ]
59− ++ stdenv.lib.optional (libiconvOrEmpty != [])
60− [ "--with-iconv=${libiconv}" ];
61− buildInputs = [ libxml2 ] ++ libiconvOrEmpty;
65− configureFlags = ["--with-readline=${readline}"];
66− buildInputs = [ readline ];
70− configureFlags = ["--with-pdo-sqlite=${sqlite}"];
71− buildInputs = [ sqlite ];
75− configureFlags = ["--with-pgsql=${postgresql}"];
76− buildInputs = [ postgresql ];
80− configureFlags = ["--with-mysql=${mysql}"];
81− buildInputs = [ mysql ];
85− configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
86− buildInputs = [ mysql];
90− configureFlags = ["--enable-embedded-mysqli"];
92− assertion = fixed.mysqliSupport;
96− configureFlags = ["--with-pdo-mysql=${mysql}"];
97− buildInputs = [ mysql ];
101− configureFlags = ["--enable-bcmath"];
107− "--with-png-dir=${libpng}"
108− "--with-jpeg-dir=${libjpeg}"
110− buildInputs = [gd libpng libjpeg freetype];
114− configureFlags = ["--enable-soap"];
118− configureFlags = ["--enable-sockets"];
122− configureFlags = ["--with-openssl=${openssl}"];
123− buildInputs = ["openssl"];
127− configureFlags = ["--enable-mbstring"];
131− configureFlags = ["--with-gettext=${gettext}"];
132− buildInputs = [gettext];
136− configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" ]
137− # uwimap builds with kerberos on darwin
138− ++ stdenv.lib.optional (stdenv.isDarwin) "--with-kerberos";
139− buildInputs = [ uwimap openssl ]
140− ++ stdenv.lib.optional (!stdenv.isDarwin) pam;
144− configureFlags = ["--enable-intl"];
145− buildInputs = [icu];
149− configureFlags = ["--enable-exif"];
153− configureFlags = ["--with-xsl=${libxslt}"];
154− buildInputs = [libxslt];
158− configureFlags = ["--with-mcrypt=${libmcrypt}"];
159− buildInputs = [libmcryptOverride];
163− configureFlags = ["--with-bz2=${bzip2}"];
164− buildInputs = [bzip2];
168− configureFlags = ["--enable-zip"];
172− configureFlags = ["--enable-ftp"];
176− configureFlags = ["--enable-fpm"];
181− apxs2Support = config.php.apxs2 or true;
182− bcmathSupport = config.php.bcmath or true;
183− bz2Support = config.php.bz2 or false;
184− curlSupport = config.php.curl or true;
185− exifSupport = config.php.exif or true;
186− ftpSupport = config.php.ftp or true;
187− fpmSupport = config.php.fpm or false;
188− gdSupport = config.php.gd or true;
189− gettextSupport = config.php.gettext or true;
190− imapSupport = config.php.imap or false;
191− intlSupport = config.php.intl or true;
192− libxml2Support = config.php.libxml2 or true;
193− mbstringSupport = config.php.mbstring or true;
194− mcryptSupport = config.php.mcrypt or false;
195− mysqlSupport = config.php.mysql or true;
196− mysqliSupport = config.php.mysqli or true;
197− opensslSupport = config.php.openssl or true;
198− pcntlSupport = config.php.pcntl or true;
199− pdo_mysqlSupport = config.php.pdo_mysql or true;
200− postgresqlSupport = config.php.postgresql or true;
201− readlineSupport = config.php.readline or true;
202− soapSupport = config.php.soap or true;
203− socketsSupport = config.php.sockets or true;
204− sqliteSupport = config.php.sqlite or true;
205− xslSupport = config.php.xsl or false;
206− zipSupport = config.php.zip or true;
207− zlibSupport = config.php.zlib or true;
211− iniFile=$out/etc/php-recommended.ini
212− [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
213− ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
214− echo configurePhase end
215− '' + stdenv.lib.optionalString stdenv.isDarwin ''
216− # don't build php.dSYM as the php binary
217− sed -i 's/EXEEXT = \.dSYM/EXEEXT =/' Makefile
221− unset installPhase; installPhase;
222− cp php.ini-production $iniFile
223− '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
224− for prog in $out/bin/*; do
225− wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "$DYLD_LIBRARY_PATH"
230− url = "http://www.php.net/distributions/php-${version}.tar.bz2";
231− sha256 = "1480pfp4391byqzmvdmbxkdkqwdzhdylj63sfzrcgadjf9lwzqf4";
232− name = "php-${version}.tar.bz2";
236− description = "An HTML-embedded scripting language";
237− homepage = http://www.php.net/;
239− maintainers = with stdenv.lib.maintainers; [ lovek323 ];
240− platforms = stdenv.lib.platforms.unix;
243− patches = [ ./fix.patch ./5.3-freetype-dirs.patch ];