@@ -1,10 +1,10 @@
11# pcre functionality is tested in nixos/tests/php-pcre.nix
2−{ lib, stdenv, fetchurl, flex, bison, autoconf
2+{ lib, stdenv, fetchurl, autoconf, bison, libtool, pkgconfig, re2c
33, mysql, libxml2, readline, zlib, curl, postgresql, gettext
4−, openssl, pcre, pcre2, pkgconfig, sqlite, config, libjpeg, libpng, freetype
4+, openssl, pcre, pcre2, sqlite, config, libjpeg, libpng, freetype
55, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, unixODBC
66, uwimap, pam, gmp, apacheHttpd, libiconv, systemd, libsodium, html-tidy, libargon2
7−, libzip, re2c, valgrind
7+, libzip, valgrind
88}:
99
1010with lib;
@@ -48,7 +48,7 @@ let
4848 , ftpSupport ? config.php.ftp or true
4949 , fpmSupport ? config.php.fpm or true
5050 , gmpSupport ? config.php.gmp or true
51− , ztsSupport ? config.php.zts or false
51+ , ztsSupport ? (config.php.zts or false) || (apxs2Support)
5252 , calendarSupport ? config.php.calendar or true
5353 , sodiumSupport ? (config.php.sodium or true) && (versionAtLeast version "7.2")
5454 , tidySupport ? (config.php.tidy or false)
@@ -59,10 +59,8 @@ let
5959 , cliSupport ? config.php.cli or true
6060 , pharSupport ? config.php.phar or true
6161 , xmlrpcSupport ? (config.php.xmlrpc or false) && (libxml2Support)
62− , re2cSupport ? config.php.re2c or true
63− , cgotoSupport ? (config.php.cgoto or false) && (re2cSupport)
62+ , cgotoSupport ? config.php.cgoto or false
6463 , valgrindSupport ? (config.php.valgrind or true) && (versionAtLeast version "7.2")
65− , valgrindPcreSupport ? (config.php.valgrindPcreSupport or false) && (valgrindSupport) && (versionAtLeast version "7.2")
6664 }:
6765
6866 let
@@ -76,8 +74,8 @@ let
7674
7775 enableParallelBuilding = true;
7876
79− nativeBuildInputs = [ pkgconfig autoconf ];
80− buildInputs = [ flex bison ]
77+ nativeBuildInputs = [ autoconf bison libtool pkgconfig re2c ];
78+ buildInputs = [ ]
8179 ++ optional (versionOlder version "7.3") pcre
8280 ++ optional (versionAtLeast version "7.3") pcre2
8381 ++ optional withSystemd systemd
@@ -108,7 +106,6 @@ let
108106 ++ optional tidySupport html-tidy
109107 ++ optional argon2Support libargon2
110108 ++ optional libzipSupport libzip
111− ++ optional re2cSupport re2c
112109 ++ optional valgrindSupport valgrind;
113110
114111 CXXFLAGS = optional stdenv.cc.isClang "-std=c++11";
@@ -192,8 +189,7 @@ let
192189 ++ optional (!pharSupport) "--disable-phar"
193190 ++ optional xmlrpcSupport "--with-xmlrpc"
194191 ++ optional cgotoSupport "--enable-re2c-cgoto"
195− ++ optional valgrindSupport "--with-valgrind=${valgrind.dev}"
196− ++ optional valgrindPcreSupport "--with-pcre-valgrind";
192+ ++ optional valgrindSupport "--with-valgrind=${valgrind.dev}";
197193
198194 hardeningDisable = [ "bindnow" ];
199195