Merge pull request #86614 from talyz/php-buildpecl-pecldeps

php.buildPecl: Make it possible for PECLs to depend on other PECLs, fix apcu_bc and couchbase
This commit is contained in:
Kim Lindberger 2020-05-10 12:37:22 +02:00 committed by GitHub
commit e4efa8bc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 15 deletions

View File

@ -3,6 +3,7 @@
{ pname
, version
, internalDeps ? []
, peclDeps ? []
, buildInputs ? []
, nativeBuildInputs ? []
, postPhpize ? ""
@ -16,11 +17,12 @@
stdenv.mkDerivation (args // {
name = "php-${pname}-${version}";
extensionName = pname;
inherit src;
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
buildInputs = [ php ] ++ buildInputs;
buildInputs = [ php ] ++ peclDeps ++ buildInputs;
makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;

View File

@ -67,7 +67,7 @@ let
getDepsRecursively = extensions:
let
deps = lib.concatMap
(ext: ext.internalDeps or [])
(ext: (ext.internalDeps or []) ++ (ext.peclDeps or []))
extensions;
in
if ! (deps == []) then
@ -86,12 +86,12 @@ let
(map (ext:
let
extName = getExtName ext;
phpDeps = (ext.internalDeps or []) ++ (ext.peclDeps or []);
type = "${lib.optionalString (ext.zendExtension or false) "zend_"}extension";
in
lib.nameValuePair extName {
text = "${type}=${ext}/lib/php/extensions/${extName}.so";
deps = lib.optionals (ext ? internalDeps)
(map getExtName ext.internalDeps);
deps = map getExtName phpDeps;
})
(enabledExtensions ++ (getDepsRecursively enabledExtensions)));
@ -112,7 +112,7 @@ let
phpIni = "${phpWithExtensions}/lib/php.ini";
unwrapped = php;
tests = nixosTests.php;
inherit (php-packages) packages extensions;
inherit (php-packages) packages extensions buildPecl;
meta = php.meta // {
outputsToInstall = [ "out" ];
};

View File

@ -320,11 +320,16 @@ in
sha256 = "0ma00syhk2ps9k9p02jz7rii6x3i2p986il23703zz5npd6y9n20";
peclDeps = [ php.extensions.apcu ];
buildInputs = [
php.extensions.apcu
pcre'
];
postInstall = ''
mv $out/lib/php/extensions/apc.so $out/lib/php/extensions/apcu_bc.so
'';
meta.maintainers = lib.teams.php.members;
};
@ -341,13 +346,6 @@ in
version = "2.6.1";
pname = "couchbase";
buildInputs = [
pkgs.libcouchbase
pkgs.zlib
php.extensions.igbinary
php.extensions.pcs
];
src = pkgs.fetchFromGitHub {
owner = "couchbase";
repo = "php-couchbase";
@ -356,7 +354,14 @@ in
};
configureFlags = [ "--with-couchbase" ];
buildInputs = [
pkgs.libcouchbase
pkgs.zlib
];
internalDeps = [ php.extensions.json ];
peclDeps = [ php.extensions.igbinary ];
patches = [
(pkgs.writeText "php-couchbase.patch" ''
--- a/config.m4
@ -383,7 +388,6 @@ in
];
meta.maintainers = lib.teams.php.members;
meta.broken = isPhp74; # Build error
};
event = buildPecl {
@ -557,8 +561,10 @@ in
sha256 = "0d4p1gpl8gkzdiv860qzxfz250ryf0wmjgyc8qcaaqgkdyh5jy5p";
internalDeps = [ php.extensions.tokenizer ];
meta.maintainers = lib.teams.php.members;
meta.broken = isPhp74; # Build error
meta.broken = isPhp73; # Runtime failure on 7.3, build error on 7.4
};
pdo_oci = buildPecl rec {