about summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2020-03-28 22:37:22 +0100
committertalyz <kim.lindberger@gmail.com>2020-04-05 16:43:50 +0200
commitb1106a18510245bfd642c057dda43ad5ea985baa (patch)
tree5c47728d0fbbb1819220fd1744518a1aef4f6ca2 /pkgs/top-level
parent14bfb844d6293dbf9eedbbc7707347f1c407bb51 (diff)
downloadnixlib-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/top-level')
-rw-r--r--pkgs/top-level/all-packages.nix16
-rw-r--r--pkgs/top-level/php-packages.nix57
2 files changed, 40 insertions, 33 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1bceaf3d29d1..1bb373ad6336 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9371,19 +9371,11 @@ in
   pachyderm = callPackage ../applications/networking/cluster/pachyderm { };
 
   php = php74;
-  phpPackages = php74Packages;
-
-  php72Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
-    php = php72base;
-  });
 
-  php73Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
-    php = php73base;
-  });
-
-  php74Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
-    php = php74base;
-  });
+  phpPackages = php74Packages;
+  php72Packages = recurseIntoAttrs php72.packages;
+  php73Packages = recurseIntoAttrs php73.packages;
+  php74Packages = recurseIntoAttrs php74.packages;
 
   inherit (callPackages ../development/interpreters/php {
     stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index 198b2c2e8e97..604a7b0474c3 100644
--- a/pkgs/top-level/php-packages.nix
+++ b/pkgs/top-level/php-packages.nix
@@ -1,25 +1,28 @@
-{ stdenv, lib, pkgs, fetchgit, php, autoconf, pkgconfig, re2c, gettext
-, bzip2, curl, libxml2, openssl, gmp, icu, oniguruma, libsodium, html-tidy
-, libzip, zlib, pcre, pcre2, libxslt, aspell, openldap, cyrus_sasl, uwimap
-, pam, libiconv, enchant1, libXpm, gd, libwebp, libjpeg, libpng, freetype
-, libffi, freetds, postgresql, sqlite, net-snmp, unixODBC, libedit, readline
+{ stdenv, lib, pkgs, fetchgit, php, phpWithExtensions, autoconf, pkgconfig, re2c
+, gettext, bzip2, curl, libxml2, openssl, gmp, icu, oniguruma, libsodium
+, html-tidy, libzip, zlib, pcre, pcre2, libxslt, aspell, openldap, cyrus_sasl
+, uwimap, pam, libiconv, enchant1, libXpm, gd, libwebp, libjpeg, libpng
+, freetype, libffi, freetds, postgresql, sqlite, net-snmp, unixODBC, libedit
+, readline, rsync
 }:
 
 let
-  self = with self; {
-    buildPecl = import ../build-support/build-pecl.nix {
-      inherit php;
-      inherit (pkgs) stdenv autoreconfHook fetchurl re2c;
-    };
+  buildPecl = import ../build-support/build-pecl.nix {
+    inherit php lib;
+    inherit (pkgs) stdenv autoreconfHook fetchurl re2c;
+  };
 
-    # Wrap mkDerivation to prepend pname with "php-" to make names consistent
-    # with how buildPecl does it and make the file easier to overview.
-    mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // {
-      pname = "php-${pname}";
-    });
+  # Wrap mkDerivation to prepend pname with "php-" to make names consistent
+  # with how buildPecl does it and make the file easier to overview.
+  mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // {
+    pname = "php-${pname}";
+  });
 
   isPhp73 = pkgs.lib.versionAtLeast php.version "7.3";
   isPhp74 = pkgs.lib.versionAtLeast php.version "7.4";
+in
+{
+  inherit buildPecl;
 
   apcu = buildPecl {
     version = "5.1.18";
@@ -41,7 +44,10 @@ let
 
     sha256 = "0ma00syhk2ps9k9p02jz7rii6x3i2p986il23703zz5npd6y9n20";
 
-    buildInputs = [ apcu (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
+    buildInputs = [
+      php.packages.apcu
+      (if isPhp73 then pkgs.pcre2 else pkgs.pcre)
+    ];
   };
 
   ast = buildPecl {
@@ -111,7 +117,12 @@ let
     version = "2.6.1";
     pname = "couchbase";
 
-    buildInputs = [ pkgs.libcouchbase pkgs.zlib igbinary pcs ];
+    buildInputs = [
+      pkgs.libcouchbase
+      pkgs.zlib
+      php.packages.igbinary
+      php.packages.pcs
+    ];
 
     src = pkgs.fetchFromGitHub {
       owner = "couchbase";
@@ -139,8 +150,8 @@ let
              igbinary_inc_path="$phpincludedir"
            elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then
              igbinary_inc_path="$phpincludedir"
-        +  elif test -f "${igbinary.dev}/include/ext/igbinary/igbinary.h"; then
-        +    igbinary_inc_path="${igbinary.dev}/include"
+        +  elif test -f "${php.packages.igbinary.dev}/include/ext/igbinary/igbinary.h"; then
+        +    igbinary_inc_path="${php.packages.igbinary.dev}/include"
            fi
            if test "$igbinary_inc_path" = ""; then
              AC_MSG_WARN([Cannot find igbinary.h])
@@ -353,7 +364,11 @@ let
       sha256 = "16nv8yyk2z3l213dg067l6di4pigg5rd8yswr5xgd18jwbys2vnw";
     };
 
-    buildInputs = [ pkgs.makeWrapper composer box ];
+    buildInputs = [
+      pkgs.makeWrapper
+      php.packages.composer
+      php.packages.box
+    ];
 
     buildPhase = ''
       composer dump-autoload
@@ -1024,4 +1039,4 @@ let
 
     # Produce the final attribute set of all extensions defined.
   in builtins.listToAttrs namedExtensions;
-}; in self
+}