2021-06-26 07:46:46 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, fetchgit
|
|
|
|
, phpPackage
|
|
|
|
, autoconf
|
|
|
|
, pkg-config
|
|
|
|
, aspell
|
|
|
|
, bzip2
|
|
|
|
, curl
|
|
|
|
, cyrus_sasl
|
|
|
|
, enchant1
|
|
|
|
, fetchpatch
|
|
|
|
, freetds
|
|
|
|
, freetype
|
|
|
|
, gd
|
|
|
|
, gettext
|
|
|
|
, gmp
|
|
|
|
, html-tidy
|
|
|
|
, icu64
|
|
|
|
, libXpm
|
|
|
|
, libedit
|
|
|
|
, libffi
|
|
|
|
, libiconv
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libsodium
|
|
|
|
, libwebp
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, libzip
|
|
|
|
, net-snmp
|
|
|
|
, oniguruma
|
|
|
|
, openldap
|
|
|
|
, openssl
|
|
|
|
, pam
|
|
|
|
, pcre2
|
|
|
|
, postgresql
|
|
|
|
, re2c
|
|
|
|
, readline
|
|
|
|
, rsync
|
|
|
|
, sqlite
|
|
|
|
, unixODBC
|
|
|
|
, uwimap
|
|
|
|
, valgrind
|
|
|
|
, zlib
|
2020-03-24 18:30:18 +00:00
|
|
|
}:
|
2014-03-24 12:37:36 +00:00
|
|
|
|
2020-12-15 16:42:21 +00:00
|
|
|
lib.makeScope pkgs.newScope (self: with self; {
|
2020-03-28 21:37:22 +00:00
|
|
|
buildPecl = import ../build-support/build-pecl.nix {
|
2020-04-29 10:52:39 +00:00
|
|
|
php = php.unwrapped;
|
|
|
|
inherit lib;
|
2020-03-28 21:37:22 +00:00
|
|
|
inherit (pkgs) stdenv autoreconfHook fetchurl re2c;
|
|
|
|
};
|
2014-03-24 12:37:36 +00:00
|
|
|
|
2020-03-28 21:37:22 +00:00
|
|
|
# Wrap mkDerivation to prepend pname with "php-" to make names consistent
|
|
|
|
# with how buildPecl does it and make the file easier to overview.
|
|
|
|
mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // {
|
2021-03-04 14:26:36 +00:00
|
|
|
pname = "php-${pname}";
|
2020-03-28 21:37:22 +00:00
|
|
|
});
|
2019-04-24 11:04:28 +00:00
|
|
|
|
2021-06-28 15:43:53 +00:00
|
|
|
# Function to build an extension which is shipped as part of the php
|
|
|
|
# source, based on the php version.
|
|
|
|
#
|
|
|
|
# Name passed is the name of the extension and is automatically used
|
|
|
|
# to add the configureFlag "--enable-${name}", which can be overriden.
|
|
|
|
#
|
|
|
|
# Build inputs is used for extra deps that may be needed. And zendExtension
|
|
|
|
# will mark the extension as a zend extension or not.
|
|
|
|
mkExtension =
|
|
|
|
{ name
|
|
|
|
, configureFlags ? [ "--enable-${name}" ]
|
|
|
|
, internalDeps ? [ ]
|
|
|
|
, postPhpize ? ""
|
|
|
|
, buildInputs ? [ ]
|
|
|
|
, zendExtension ? false
|
|
|
|
, doCheck ? true
|
|
|
|
, ...
|
|
|
|
}@args: stdenv.mkDerivation ((builtins.removeAttrs args [ "name" ]) // {
|
|
|
|
pname = "php-${name}";
|
|
|
|
extensionName = name;
|
|
|
|
|
|
|
|
inherit (php.unwrapped) version src;
|
|
|
|
sourceRoot = "php-${php.version}/ext/${name}";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
nativeBuildInputs = [ php.unwrapped autoconf pkg-config re2c ];
|
|
|
|
inherit configureFlags internalDeps buildInputs
|
|
|
|
zendExtension doCheck;
|
|
|
|
|
|
|
|
prePatch = "pushd ../..";
|
|
|
|
postPatch = "popd";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
nullglobRestore=$(shopt -p nullglob)
|
|
|
|
shopt -u nullglob # To make ?-globbing work
|
|
|
|
|
|
|
|
# Some extensions have a config0.m4 or config9.m4
|
|
|
|
if [ -f config?.m4 ]; then
|
|
|
|
mv config?.m4 config.m4
|
|
|
|
fi
|
|
|
|
|
|
|
|
$nullglobRestore
|
|
|
|
phpize
|
|
|
|
${postPhpize}
|
|
|
|
${lib.concatMapStringsSep "\n"
|
|
|
|
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
|
|
|
|
internalDeps}
|
|
|
|
'';
|
2021-12-15 19:55:31 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
NO_INTERACTON=yes SKIP_PERF_SENSITIVE=yes make test
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2021-06-28 15:43:53 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib/php/extensions
|
|
|
|
cp modules/${name}.so $out/lib/php/extensions/${name}.so
|
|
|
|
mkdir -p $dev/include
|
|
|
|
${rsync}/bin/rsync -r --filter="+ */" \
|
|
|
|
--filter="+ *.h" \
|
|
|
|
--filter="- *" \
|
|
|
|
--prune-empty-dirs \
|
|
|
|
. $dev/include/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "PHP upstream extension: ${name}";
|
|
|
|
inherit (php.meta) maintainers homepage license;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-12-15 16:42:21 +00:00
|
|
|
php = phpPackage;
|
2018-12-10 14:33:53 +00:00
|
|
|
|
2020-04-03 16:56:12 +00:00
|
|
|
# This is a set of interactive tools based on PHP.
|
2020-12-15 16:42:21 +00:00
|
|
|
tools = {
|
2020-10-11 14:33:54 +00:00
|
|
|
box = callPackage ../development/php-packages/box { };
|
2019-04-20 14:09:05 +00:00
|
|
|
|
2020-10-11 14:37:09 +00:00
|
|
|
composer = callPackage ../development/php-packages/composer { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2021-05-05 12:19:41 +00:00
|
|
|
deployer = callPackage ../development/php-packages/deployer { };
|
|
|
|
|
2022-02-24 20:08:05 +00:00
|
|
|
phing = callPackage ../development/php-packages/phing { };
|
|
|
|
|
2020-10-11 14:39:33 +00:00
|
|
|
php-cs-fixer = callPackage ../development/php-packages/php-cs-fixer { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 14:41:30 +00:00
|
|
|
php-parallel-lint = callPackage ../development/php-packages/php-parallel-lint { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 14:42:35 +00:00
|
|
|
phpcbf = callPackage ../development/php-packages/phpcbf { };
|
2019-05-13 19:49:16 +00:00
|
|
|
|
2020-10-11 14:43:44 +00:00
|
|
|
phpcs = callPackage ../development/php-packages/phpcs { };
|
2020-05-16 12:43:23 +00:00
|
|
|
|
2020-10-11 14:44:31 +00:00
|
|
|
phpmd = callPackage ../development/php-packages/phpmd { };
|
2020-05-16 12:43:23 +00:00
|
|
|
|
2020-10-11 14:45:34 +00:00
|
|
|
phpstan = callPackage ../development/php-packages/phpstan { };
|
2020-03-30 17:26:15 +00:00
|
|
|
|
2020-10-11 14:46:30 +00:00
|
|
|
psalm = callPackage ../development/php-packages/psalm { };
|
2019-11-17 19:27:45 +00:00
|
|
|
|
2020-10-11 14:46:49 +00:00
|
|
|
psysh = callPackage ../development/php-packages/psysh { };
|
2016-01-08 12:30:27 +00:00
|
|
|
};
|
|
|
|
|
2019-07-26 02:45:39 +00:00
|
|
|
|
2019-04-20 14:09:05 +00:00
|
|
|
|
2020-04-03 16:56:12 +00:00
|
|
|
# This is a set of PHP extensions meant to be used in php.buildEnv
|
|
|
|
# or php.withExtensions to extend the functionality of the PHP
|
|
|
|
# interpreter.
|
2020-04-02 20:13:04 +00:00
|
|
|
extensions = {
|
2021-10-08 16:10:44 +00:00
|
|
|
amqp = callPackage ../development/php-packages/amqp { };
|
|
|
|
|
2020-10-11 15:32:19 +00:00
|
|
|
apcu = callPackage ../development/php-packages/apcu { };
|
2019-09-30 16:08:20 +00:00
|
|
|
|
2020-10-11 15:33:23 +00:00
|
|
|
apcu_bc = callPackage ../development/php-packages/apcu_bc { };
|
2019-11-21 21:49:17 +00:00
|
|
|
|
2020-10-11 15:37:37 +00:00
|
|
|
ast = callPackage ../development/php-packages/ast { };
|
2020-02-19 19:28:05 +00:00
|
|
|
|
2020-10-04 10:59:52 +00:00
|
|
|
blackfire = pkgs.callPackage ../development/tools/misc/blackfire/php-probe.nix { inherit php; };
|
|
|
|
|
2020-10-11 15:44:38 +00:00
|
|
|
couchbase = callPackage ../development/php-packages/couchbase { };
|
2020-02-19 19:28:05 +00:00
|
|
|
|
2022-01-26 20:17:02 +00:00
|
|
|
ds = callPackage ../development/php-packages/ds { };
|
|
|
|
|
2020-10-11 15:51:35 +00:00
|
|
|
event = callPackage ../development/php-packages/event { };
|
2020-03-30 17:26:15 +00:00
|
|
|
|
2021-11-23 19:06:39 +00:00
|
|
|
gnupg = callPackage ../development/php-packages/gnupg { };
|
|
|
|
|
2020-10-11 15:56:33 +00:00
|
|
|
igbinary = callPackage ../development/php-packages/igbinary { };
|
2017-12-06 15:11:28 +00:00
|
|
|
|
2020-10-11 16:00:01 +00:00
|
|
|
imagick = callPackage ../development/php-packages/imagick { };
|
2017-12-06 15:11:28 +00:00
|
|
|
|
2020-10-11 17:00:38 +00:00
|
|
|
mailparse = callPackage ../development/php-packages/mailparse { };
|
2017-12-06 15:49:07 +00:00
|
|
|
|
2020-10-11 17:05:50 +00:00
|
|
|
maxminddb = callPackage ../development/php-packages/maxminddb { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 17:10:24 +00:00
|
|
|
memcached = callPackage ../development/php-packages/memcached { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 17:14:22 +00:00
|
|
|
mongodb = callPackage ../development/php-packages/mongodb { };
|
2015-10-12 09:44:48 +00:00
|
|
|
|
2021-01-10 01:06:20 +00:00
|
|
|
oci8 = callPackage ../development/php-packages/oci8 ({
|
|
|
|
version = "2.2.0";
|
|
|
|
sha256 = "0jhivxj1nkkza4h23z33y7xhffii60d7dr51h1czjk10qywl7pyd";
|
|
|
|
} // lib.optionalAttrs (lib.versionAtLeast php.version "8.0") {
|
|
|
|
version = "3.0.1";
|
|
|
|
sha256 = "108ds92620dih5768z19hi0jxfa7wfg5hdvyyvpapir87c0ap914";
|
|
|
|
});
|
2017-07-11 13:56:52 +00:00
|
|
|
|
2020-12-28 23:38:50 +00:00
|
|
|
pdlib = callPackage ../development/php-packages/pdlib { };
|
|
|
|
|
2020-10-11 17:19:01 +00:00
|
|
|
pcov = callPackage ../development/php-packages/pcov { };
|
2017-07-11 13:56:52 +00:00
|
|
|
|
2020-04-02 20:13:04 +00:00
|
|
|
pdo_oci = buildPecl rec {
|
2020-04-29 10:52:39 +00:00
|
|
|
inherit (php.unwrapped) src version;
|
2019-01-17 12:04:10 +00:00
|
|
|
|
2020-04-02 20:13:04 +00:00
|
|
|
pname = "pdo_oci";
|
|
|
|
sourceRoot = "php-${version}/ext/pdo_oci";
|
2019-01-17 12:04:10 +00:00
|
|
|
|
2020-04-02 20:13:04 +00:00
|
|
|
buildInputs = [ pkgs.oracle-instantclient ];
|
|
|
|
configureFlags = [ "--with-pdo-oci=instantclient,${pkgs.oracle-instantclient.lib}/lib" ];
|
2019-01-17 12:04:10 +00:00
|
|
|
|
2020-04-02 20:13:04 +00:00
|
|
|
internalDeps = [ php.extensions.pdo ];
|
2019-01-17 12:04:10 +00:00
|
|
|
|
2020-04-02 20:13:04 +00:00
|
|
|
postPatch = ''
|
2020-04-29 10:52:39 +00:00
|
|
|
sed -i -e 's|OCISDKMANINC=`.*$|OCISDKMANINC="${pkgs.oracle-instantclient.dev}/include"|' config.m4
|
|
|
|
'';
|
2020-04-19 18:51:34 +00:00
|
|
|
|
|
|
|
meta.maintainers = lib.teams.php.members;
|
2019-01-17 12:04:10 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 17:24:04 +00:00
|
|
|
pdo_sqlsrv = callPackage ../development/php-packages/pdo_sqlsrv { };
|
2019-05-13 19:55:49 +00:00
|
|
|
|
2020-10-11 17:32:05 +00:00
|
|
|
php_excel = callPackage ../development/php-packages/php_excel { };
|
2018-06-24 20:01:04 +00:00
|
|
|
|
2020-10-11 17:36:24 +00:00
|
|
|
pinba = callPackage ../development/php-packages/pinba { };
|
2020-04-05 12:57:33 +00:00
|
|
|
|
2020-10-11 17:39:34 +00:00
|
|
|
protobuf = callPackage ../development/php-packages/protobuf { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 17:49:28 +00:00
|
|
|
rdkafka = callPackage ../development/php-packages/rdkafka { };
|
2020-05-01 19:32:25 +00:00
|
|
|
|
2020-10-11 17:53:07 +00:00
|
|
|
redis = callPackage ../development/php-packages/redis { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2021-02-01 02:01:37 +00:00
|
|
|
smbclient = callPackage ../development/php-packages/smbclient { };
|
|
|
|
|
2021-04-26 07:59:30 +00:00
|
|
|
snuffleupagus = callPackage ../development/php-packages/snuffleupagus { };
|
|
|
|
|
2020-10-11 17:55:31 +00:00
|
|
|
sqlsrv = callPackage ../development/php-packages/sqlsrv { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2021-03-11 17:01:45 +00:00
|
|
|
swoole = callPackage ../development/php-packages/swoole { };
|
|
|
|
|
2020-10-11 17:58:03 +00:00
|
|
|
xdebug = callPackage ../development/php-packages/xdebug { };
|
2019-04-20 13:36:12 +00:00
|
|
|
|
2020-10-11 18:00:38 +00:00
|
|
|
yaml = callPackage ../development/php-packages/yaml { };
|
2021-06-26 07:46:46 +00:00
|
|
|
} // (
|
|
|
|
let
|
|
|
|
# This list contains build instructions for different modules that one may
|
|
|
|
# want to build.
|
|
|
|
#
|
|
|
|
# These will be passed as arguments to mkExtension above.
|
|
|
|
extensionData = [
|
|
|
|
{ name = "bcmath"; }
|
|
|
|
{ name = "bz2"; buildInputs = [ bzip2 ]; configureFlags = [ "--with-bz2=${bzip2.dev}" ]; }
|
|
|
|
{ name = "calendar"; }
|
|
|
|
{ name = "ctype"; }
|
|
|
|
{
|
|
|
|
name = "curl";
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
configureFlags = [ "--with-curl=${curl.dev}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{ name = "dba"; }
|
|
|
|
{
|
|
|
|
name = "dom";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
configureFlags = [ "--enable-dom" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "enchant";
|
|
|
|
buildInputs = [ enchant1 ];
|
|
|
|
configureFlags = [ "--with-enchant=${enchant1}" ];
|
|
|
|
# enchant1 doesn't build on darwin.
|
|
|
|
enable = (!stdenv.isDarwin);
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{ name = "exif"; doCheck = false; }
|
|
|
|
{ name = "ffi"; buildInputs = [ libffi ]; enable = lib.versionAtLeast php.version "7.4"; }
|
|
|
|
{ name = "fileinfo"; buildInputs = [ pcre2 ]; }
|
|
|
|
{ name = "filter"; buildInputs = [ pcre2 ]; }
|
|
|
|
{ name = "ftp"; buildInputs = [ openssl ]; }
|
|
|
|
{
|
|
|
|
name = "gd";
|
|
|
|
buildInputs = [ zlib gd ];
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-gd"
|
|
|
|
"--with-external-gd=${gd.dev}"
|
|
|
|
"--enable-gd-jis-conv"
|
|
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
enable = lib.versionAtLeast php.version "7.4";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "gd";
|
|
|
|
buildInputs = [ zlib gd libXpm ];
|
|
|
|
configureFlags = [
|
|
|
|
"--with-gd=${gd.dev}"
|
|
|
|
"--with-freetype-dir=${freetype.dev}"
|
|
|
|
"--with-jpeg-dir=${libjpeg.dev}"
|
|
|
|
"--with-png-dir=${libpng.dev}"
|
|
|
|
"--with-webp-dir=${libwebp}"
|
|
|
|
"--with-xpm-dir=${libXpm.dev}"
|
|
|
|
"--with-zlib-dir=${zlib.dev}"
|
|
|
|
"--enable-gd-jis-conv"
|
|
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
enable = lib.versionOlder php.version "7.4";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "gettext";
|
|
|
|
buildInputs = [ gettext ];
|
|
|
|
patches = lib.optionals (lib.versionOlder php.version "7.4") [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/php/php-src/commit/632b6e7aac207194adc3d0b41615bfb610757f41.patch";
|
|
|
|
sha256 = "0xn3ivhc4p070vbk5yx0mzj2n7p04drz3f98i77amr51w0vzv046";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
postPhpize = ''substituteInPlace configure --replace 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' '';
|
|
|
|
configureFlags = [ "--with-gettext=${gettext}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "gmp";
|
|
|
|
buildInputs = [ gmp ];
|
|
|
|
configureFlags = [ "--with-gmp=${gmp.dev}" ];
|
|
|
|
}
|
|
|
|
{ name = "hash"; enable = lib.versionOlder php.version "7.4"; }
|
|
|
|
{
|
|
|
|
name = "iconv";
|
|
|
|
configureFlags = [
|
|
|
|
"--with-iconv${lib.optionalString stdenv.isDarwin "=${libiconv}"}"
|
|
|
|
];
|
|
|
|
patches = lib.optionals (lib.versionOlder php.version "8.0") [
|
|
|
|
# Header path defaults to FHS location, preventing the configure script from detecting errno support.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/fossar/nix-phps/raw/263861a8c9bdafd7abe44db6db4ef0179643680c/pkgs/iconv-header-path.patch";
|
|
|
|
sha256 = "7GHnEUu+hcsQ4h3itDwk6p46ZKfib9JZ2XpWlXrdn6E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "imap";
|
|
|
|
buildInputs = [ uwimap openssl pam pcre2 ];
|
|
|
|
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" ];
|
|
|
|
# uwimap doesn't build on darwin.
|
|
|
|
enable = (!stdenv.isDarwin);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "intl";
|
|
|
|
buildInputs = [ icu64 ];
|
|
|
|
patches = lib.optionals (lib.versionOlder php.version "7.4") [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/php/php-src/commit/93a9b56c90c334896e977721bfb3f38b1721cec6.patch";
|
|
|
|
sha256 = "055l40lpyhb0rbjn6y23qkzdhvpp7inbnn6x13cpn4inmhjqfpg4";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{ name = "json"; enable = lib.versionOlder php.version "8.0"; }
|
|
|
|
{
|
|
|
|
name = "ldap";
|
|
|
|
buildInputs = [ openldap cyrus_sasl ];
|
|
|
|
configureFlags = [
|
|
|
|
"--with-ldap"
|
|
|
|
"LDAP_DIR=${openldap.dev}"
|
|
|
|
"LDAP_INCDIR=${openldap.dev}/include"
|
|
|
|
"LDAP_LIBDIR=${openldap.out}/lib"
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
"--with-ldap-sasl=${cyrus_sasl.dev}"
|
|
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "mbstring";
|
|
|
|
buildInputs = [ oniguruma ] ++ lib.optionals (lib.versionAtLeast php.version "8.0") [
|
|
|
|
pcre2
|
|
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "mysqli";
|
|
|
|
internalDeps = [ php.extensions.mysqlnd ];
|
|
|
|
configureFlags = [ "--with-mysqli=mysqlnd" "--with-mysql-sock=/run/mysqld/mysqld.sock" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "mysqlnd";
|
|
|
|
buildInputs = [ zlib openssl ];
|
|
|
|
# The configure script doesn't correctly add library link
|
|
|
|
# flags, so we add them to the variable used by the Makefile
|
|
|
|
# when linking.
|
|
|
|
MYSQLND_SHARED_LIBADD = "-lssl -lcrypto";
|
|
|
|
# The configure script builds a config.h which is never
|
|
|
|
# included. Let's include it in the main header file
|
|
|
|
# included by all .c-files.
|
|
|
|
patches = [
|
|
|
|
(pkgs.writeText "mysqlnd_config.patch" ''
|
|
|
|
--- a/ext/mysqlnd/mysqlnd.h
|
|
|
|
+++ b/ext/mysqlnd/mysqlnd.h
|
|
|
|
@@ -1,3 +1,6 @@
|
|
|
|
+#ifdef HAVE_CONFIG_H
|
|
|
|
+#include "config.h"
|
|
|
|
+#endif
|
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Copyright (c) The PHP Group |
|
|
|
|
'')
|
|
|
|
] ++ lib.optionals (lib.versionOlder php.version "7.4.8") [
|
|
|
|
(pkgs.writeText "mysqlnd_fix_compression.patch" ''
|
|
|
|
--- a/ext/mysqlnd/mysqlnd.h
|
|
|
|
+++ b/ext/mysqlnd/mysqlnd.h
|
|
|
|
@@ -48,7 +48,7 @@
|
|
|
|
#define MYSQLND_DBG_ENABLED 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
|
|
|
|
+#if defined(MYSQLND_COMPRESSION_WANTED)
|
|
|
|
#define MYSQLND_COMPRESSION_ENABLED 1
|
|
|
|
#endif
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
|
|
|
|
substituteInPlace configure --replace '$OPENSSL_LIBDIR' '${openssl}/lib' \
|
|
|
|
--replace '$OPENSSL_INCDIR' '${openssl.dev}/include'
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
# oci8 (7.4, 7.3, 7.2)
|
|
|
|
# odbc (7.4, 7.3, 7.2)
|
|
|
|
{
|
|
|
|
name = "opcache";
|
|
|
|
buildInputs = [ pcre2 ] ++ lib.optionals (!stdenv.isDarwin && lib.versionAtLeast php.version "8.0") [
|
|
|
|
valgrind.dev
|
|
|
|
];
|
|
|
|
patches = lib.optionals (lib.versionOlder php.version "7.4") [
|
|
|
|
(pkgs.writeText "zend_file_cache_config.patch" ''
|
|
|
|
--- a/ext/opcache/zend_file_cache.c
|
|
|
|
+++ b/ext/opcache/zend_file_cache.c
|
|
|
|
@@ -27,9 +27,9 @@
|
|
|
|
#include "ext/standard/md5.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include "ZendAccelerator.h"
|
|
|
|
#ifdef HAVE_OPCACHE_FILE_CACHE
|
|
|
|
|
|
|
|
-#include "ZendAccelerator.h"
|
|
|
|
#include "zend_file_cache.h"
|
|
|
|
#include "zend_shared_alloc.h"
|
|
|
|
#include "zend_accelerator_util_funcs.h"
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
zendExtension = true;
|
|
|
|
doCheck = !(lib.versionOlder php.version "7.4");
|
|
|
|
# Tests launch the builtin webserver.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "openssl";
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
configureFlags = [ "--with-openssl" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{ name = "pcntl"; }
|
|
|
|
{ name = "pdo"; doCheck = false; }
|
|
|
|
{
|
|
|
|
name = "pdo_dblib";
|
|
|
|
internalDeps = [ php.extensions.pdo ];
|
|
|
|
configureFlags = [ "--with-pdo-dblib=${freetds}" ];
|
|
|
|
# Doesn't seem to work on darwin.
|
|
|
|
enable = (!stdenv.isDarwin);
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
# pdo_firebird (7.4, 7.3, 7.2)
|
|
|
|
{
|
|
|
|
name = "pdo_mysql";
|
|
|
|
internalDeps = with php.extensions; [ pdo mysqlnd ];
|
|
|
|
configureFlags = [ "--with-pdo-mysql=mysqlnd" "PHP_MYSQL_SOCK=/run/mysqld/mysqld.sock" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
# pdo_oci (7.4, 7.3, 7.2)
|
|
|
|
{
|
|
|
|
name = "pdo_odbc";
|
|
|
|
internalDeps = [ php.extensions.pdo ];
|
|
|
|
configureFlags = [ "--with-pdo-odbc=unixODBC,${unixODBC}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "pdo_pgsql";
|
|
|
|
internalDeps = [ php.extensions.pdo ];
|
|
|
|
configureFlags = [ "--with-pdo-pgsql=${postgresql}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "pdo_sqlite";
|
|
|
|
internalDeps = [ php.extensions.pdo ];
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
configureFlags = [ "--with-pdo-sqlite=${sqlite.dev}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "pgsql";
|
|
|
|
buildInputs = [ pcre2 ];
|
|
|
|
configureFlags = [ "--with-pgsql=${postgresql}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{ name = "posix"; doCheck = false; }
|
|
|
|
{ name = "pspell"; configureFlags = [ "--with-pspell=${aspell}" ]; }
|
|
|
|
{
|
|
|
|
name = "readline";
|
|
|
|
buildInputs = [ libedit readline ];
|
|
|
|
configureFlags = [ "--with-readline=${readline.dev}" ];
|
|
|
|
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
|
|
|
|
substituteInPlace configure --replace 'as_fn_error $? "Please reinstall libedit - I cannot find readline.h" "$LINENO" 5' ':'
|
|
|
|
'';
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{ name = "session"; doCheck = !(lib.versionAtLeast php.version "8.0"); }
|
|
|
|
{ name = "shmop"; }
|
|
|
|
{
|
|
|
|
name = "simplexml";
|
|
|
|
buildInputs = [ libxml2 pcre2 ];
|
|
|
|
configureFlags = [ "--enable-simplexml" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "snmp";
|
|
|
|
buildInputs = [ net-snmp openssl ];
|
|
|
|
configureFlags = [ "--with-snmp" ];
|
|
|
|
# net-snmp doesn't build on darwin.
|
|
|
|
enable = (!stdenv.isDarwin);
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "soap";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
configureFlags = [ "--enable-soap" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
2022-01-22 17:12:21 +00:00
|
|
|
{
|
|
|
|
name = "sockets";
|
|
|
|
doCheck = false;
|
|
|
|
}
|
2021-06-26 07:46:46 +00:00
|
|
|
{ name = "sodium"; buildInputs = [ libsodium ]; }
|
|
|
|
{ name = "sqlite3"; buildInputs = [ sqlite ]; }
|
|
|
|
{ name = "sysvmsg"; }
|
|
|
|
{ name = "sysvsem"; }
|
|
|
|
{ name = "sysvshm"; }
|
|
|
|
{ name = "tidy"; configureFlags = [ "--with-tidy=${html-tidy}" ]; doCheck = false; }
|
2021-12-20 13:09:56 +00:00
|
|
|
{
|
|
|
|
name = "tokenizer";
|
|
|
|
patches = lib.optional (lib.versionAtLeast php.version "8.1")
|
|
|
|
../development/interpreters/php/fix-tokenizer-php81.patch;
|
|
|
|
}
|
2021-06-26 07:46:46 +00:00
|
|
|
{
|
|
|
|
name = "wddx";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
internalDeps = [ php.extensions.session ];
|
|
|
|
configureFlags = [ "--enable-wddx" "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
# Removed in php 7.4.
|
|
|
|
enable = lib.versionOlder php.version "7.4";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "xml";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
configureFlags = [ "--enable-xml" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "xmlreader";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
internalDeps = [ php.extensions.dom ];
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-I../.." "-DHAVE_DOM" ];
|
2021-11-25 17:18:21 +00:00
|
|
|
doCheck = false;
|
2021-06-26 07:46:46 +00:00
|
|
|
configureFlags = [ "--enable-xmlreader" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "xmlrpc";
|
|
|
|
buildInputs = [ libxml2 libiconv ];
|
|
|
|
# xmlrpc was unbundled in 8.0 https://php.watch/versions/8.0/xmlrpc
|
|
|
|
enable = lib.versionOlder php.version "8.0";
|
|
|
|
configureFlags = [ "--with-xmlrpc" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "xmlwriter";
|
|
|
|
buildInputs = [ libxml2 ];
|
|
|
|
configureFlags = [ "--enable-xmlwriter" ]
|
|
|
|
# Required to build on darwin.
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "xsl";
|
|
|
|
buildInputs = [ libxslt libxml2 ];
|
|
|
|
doCheck = lib.versionOlder php.version "8.0";
|
|
|
|
configureFlags = [ "--with-xsl=${libxslt.dev}" ];
|
|
|
|
}
|
|
|
|
{ name = "zend_test"; }
|
|
|
|
{
|
|
|
|
name = "zip";
|
|
|
|
buildInputs = [ libzip pcre2 ];
|
|
|
|
configureFlags = [ "--with-zip" ]
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ]
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.3") [ "--with-libzip" ];
|
|
|
|
doCheck = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zlib";
|
|
|
|
buildInputs = [ zlib ];
|
|
|
|
patches = lib.optionals (lib.versionOlder php.version "7.4") [
|
|
|
|
# Derived from https://github.com/php/php-src/commit/f16b012116d6c015632741a3caada5b30ef8a699
|
|
|
|
../development/interpreters/php/zlib-darwin-tests.patch
|
|
|
|
];
|
|
|
|
configureFlags = [ "--with-zlib" ]
|
|
|
|
++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-zlib-dir=${zlib.dev}" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
# Convert the list of attrs:
|
|
|
|
# [ { name = <name>; ... } ... ]
|
|
|
|
# to a list of
|
|
|
|
# [ { name = <name>; value = <extension drv>; } ... ]
|
|
|
|
#
|
|
|
|
# which we later use listToAttrs to make all attrs available by name.
|
|
|
|
#
|
|
|
|
# Also filter out extensions based on the enable property.
|
|
|
|
namedExtensions = builtins.map
|
|
|
|
(drv: {
|
|
|
|
name = drv.name;
|
|
|
|
value = mkExtension drv;
|
|
|
|
})
|
|
|
|
(builtins.filter (i: i.enable or true) extensionData);
|
|
|
|
|
|
|
|
# Produce the final attribute set of all extensions defined.
|
|
|
|
in
|
|
|
|
builtins.listToAttrs namedExtensions
|
|
|
|
);
|
2020-12-15 16:42:21 +00:00
|
|
|
})
|