2020-03-29 01:20:38 +03:00
|
|
|
{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }:
|
2014-03-24 16:37:36 +04:00
|
|
|
|
2019-04-20 17:09:05 +03:00
|
|
|
{ pname
|
|
|
|
, version
|
2021-06-26 10:46:46 +03:00
|
|
|
, internalDeps ? [ ]
|
|
|
|
, peclDeps ? [ ]
|
|
|
|
, buildInputs ? [ ]
|
|
|
|
, nativeBuildInputs ? [ ]
|
2020-03-29 01:20:38 +03:00
|
|
|
, postPhpize ? ""
|
2021-06-26 10:46:46 +03:00
|
|
|
, makeFlags ? [ ]
|
2014-07-03 18:52:02 +04:00
|
|
|
, src ? fetchurl {
|
2019-04-20 17:09:05 +03:00
|
|
|
url = "http://pecl.php.net/get/${pname}-${version}.tgz";
|
2014-07-03 18:52:02 +04:00
|
|
|
inherit (args) sha256;
|
|
|
|
}
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (args // {
|
2021-03-04 17:26:36 +03:00
|
|
|
name = "php-${pname}-${version}";
|
2020-05-03 00:13:53 +03:00
|
|
|
extensionName = pname;
|
2014-07-03 18:19:57 +04:00
|
|
|
|
2021-03-04 17:26:36 +03:00
|
|
|
inherit src;
|
2014-07-03 18:52:02 +04:00
|
|
|
|
2019-06-06 22:16:58 +03:00
|
|
|
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
|
2020-05-03 00:13:53 +03:00
|
|
|
buildInputs = [ php ] ++ peclDeps ++ buildInputs;
|
2014-03-24 16:37:36 +04:00
|
|
|
|
2014-07-03 18:52:02 +04:00
|
|
|
makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;
|
2014-03-24 16:37:36 +04:00
|
|
|
|
2020-03-29 01:20:38 +03:00
|
|
|
autoreconfPhase = ''
|
|
|
|
phpize
|
|
|
|
${postPhpize}
|
|
|
|
${lib.concatMapStringsSep "\n"
|
|
|
|
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
|
|
|
|
internalDeps}
|
|
|
|
'';
|
2021-05-27 19:13:16 +03:00
|
|
|
checkPhase = "NO_INTERACTON=yes make test";
|
2014-03-24 16:37:36 +04:00
|
|
|
})
|