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