nixpkgs/pkgs/build-support/php/build-pecl.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.4 KiB
Nix
Raw Normal View History

{
stdenv,
lib,
php,
autoreconfHook,
fetchurl,
re2c,
nix-update-script,
}:
2014-03-24 12:37:36 +00:00
2019-04-20 14:09:05 +00:00
{
pname,
version,
internalDeps ? [ ],
peclDeps ? [ ],
buildInputs ? [ ],
nativeBuildInputs ? [ ],
postPhpize ? "",
makeFlags ? [ ],
2023-09-25 12:52:33 +00:00
src ? fetchurl (
{
2022-10-27 09:41:05 +00:00
url = "https://pecl.php.net/get/${pname}-${version}.tgz";
2023-09-25 12:52:33 +00:00
}
// lib.filterAttrs (
attrName: _:
lib.elem attrName [
"sha256"
"hash"
]
) args
),
passthru ? { },
2014-07-03 14:52:02 +00:00
...
}@args:
stdenv.mkDerivation (
args
// {
name = "php-${pname}-${version}";
extensionName = pname;
2014-07-03 14:19:57 +00:00
inherit src;
2014-07-03 14:52:02 +00:00
nativeBuildInputs = [
autoreconfHook
re2c
] ++ nativeBuildInputs;
buildInputs = [ php ] ++ peclDeps ++ buildInputs;
2014-03-24 12:37:36 +00:00
2014-07-03 14:52:02 +00:00
makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;
2014-03-24 12:37:36 +00:00
autoreconfPhase = ''
phpize
${postPhpize}
${lib.concatMapStringsSep "\n" (
dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}"
) internalDeps}
'';
checkPhase = "NO_INTERACTON=yes make test";
passthru = passthru // {
# Thes flags were introduced for `nix-update` so that it can update
# PHP extensions correctly.
# See the corresponding PR: https://github.com/Mic92/nix-update/pull/123
isPhpExtension = true;
updateScript = nix-update-script { };
};
2014-03-24 12:37:36 +00:00
}
)