1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-29 17:10:48 +00:00
nixpkgs/pkgs/build-support/build-pecl.nix

38 lines
865 B
Nix
Raw Normal View History

{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }:
2014-03-24 12:37:36 +00:00
2019-04-20 15:09:05 +01:00
{ pname
, version
, internalDeps ? [ ]
, peclDeps ? [ ]
, buildInputs ? [ ]
, nativeBuildInputs ? [ ]
, postPhpize ? ""
, makeFlags ? [ ]
2014-07-03 15:52:02 +01:00
, src ? fetchurl {
2019-04-20 15:09:05 +01:00
url = "http://pecl.php.net/get/${pname}-${version}.tgz";
2014-07-03 15:52:02 +01:00
inherit (args) sha256;
}
, ...
}@args:
stdenv.mkDerivation (args // {
name = "php-${pname}-${version}";
extensionName = pname;
2014-07-03 15:19:57 +01:00
inherit src;
2014-07-03 15:52:02 +01:00
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
buildInputs = [ php ] ++ peclDeps ++ buildInputs;
2014-03-24 12:37:36 +00:00
2014-07-03 15:52:02 +01: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";
2014-03-24 12:37:36 +00:00
})