diff options
author | talyz <kim.lindberger@gmail.com> | 2020-03-28 22:37:22 +0100 |
---|---|---|
committer | talyz <kim.lindberger@gmail.com> | 2020-04-05 16:43:50 +0200 |
commit | b1106a18510245bfd642c057dda43ad5ea985baa (patch) | |
tree | 5c47728d0fbbb1819220fd1744518a1aef4f6ca2 /pkgs/development/interpreters | |
parent | 14bfb844d6293dbf9eedbbc7707347f1c407bb51 (diff) | |
download | nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar.gz nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar.bz2 nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar.lz nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar.xz nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.tar.zst nixlib-b1106a18510245bfd642c057dda43ad5ea985baa.zip |
phpPackages: Move phpPackages to php.packages
This means php packages can now refer to other php packages by looking them up in the php.packages attribute and gets rid of the internal recursive set previously defined in php-packages.nix. This also means that in applications where previously both the php package and the corresponding version of the phpPackages package set had to be specified, the php package will now suffice. This also adds the phpWithExtensions parameter to the php-packages.nix, which can be used by extensions that need a fully featured PHP executable.
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r-- | pkgs/development/interpreters/php/default.nix | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 36f1d9f92e96..3c2a73a5c193 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -144,13 +144,17 @@ let }; }; - generic' = { version, sha256, ... }@args: + generic' = { version, sha256, self, selfWithExtensions, ... }@args: let - php = generic args; + php = generic (builtins.removeAttrs args [ "self" "selfWithExtensions" ]); + packages = callPackage ../../../top-level/php-packages.nix { + php = self; + phpWithExtensions = selfWithExtensions; + }; buildEnv = { exts ? (_: []), extraConfig ? "" }: let getExtName = ext: lib.removePrefix "php-" (builtins.parseDrvName ext.name).name; - extList = exts (callPackage ../../../top-level/php-packages.nix { inherit php; }); + extList = exts packages; # Generate extension load configuration snippets from # exts. This is an attrset suitable for use with @@ -182,7 +186,9 @@ let name = "php-with-extensions-${version}"; inherit version; nativeBuildInputs = [ makeWrapper ]; - passthru.buildEnv = buildEnv; + passthru = { + inherit buildEnv packages; + }; paths = [ php ]; postBuild = '' wrapProgram $out/bin/php \ @@ -193,12 +199,16 @@ let }; in php.overrideAttrs (_: { - passthru.buildEnv = buildEnv; + passthru = { + inherit buildEnv packages; + }; }); php72base = generic' { version = "7.2.28"; sha256 = "18sjvl67z5a2x5s2a36g6ls1r3m4hbrsw52hqr2qsgfvg5dkm5bw"; + self = php72base; + selfWithExtensions = php72; # https://bugs.php.net/bug.php?id=76826 extraPatches = lib.optional stdenv.isDarwin ./php72-darwin-isfinite.patch; @@ -207,6 +217,8 @@ let php73base = generic' { version = "7.3.15"; sha256 = "0g84hws15s8gh8iq4h6q747dyfazx47vh3da3whz8d80x83ibgld"; + self = php73base; + selfWithExtensions = php73; # https://bugs.php.net/bug.php?id=76826 extraPatches = lib.optional stdenv.isDarwin ./php73-darwin-isfinite.patch; @@ -215,6 +227,8 @@ let php74base = generic' { version = "7.4.3"; sha256 = "wVF7pJV4+y3MZMc6Ptx21PxQfEp6xjmYFYTMfTtMbRQ="; + self = php74base; + selfWithExtensions = php74; }; defaultPhpExtensions = { @@ -226,10 +240,11 @@ let tokenizer xmlreader xmlwriter zip zlib ] ++ lib.optionals (!stdenv.isDarwin) [ imap ]); }; -in { - inherit php72base php73base php74base; php74 = php74base.buildEnv defaultPhpExtensions; php73 = php73base.buildEnv defaultPhpExtensions; php72 = php72base.buildEnv defaultPhpExtensions; + +in { + inherit php72base php73base php74base php72 php73 php74; } |