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

35 lines
761 B
Nix
Raw Normal View History

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