···
1
-
{ stdenv, lib, pkgs, fetchgit, phpPackage, autoconf, pkg-config, re2c
2
-
, gettext, bzip2, curl, libxml2, openssl, gmp, icu64, oniguruma, libsodium
3
-
, html-tidy, libzip, zlib, pcre2, libxslt, aspell, openldap, cyrus_sasl
4
-
, uwimap, pam, libiconv, enchant1, libXpm, gd, libwebp, libjpeg, libpng
5
-
, freetype, libffi, freetds, postgresql, sqlite, net-snmp, unixODBC, libedit
6
-
, readline, rsync, fetchpatch, valgrind
lib.makeScope pkgs.newScope (self: with self; {
···
xdebug = callPackage ../development/php-packages/xdebug { };
yaml = callPackage ../development/php-packages/yaml { };
133
-
# Function to build a single php extension based on the php version.
135
-
# Name passed is the name of the extension and is automatically used
136
-
# to add the configureFlag "--enable-${name}", which can be overriden.
138
-
# Build inputs is used for extra deps that may be needed. And zendExtension
139
-
# will mark the extension as a zend extension or not.
142
-
, configureFlags ? [ "--enable-${name}" ]
143
-
, internalDeps ? []
146
-
, zendExtension ? false
149
-
}@args: stdenv.mkDerivation ((builtins.removeAttrs args [ "name" ]) // {
150
-
pname = "php-${name}";
151
-
extensionName = name;
174
+
# Function to build a single php extension based on the php version.
176
+
# Name passed is the name of the extension and is automatically used
177
+
# to add the configureFlag "--enable-${name}", which can be overriden.
179
+
# Build inputs is used for extra deps that may be needed. And zendExtension
180
+
# will mark the extension as a zend extension or not.
183
+
, configureFlags ? [ "--enable-${name}" ]
184
+
, internalDeps ? [ ]
186
+
, buildInputs ? [ ]
187
+
, zendExtension ? false
190
+
}@args: stdenv.mkDerivation ((builtins.removeAttrs args [ "name" ]) // {
191
+
pname = "php-${name}";
192
+
extensionName = name;
153
-
inherit (php.unwrapped) version src;
154
-
sourceRoot = "php-${php.version}/ext/${name}";
194
+
inherit (php.unwrapped) version src;
195
+
sourceRoot = "php-${php.version}/ext/${name}";
156
-
enableParallelBuilding = true;
157
-
nativeBuildInputs = [ php.unwrapped autoconf pkg-config re2c ];
158
-
inherit configureFlags internalDeps buildInputs
159
-
zendExtension doCheck;
197
+
enableParallelBuilding = true;
198
+
nativeBuildInputs = [ php.unwrapped autoconf pkg-config re2c ];
199
+
inherit configureFlags internalDeps buildInputs
200
+
zendExtension doCheck;
161
-
prePatch = "pushd ../..";
162
-
postPatch = "popd";
202
+
prePatch = "pushd ../..";
203
+
postPatch = "popd";
165
-
nullglobRestore=$(shopt -p nullglob)
166
-
shopt -u nullglob # To make ?-globbing work
206
+
nullglobRestore=$(shopt -p nullglob)
207
+
shopt -u nullglob # To make ?-globbing work
168
-
# Some extensions have a config0.m4 or config9.m4
169
-
if [ -f config?.m4 ]; then
170
-
mv config?.m4 config.m4
209
+
# Some extensions have a config0.m4 or config9.m4
210
+
if [ -f config?.m4 ]; then
211
+
mv config?.m4 config.m4
176
-
${lib.concatMapStringsSep "\n"
177
-
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
180
-
checkPhase = "runHook preCheck; NO_INTERACTON=yes make test; runHook postCheck";
181
-
outputs = [ "out" "dev" ];
183
-
mkdir -p $out/lib/php/extensions
184
-
cp modules/${name}.so $out/lib/php/extensions/${name}.so
185
-
mkdir -p $dev/include
186
-
${rsync}/bin/rsync -r --filter="+ */" \
189
-
--prune-empty-dirs \
217
+
${lib.concatMapStringsSep "\n"
218
+
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
221
+
checkPhase = "runHook preCheck; NO_INTERACTON=yes make test; runHook postCheck";
222
+
outputs = [ "out" "dev" ];
224
+
mkdir -p $out/lib/php/extensions
225
+
cp modules/${name}.so $out/lib/php/extensions/${name}.so
226
+
mkdir -p $dev/include
227
+
${rsync}/bin/rsync -r --filter="+ */" \
230
+
--prune-empty-dirs \
194
-
description = "PHP upstream extension: ${name}";
195
-
inherit (php.meta) maintainers homepage license;
235
+
description = "PHP upstream extension: ${name}";
236
+
inherit (php.meta) maintainers homepage license;
199
-
# This list contains build instructions for different modules that one may
202
-
# These will be passed as arguments to mkExtension above.
204
-
{ name = "bcmath"; }
205
-
{ name = "bz2"; buildInputs = [ bzip2 ]; configureFlags = [ "--with-bz2=${bzip2.dev}" ]; }
206
-
{ name = "calendar"; }
207
-
{ name = "ctype"; }
209
-
buildInputs = [ curl ];
210
-
configureFlags = [ "--with-curl=${curl.dev}" ];
214
-
buildInputs = [ libxml2 ];
216
-
# https://github.com/php/php-src/pull/7030
218
-
url = "https://github.com/php/php-src/commit/4cc261aa6afca2190b1b74de39c3caa462ec6f0b.patch";
219
-
sha256 = "11qsdiwj1zmpfc2pgh6nr0sn7qa1nyjg4jwf69cgwnd57qfjcy4k";
220
-
excludes = [ "ext/dom/tests/bug43364.phpt" "ext/dom/tests/bug80268.phpt" ];
223
-
# For some reason `patch` fails to remove these files correctly.
224
-
# Since `postPatch` is already used in `mkExtension`, we have to make it here.
226
-
rm tests/bug43364.phpt
227
-
rm tests/bug80268.phpt
229
-
configureFlags = [ "--enable-dom" ]
230
-
# Required to build on darwin.
231
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }
232
-
{ name = "enchant";
233
-
buildInputs = [ enchant1 ];
234
-
configureFlags = [ "--with-enchant=${enchant1}" ];
235
-
# enchant1 doesn't build on darwin.
236
-
enable = (!stdenv.isDarwin);
238
-
{ name = "exif"; doCheck = false; }
239
-
{ name = "ffi"; buildInputs = [ libffi ]; enable = lib.versionAtLeast php.version "7.4"; }
240
-
{ name = "fileinfo"; buildInputs = [ pcre2 ]; }
241
-
{ name = "filter"; buildInputs = [ pcre2 ]; }
242
-
{ name = "ftp"; buildInputs = [ openssl ]; }
244
-
buildInputs = [ zlib gd ];
247
-
"--with-external-gd=${gd.dev}"
248
-
"--enable-gd-jis-conv"
251
-
enable = lib.versionAtLeast php.version "7.4"; }
253
-
buildInputs = [ zlib gd libXpm ];
255
-
"--with-gd=${gd.dev}"
256
-
"--with-freetype-dir=${freetype.dev}"
257
-
"--with-jpeg-dir=${libjpeg.dev}"
258
-
"--with-png-dir=${libpng.dev}"
259
-
"--with-webp-dir=${libwebp}"
260
-
"--with-xpm-dir=${libXpm.dev}"
261
-
"--with-zlib-dir=${zlib.dev}"
262
-
"--enable-gd-jis-conv"
265
-
enable = lib.versionOlder php.version "7.4"; }
266
-
{ name = "gettext";
267
-
buildInputs = [ gettext ];
268
-
patches = lib.optionals (lib.versionOlder php.version "7.4") [
270
-
url = "https://github.com/php/php-src/commit/632b6e7aac207194adc3d0b41615bfb610757f41.patch";
271
-
sha256 = "0xn3ivhc4p070vbk5yx0mzj2n7p04drz3f98i77amr51w0vzv046";
274
-
postPhpize = ''substituteInPlace configure --replace 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' '';
275
-
configureFlags = [ "--with-gettext=${gettext}" ]; }
277
-
buildInputs = [ gmp ];
278
-
configureFlags = [ "--with-gmp=${gmp.dev}" ]; }
279
-
{ name = "hash"; enable = lib.versionOlder php.version "7.4"; }
282
-
"--with-iconv${lib.optionalString stdenv.isDarwin "=${libiconv}"}"
284
-
patches = lib.optionals (lib.versionOlder php.version "8.0") [
285
-
# Header path defaults to FHS location, preventing the configure script from detecting errno support.
287
-
url = "https://github.com/fossar/nix-phps/raw/263861a8c9bdafd7abe44db6db4ef0179643680c/pkgs/iconv-header-path.patch";
288
-
sha256 = "7GHnEUu+hcsQ4h3itDwk6p46ZKfib9JZ2XpWlXrdn6E=";
293
-
buildInputs = [ uwimap openssl pam pcre2 ];
294
-
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" ];
295
-
# uwimap doesn't build on darwin.
296
-
enable = (!stdenv.isDarwin); }
298
-
buildInputs = [ icu64 ];
299
-
patches = lib.optionals (lib.versionOlder php.version "7.4") [
301
-
url = "https://github.com/php/php-src/commit/93a9b56c90c334896e977721bfb3f38b1721cec6.patch";
302
-
sha256 = "055l40lpyhb0rbjn6y23qkzdhvpp7inbnn6x13cpn4inmhjqfpg4";
306
-
{ name = "json"; enable = lib.versionOlder php.version "8.0"; }
308
-
buildInputs = [ openldap cyrus_sasl ];
311
-
"LDAP_DIR=${openldap.dev}"
312
-
"LDAP_INCDIR=${openldap.dev}/include"
313
-
"LDAP_LIBDIR=${openldap.out}/lib"
314
-
] ++ lib.optionals stdenv.isLinux [
315
-
"--with-ldap-sasl=${cyrus_sasl.dev}"
318
-
{ name = "mbstring"; buildInputs = [ oniguruma ] ++ lib.optionals (lib.versionAtLeast php.version "8.0") [
320
-
]; doCheck = false; }
322
-
internalDeps = [ php.extensions.mysqlnd ];
323
-
configureFlags = [ "--with-mysqli=mysqlnd" "--with-mysql-sock=/run/mysqld/mysqld.sock" ];
325
-
{ name = "mysqlnd";
326
-
buildInputs = [ zlib openssl ];
327
-
# The configure script doesn't correctly add library link
328
-
# flags, so we add them to the variable used by the Makefile
330
-
MYSQLND_SHARED_LIBADD = "-lssl -lcrypto";
331
-
# The configure script builds a config.h which is never
332
-
# included. Let's include it in the main header file
333
-
# included by all .c-files.
335
-
(pkgs.writeText "mysqlnd_config.patch" ''
336
-
--- a/ext/mysqlnd/mysqlnd.h
337
-
+++ b/ext/mysqlnd/mysqlnd.h
339
-
+#ifdef HAVE_CONFIG_H
340
-
+#include "config.h"
343
-
+----------------------------------------------------------------------+
344
-
| Copyright (c) The PHP Group |
346
-
] ++ lib.optionals (lib.versionOlder php.version "7.4.8") [
347
-
(pkgs.writeText "mysqlnd_fix_compression.patch" ''
348
-
--- a/ext/mysqlnd/mysqlnd.h
349
-
+++ b/ext/mysqlnd/mysqlnd.h
351
-
#define MYSQLND_DBG_ENABLED 0
240
+
# This list contains build instructions for different modules that one may
243
+
# These will be passed as arguments to mkExtension above.
245
+
{ name = "bcmath"; }
246
+
{ name = "bz2"; buildInputs = [ bzip2 ]; configureFlags = [ "--with-bz2=${bzip2.dev}" ]; }
247
+
{ name = "calendar"; }
248
+
{ name = "ctype"; }
251
+
buildInputs = [ curl ];
252
+
configureFlags = [ "--with-curl=${curl.dev}" ];
258
+
buildInputs = [ libxml2 ];
260
+
# https://github.com/php/php-src/pull/7030
262
+
url = "https://github.com/php/php-src/commit/4cc261aa6afca2190b1b74de39c3caa462ec6f0b.patch";
263
+
sha256 = "11qsdiwj1zmpfc2pgh6nr0sn7qa1nyjg4jwf69cgwnd57qfjcy4k";
264
+
excludes = [ "ext/dom/tests/bug43364.phpt" "ext/dom/tests/bug80268.phpt" ];
267
+
# For some reason `patch` fails to remove these files correctly.
268
+
# Since `postPatch` is already used in `mkExtension`, we have to make it here.
270
+
rm tests/bug43364.phpt
271
+
rm tests/bug80268.phpt
273
+
configureFlags = [ "--enable-dom" ]
274
+
# Required to build on darwin.
275
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
279
+
buildInputs = [ enchant1 ];
280
+
configureFlags = [ "--with-enchant=${enchant1}" ];
281
+
# enchant1 doesn't build on darwin.
282
+
enable = (!stdenv.isDarwin);
285
+
{ name = "exif"; doCheck = false; }
286
+
{ name = "ffi"; buildInputs = [ libffi ]; enable = lib.versionAtLeast php.version "7.4"; }
287
+
{ name = "fileinfo"; buildInputs = [ pcre2 ]; }
288
+
{ name = "filter"; buildInputs = [ pcre2 ]; }
289
+
{ name = "ftp"; buildInputs = [ openssl ]; }
292
+
buildInputs = [ zlib gd ];
295
+
"--with-external-gd=${gd.dev}"
296
+
"--enable-gd-jis-conv"
299
+
enable = lib.versionAtLeast php.version "7.4";
303
+
buildInputs = [ zlib gd libXpm ];
305
+
"--with-gd=${gd.dev}"
306
+
"--with-freetype-dir=${freetype.dev}"
307
+
"--with-jpeg-dir=${libjpeg.dev}"
308
+
"--with-png-dir=${libpng.dev}"
309
+
"--with-webp-dir=${libwebp}"
310
+
"--with-xpm-dir=${libXpm.dev}"
311
+
"--with-zlib-dir=${zlib.dev}"
312
+
"--enable-gd-jis-conv"
315
+
enable = lib.versionOlder php.version "7.4";
319
+
buildInputs = [ gettext ];
320
+
patches = lib.optionals (lib.versionOlder php.version "7.4") [
322
+
url = "https://github.com/php/php-src/commit/632b6e7aac207194adc3d0b41615bfb610757f41.patch";
323
+
sha256 = "0xn3ivhc4p070vbk5yx0mzj2n7p04drz3f98i77amr51w0vzv046";
326
+
postPhpize = ''substituteInPlace configure --replace 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' '';
327
+
configureFlags = [ "--with-gettext=${gettext}" ];
331
+
buildInputs = [ gmp ];
332
+
configureFlags = [ "--with-gmp=${gmp.dev}" ];
334
+
{ name = "hash"; enable = lib.versionOlder php.version "7.4"; }
338
+
"--with-iconv${lib.optionalString stdenv.isDarwin "=${libiconv}"}"
340
+
patches = lib.optionals (lib.versionOlder php.version "8.0") [
341
+
# Header path defaults to FHS location, preventing the configure script from detecting errno support.
343
+
url = "https://github.com/fossar/nix-phps/raw/263861a8c9bdafd7abe44db6db4ef0179643680c/pkgs/iconv-header-path.patch";
344
+
sha256 = "7GHnEUu+hcsQ4h3itDwk6p46ZKfib9JZ2XpWlXrdn6E=";
351
+
buildInputs = [ uwimap openssl pam pcre2 ];
352
+
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" ];
353
+
# uwimap doesn't build on darwin.
354
+
enable = (!stdenv.isDarwin);
358
+
buildInputs = [ icu64 ];
359
+
patches = lib.optionals (lib.versionOlder php.version "7.4") [
361
+
url = "https://github.com/php/php-src/commit/93a9b56c90c334896e977721bfb3f38b1721cec6.patch";
362
+
sha256 = "055l40lpyhb0rbjn6y23qkzdhvpp7inbnn6x13cpn4inmhjqfpg4";
366
+
{ name = "json"; enable = lib.versionOlder php.version "8.0"; }
369
+
buildInputs = [ openldap cyrus_sasl ];
372
+
"LDAP_DIR=${openldap.dev}"
373
+
"LDAP_INCDIR=${openldap.dev}/include"
374
+
"LDAP_LIBDIR=${openldap.out}/lib"
375
+
] ++ lib.optionals stdenv.isLinux [
376
+
"--with-ldap-sasl=${cyrus_sasl.dev}"
382
+
buildInputs = [ oniguruma ] ++ lib.optionals (lib.versionAtLeast php.version "8.0") [
389
+
internalDeps = [ php.extensions.mysqlnd ];
390
+
configureFlags = [ "--with-mysqli=mysqlnd" "--with-mysql-sock=/run/mysqld/mysqld.sock" ];
395
+
buildInputs = [ zlib openssl ];
396
+
# The configure script doesn't correctly add library link
397
+
# flags, so we add them to the variable used by the Makefile
399
+
MYSQLND_SHARED_LIBADD = "-lssl -lcrypto";
400
+
# The configure script builds a config.h which is never
401
+
# included. Let's include it in the main header file
402
+
# included by all .c-files.
404
+
(pkgs.writeText "mysqlnd_config.patch" ''
405
+
--- a/ext/mysqlnd/mysqlnd.h
406
+
+++ b/ext/mysqlnd/mysqlnd.h
408
+
+#ifdef HAVE_CONFIG_H
409
+
+#include "config.h"
412
+
+----------------------------------------------------------------------+
413
+
| Copyright (c) The PHP Group |
415
+
] ++ lib.optionals (lib.versionOlder php.version "7.4.8") [
416
+
(pkgs.writeText "mysqlnd_fix_compression.patch" ''
417
+
--- a/ext/mysqlnd/mysqlnd.h
418
+
+++ b/ext/mysqlnd/mysqlnd.h
420
+
#define MYSQLND_DBG_ENABLED 0
354
-
-#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
355
-
+#if defined(MYSQLND_COMPRESSION_WANTED)
356
-
#define MYSQLND_COMPRESSION_ENABLED 1
360
-
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
361
-
substituteInPlace configure --replace '$OPENSSL_LIBDIR' '${openssl}/lib' \
362
-
--replace '$OPENSSL_INCDIR' '${openssl.dev}/include'
364
-
# oci8 (7.4, 7.3, 7.2)
365
-
# odbc (7.4, 7.3, 7.2)
366
-
{ name = "opcache";
367
-
buildInputs = [ pcre2 ] ++ lib.optionals (lib.versionAtLeast php.version "8.0" && !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind) [
370
-
patches = lib.optionals (lib.versionOlder php.version "7.4") [
371
-
(pkgs.writeText "zend_file_cache_config.patch" ''
372
-
--- a/ext/opcache/zend_file_cache.c
373
-
+++ b/ext/opcache/zend_file_cache.c
375
-
#include "ext/standard/md5.h"
423
+
-#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
424
+
+#if defined(MYSQLND_COMPRESSION_WANTED)
425
+
#define MYSQLND_COMPRESSION_ENABLED 1
429
+
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
430
+
substituteInPlace configure --replace '$OPENSSL_LIBDIR' '${openssl}/lib' \
431
+
--replace '$OPENSSL_INCDIR' '${openssl.dev}/include'
434
+
# oci8 (7.4, 7.3, 7.2)
435
+
# odbc (7.4, 7.3, 7.2)
438
+
buildInputs = [ pcre2 ] ++ lib.optionals (!stdenv.isDarwin && lib.versionAtLeast php.version "8.0") [
441
+
patches = lib.optionals (lib.versionOlder php.version "7.4") [
442
+
(pkgs.writeText "zend_file_cache_config.patch" ''
443
+
--- a/ext/opcache/zend_file_cache.c
444
+
+++ b/ext/opcache/zend_file_cache.c
446
+
#include "ext/standard/md5.h"
378
-
+#include "ZendAccelerator.h"
379
-
#ifdef HAVE_OPCACHE_FILE_CACHE
449
+
+#include "ZendAccelerator.h"
450
+
#ifdef HAVE_OPCACHE_FILE_CACHE
381
-
-#include "ZendAccelerator.h"
382
-
#include "zend_file_cache.h"
383
-
#include "zend_shared_alloc.h"
384
-
#include "zend_accelerator_util_funcs.h"
386
-
zendExtension = true;
387
-
doCheck = !(lib.versionOlder php.version "7.4");
388
-
# Tests launch the builtin webserver.
389
-
__darwinAllowLocalNetworking = true; }
390
-
{ name = "openssl";
391
-
buildInputs = [ openssl ];
392
-
configureFlags = [ "--with-openssl" ];
394
-
{ name = "pcntl"; }
395
-
{ name = "pdo"; doCheck = false; }
396
-
{ name = "pdo_dblib";
397
-
internalDeps = [ php.extensions.pdo ];
398
-
configureFlags = [ "--with-pdo-dblib=${freetds}" ];
399
-
# Doesn't seem to work on darwin.
400
-
enable = (!stdenv.isDarwin);
402
-
# pdo_firebird (7.4, 7.3, 7.2)
403
-
{ name = "pdo_mysql";
404
-
internalDeps = with php.extensions; [ pdo mysqlnd ];
405
-
configureFlags = [ "--with-pdo-mysql=mysqlnd" "PHP_MYSQL_SOCK=/run/mysqld/mysqld.sock" ];
407
-
# pdo_oci (7.4, 7.3, 7.2)
408
-
{ name = "pdo_odbc";
409
-
internalDeps = [ php.extensions.pdo ];
410
-
configureFlags = [ "--with-pdo-odbc=unixODBC,${unixODBC}" ];
412
-
{ name = "pdo_pgsql";
413
-
internalDeps = [ php.extensions.pdo ];
414
-
configureFlags = [ "--with-pdo-pgsql=${postgresql}" ];
416
-
{ name = "pdo_sqlite";
417
-
internalDeps = [ php.extensions.pdo ];
418
-
buildInputs = [ sqlite ];
419
-
configureFlags = [ "--with-pdo-sqlite=${sqlite.dev}" ];
422
-
buildInputs = [ pcre2 ];
423
-
configureFlags = [ "--with-pgsql=${postgresql}" ];
425
-
{ name = "posix"; doCheck = false; }
426
-
{ name = "pspell"; configureFlags = [ "--with-pspell=${aspell}" ]; }
427
-
{ name = "readline";
428
-
buildInputs = [ libedit readline ];
429
-
configureFlags = [ "--with-readline=${readline.dev}" ];
430
-
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
431
-
substituteInPlace configure --replace 'as_fn_error $? "Please reinstall libedit - I cannot find readline.h" "$LINENO" 5' ':'
435
-
{ name = "session"; doCheck = !(lib.versionAtLeast php.version "8.0"); }
436
-
{ name = "shmop"; }
437
-
{ name = "simplexml";
438
-
buildInputs = [ libxml2 pcre2 ];
439
-
configureFlags = [ "--enable-simplexml" ]
440
-
# Required to build on darwin.
441
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }
443
-
buildInputs = [ net-snmp openssl ];
444
-
configureFlags = [ "--with-snmp" ];
445
-
# net-snmp doesn't build on darwin.
446
-
enable = (!stdenv.isDarwin);
449
-
buildInputs = [ libxml2 ];
450
-
configureFlags = [ "--enable-soap" ]
451
-
# Required to build on darwin.
452
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
454
-
{ name = "sockets"; doCheck = false; }
455
-
{ name = "sodium"; buildInputs = [ libsodium ]; }
456
-
{ name = "sqlite3"; buildInputs = [ sqlite ]; }
457
-
{ name = "sysvmsg"; }
458
-
{ name = "sysvsem"; }
459
-
{ name = "sysvshm"; }
460
-
{ name = "tidy"; configureFlags = [ "--with-tidy=${html-tidy}" ]; doCheck = false; }
461
-
{ name = "tokenizer"; }
463
-
buildInputs = [ libxml2 ];
464
-
internalDeps = [ php.extensions.session ];
465
-
configureFlags = [ "--enable-wddx" "--with-libxml-dir=${libxml2.dev}" ];
466
-
# Removed in php 7.4.
467
-
enable = lib.versionOlder php.version "7.4"; }
469
-
buildInputs = [ libxml2 ];
470
-
configureFlags = [ "--enable-xml" ]
471
-
# Required to build on darwin.
472
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
474
-
{ name = "xmlreader";
475
-
buildInputs = [ libxml2 ];
476
-
internalDeps = [ php.extensions.dom ];
477
-
NIX_CFLAGS_COMPILE = [ "-I../.." "-DHAVE_DOM" ];
478
-
configureFlags = [ "--enable-xmlreader" ]
479
-
# Required to build on darwin.
480
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }
482
-
buildInputs = [ libxml2 libiconv ];
483
-
# xmlrpc was unbundled in 8.0 https://php.watch/versions/8.0/xmlrpc
484
-
enable = lib.versionOlder php.version "8.0";
485
-
configureFlags = [ "--with-xmlrpc" ]
486
-
# Required to build on darwin.
487
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }
488
-
{ name = "xmlwriter";
489
-
buildInputs = [ libxml2 ];
490
-
configureFlags = [ "--enable-xmlwriter" ]
491
-
# Required to build on darwin.
492
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }
494
-
buildInputs = [ libxslt libxml2 ];
495
-
doCheck = lib.versionOlder php.version "8.0";
496
-
configureFlags = [ "--with-xsl=${libxslt.dev}" ]; }
497
-
{ name = "zend_test"; }
499
-
buildInputs = [ libzip pcre2 ];
500
-
configureFlags = [ "--with-zip" ]
501
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ]
502
-
++ lib.optionals (lib.versionOlder php.version "7.3") [ "--with-libzip" ];
505
-
buildInputs = [ zlib ];
506
-
patches = lib.optionals (lib.versionOlder php.version "7.4") [
507
-
# Derived from https://github.com/php/php-src/commit/f16b012116d6c015632741a3caada5b30ef8a699
508
-
../development/interpreters/php/zlib-darwin-tests.patch
510
-
configureFlags = [ "--with-zlib" ]
511
-
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ]; }
452
+
-#include "ZendAccelerator.h"
453
+
#include "zend_file_cache.h"
454
+
#include "zend_shared_alloc.h"
455
+
#include "zend_accelerator_util_funcs.h"
458
+
zendExtension = true;
459
+
doCheck = !(lib.versionOlder php.version "7.4");
460
+
# Tests launch the builtin webserver.
461
+
__darwinAllowLocalNetworking = true;
465
+
buildInputs = [ openssl ];
466
+
configureFlags = [ "--with-openssl" ];
469
+
{ name = "pcntl"; }
470
+
{ name = "pdo"; doCheck = false; }
472
+
name = "pdo_dblib";
473
+
internalDeps = [ php.extensions.pdo ];
474
+
configureFlags = [ "--with-pdo-dblib=${freetds}" ];
475
+
# Doesn't seem to work on darwin.
476
+
enable = (!stdenv.isDarwin);
479
+
# pdo_firebird (7.4, 7.3, 7.2)
481
+
name = "pdo_mysql";
482
+
internalDeps = with php.extensions; [ pdo mysqlnd ];
483
+
configureFlags = [ "--with-pdo-mysql=mysqlnd" "PHP_MYSQL_SOCK=/run/mysqld/mysqld.sock" ];
486
+
# pdo_oci (7.4, 7.3, 7.2)
489
+
internalDeps = [ php.extensions.pdo ];
490
+
configureFlags = [ "--with-pdo-odbc=unixODBC,${unixODBC}" ];
494
+
name = "pdo_pgsql";
495
+
internalDeps = [ php.extensions.pdo ];
496
+
configureFlags = [ "--with-pdo-pgsql=${postgresql}" ];
500
+
name = "pdo_sqlite";
501
+
internalDeps = [ php.extensions.pdo ];
502
+
buildInputs = [ sqlite ];
503
+
configureFlags = [ "--with-pdo-sqlite=${sqlite.dev}" ];
508
+
buildInputs = [ pcre2 ];
509
+
configureFlags = [ "--with-pgsql=${postgresql}" ];
512
+
{ name = "posix"; doCheck = false; }
513
+
{ name = "pspell"; configureFlags = [ "--with-pspell=${aspell}" ]; }
516
+
buildInputs = [ libedit readline ];
517
+
configureFlags = [ "--with-readline=${readline.dev}" ];
518
+
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
519
+
substituteInPlace configure --replace 'as_fn_error $? "Please reinstall libedit - I cannot find readline.h" "$LINENO" 5' ':'
523
+
{ name = "session"; doCheck = !(lib.versionAtLeast php.version "8.0"); }
524
+
{ name = "shmop"; }
526
+
name = "simplexml";
527
+
buildInputs = [ libxml2 pcre2 ];
528
+
configureFlags = [ "--enable-simplexml" ]
529
+
# Required to build on darwin.
530
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
534
+
buildInputs = [ net-snmp openssl ];
535
+
configureFlags = [ "--with-snmp" ];
536
+
# net-snmp doesn't build on darwin.
537
+
enable = (!stdenv.isDarwin);
542
+
buildInputs = [ libxml2 ];
543
+
configureFlags = [ "--enable-soap" ]
544
+
# Required to build on darwin.
545
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
548
+
{ name = "sockets"; doCheck = false; }
549
+
{ name = "sodium"; buildInputs = [ libsodium ]; }
550
+
{ name = "sqlite3"; buildInputs = [ sqlite ]; }
551
+
{ name = "sysvmsg"; }
552
+
{ name = "sysvsem"; }
553
+
{ name = "sysvshm"; }
554
+
{ name = "tidy"; configureFlags = [ "--with-tidy=${html-tidy}" ]; doCheck = false; }
555
+
{ name = "tokenizer"; }
558
+
buildInputs = [ libxml2 ];
559
+
internalDeps = [ php.extensions.session ];
560
+
configureFlags = [ "--enable-wddx" "--with-libxml-dir=${libxml2.dev}" ];
561
+
# Removed in php 7.4.
562
+
enable = lib.versionOlder php.version "7.4";
566
+
buildInputs = [ libxml2 ];
567
+
configureFlags = [ "--enable-xml" ]
568
+
# Required to build on darwin.
569
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
573
+
name = "xmlreader";
574
+
buildInputs = [ libxml2 ];
575
+
internalDeps = [ php.extensions.dom ];
576
+
NIX_CFLAGS_COMPILE = [ "-I../.." "-DHAVE_DOM" ];
577
+
configureFlags = [ "--enable-xmlreader" ]
578
+
# Required to build on darwin.
579
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
583
+
buildInputs = [ libxml2 libiconv ];
584
+
# xmlrpc was unbundled in 8.0 https://php.watch/versions/8.0/xmlrpc
585
+
enable = lib.versionOlder php.version "8.0";
586
+
configureFlags = [ "--with-xmlrpc" ]
587
+
# Required to build on darwin.
588
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
591
+
name = "xmlwriter";
592
+
buildInputs = [ libxml2 ];
593
+
configureFlags = [ "--enable-xmlwriter" ]
594
+
# Required to build on darwin.
595
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
599
+
buildInputs = [ libxslt libxml2 ];
600
+
doCheck = lib.versionOlder php.version "8.0";
601
+
configureFlags = [ "--with-xsl=${libxslt.dev}" ];
603
+
{ name = "zend_test"; }
606
+
buildInputs = [ libzip pcre2 ];
607
+
configureFlags = [ "--with-zip" ]
608
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ]
609
+
++ lib.optionals (lib.versionOlder php.version "7.3") [ "--with-libzip" ];
614
+
buildInputs = [ zlib ];
615
+
patches = lib.optionals (lib.versionOlder php.version "7.4") [
616
+
# Derived from https://github.com/php/php-src/commit/f16b012116d6c015632741a3caada5b30ef8a699
617
+
../development/interpreters/php/zlib-darwin-tests.patch
619
+
configureFlags = [ "--with-zlib" ]
620
+
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ];
514
-
# Convert the list of attrs:
515
-
# [ { name = <name>; ... } ... ]
517
-
# [ { name = <name>; value = <extension drv>; } ... ]
519
-
# which we later use listToAttrs to make all attrs available by name.
521
-
# Also filter out extensions based on the enable property.
522
-
namedExtensions = builtins.map (drv: {
524
-
value = mkExtension drv;
525
-
}) (builtins.filter (i: i.enable or true) extensionData);
624
+
# Convert the list of attrs:
625
+
# [ { name = <name>; ... } ... ]
627
+
# [ { name = <name>; value = <extension drv>; } ... ]
629
+
# which we later use listToAttrs to make all attrs available by name.
631
+
# Also filter out extensions based on the enable property.
632
+
namedExtensions = builtins.map
635
+
value = mkExtension drv;
637
+
(builtins.filter (i: i.enable or true) extensionData);
527
-
# Produce the final attribute set of all extensions defined.
528
-
in builtins.listToAttrs namedExtensions);
639
+
# Produce the final attribute set of all extensions defined.
641
+
builtins.listToAttrs namedExtensions