2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }:
|
|
|
|
|
|
|
|
{ pname
|
|
|
|
, version
|
2021-06-28 23:13:55 +00:00
|
|
|
, internalDeps ? [ ]
|
|
|
|
, peclDeps ? [ ]
|
|
|
|
, buildInputs ? [ ]
|
|
|
|
, nativeBuildInputs ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
, postPhpize ? ""
|
2021-06-28 23:13:55 +00:00
|
|
|
, makeFlags ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
, src ? fetchurl {
|
2022-11-21 17:40:18 +00:00
|
|
|
url = "https://pecl.php.net/get/${pname}-${version}.tgz";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (args) sha256;
|
|
|
|
}
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (args // {
|
|
|
|
name = "php-${pname}-${version}";
|
2020-05-15 21:57:56 +00:00
|
|
|
extensionName = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
|
2020-05-15 21:57:56 +00:00
|
|
|
buildInputs = [ php ] ++ peclDeps ++ buildInputs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;
|
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
phpize
|
|
|
|
${postPhpize}
|
|
|
|
${lib.concatMapStringsSep "\n"
|
|
|
|
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
|
|
|
|
internalDeps}
|
|
|
|
'';
|
2021-06-04 09:07:49 +00:00
|
|
|
checkPhase = "NO_INTERACTON=yes make test";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|