@@ -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
5−, pam }:
6−
7−let
8− libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
9−in
10−
11−composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
12−
13− version = "5.3.29";
14−
15− name = "php-${version}";
16−
17− enableParallelBuilding = true;
18−
19− buildInputs
20− = [ flex bison pkgconfig ]
21− ++ stdenv.lib.optionals stdenv.isDarwin [ libssh2 makeWrapper ];
22−
23− # need to include the C++ standard library when compiling on darwin
24− NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lstdc++";
25−
26− # need to specify where the dylib for icu is stored
27− DYLD_LIBRARY_PATH = stdenv.lib.optionalString stdenv.isDarwin "${icu}/lib";
28−
29− flags = {
30−
31− # much left to do here...
32−
33− # SAPI modules:
34−
35− apxs2 = {
36− configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
37− buildInputs = [apacheHttpd];
38− };
39−
40− # Extensions
41−
42− curl = {
43− configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
44− buildInputs = [curl openssl];
45− };
46−
47− pcntl = {
48− configureFlags = [ "--enable-pcntl" ];
49− };
50−
51− zlib = {
52− configureFlags = ["--with-zlib=${zlib}"];
53− buildInputs = [zlib];
54− };
55−
56− libxml2 = {
57− configureFlags
58− = [ "--with-libxml-dir=${libxml2}" ]
59− ++ stdenv.lib.optional (libiconvOrEmpty != [])
60− [ "--with-iconv=${libiconv}" ];
61− buildInputs = [ libxml2 ] ++ libiconvOrEmpty;
62− };
63−
64− readline = {
65− configureFlags = ["--with-readline=${readline}"];
66− buildInputs = [ readline ];
67− };
68−
69− sqlite = {
70− configureFlags = ["--with-pdo-sqlite=${sqlite}"];
71− buildInputs = [ sqlite ];
72− };
73−
74− postgresql = {
75− configureFlags = ["--with-pgsql=${postgresql}"];
76− buildInputs = [ postgresql ];
77− };
78−
79− mysql = {
80− configureFlags = ["--with-mysql=${mysql}"];
81− buildInputs = [ mysql ];
82− };
83−
84− mysqli = {
85− configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
86− buildInputs = [ mysql];
87− };
88−
89− mysqli_embedded = {
90− configureFlags = ["--enable-embedded-mysqli"];
91− depends = "mysqli";
92− assertion = fixed.mysqliSupport;
93− };
94−
95− pdo_mysql = {
96− configureFlags = ["--with-pdo-mysql=${mysql}"];
97− buildInputs = [ mysql ];
98− };
99−
100− bcmath = {
101− configureFlags = ["--enable-bcmath"];
102− };
103−
104− gd = {
105− configureFlags = [
106− "--with-gd=${gd}"
107− "--with-png-dir=${libpng}"
108− "--with-jpeg-dir=${libjpeg}"
109− ];
110− buildInputs = [gd libpng libjpeg freetype];
111− };
112−
113− soap = {
114− configureFlags = ["--enable-soap"];
115− };
116−
117− sockets = {
118− configureFlags = ["--enable-sockets"];
119− };
120−
121− openssl = {
122− configureFlags = ["--with-openssl=${openssl}"];
123− buildInputs = ["openssl"];
124− };
125−
126− mbstring = {
127− configureFlags = ["--enable-mbstring"];
128− };
129−
130− gettext = {
131− configureFlags = ["--with-gettext=${gettext}"];
132− buildInputs = [gettext];
133− };
134−
135− imap = {
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;
141− };
142−
143− intl = {
144− configureFlags = ["--enable-intl"];
145− buildInputs = [icu];
146− };
147−
148− exif = {
149− configureFlags = ["--enable-exif"];
150− };
151−
152− xsl = {
153− configureFlags = ["--with-xsl=${libxslt}"];
154− buildInputs = [libxslt];
155− };
156−
157− mcrypt = {
158− configureFlags = ["--with-mcrypt=${libmcrypt}"];
159− buildInputs = [libmcryptOverride];
160− };
161−
162− bz2 = {
163− configureFlags = ["--with-bz2=${bzip2}"];
164− buildInputs = [bzip2];
165− };
166−
167− zip = {
168− configureFlags = ["--enable-zip"];
169− };
170−
171− ftp = {
172− configureFlags = ["--enable-ftp"];
173− };
174−
175− fpm = {
176− configureFlags = ["--enable-fpm"];
177− };
178− };
179−
180− cfg = {
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;
208− };
209−
210− configurePhase = ''
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
218− '';
219−
220− installPhase = ''
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"
226− done
227− '' );
228−
229− src = fetchurl {
230− url = "http://www.php.net/distributions/php-${version}.tar.bz2";
231− sha256 = "1480pfp4391byqzmvdmbxkdkqwdzhdylj63sfzrcgadjf9lwzqf4";
232− name = "php-${version}.tar.bz2";
233− };
234−
235− meta = {
236− description = "An HTML-embedded scripting language";
237− homepage = http://www.php.net/;
238− license = "PHP-3";
239− maintainers = with stdenv.lib.maintainers; [ lovek323 ];
240− platforms = stdenv.lib.platforms.unix;
241− };
242−
243− patches = [ ./fix.patch ./5.3-freetype-dirs.patch ];
244−
245−})