diff options
author | talyz <kim.lindberger@gmail.com> | 2020-04-03 18:14:26 +0200 |
---|---|---|
committer | talyz <kim.lindberger@gmail.com> | 2020-04-05 16:45:41 +0200 |
commit | 4ff523f691c2caf9e878b6f3ec1b6f14513bd226 (patch) | |
tree | 711a9417e36cccf3ecc99b36c5945b6eab77f68b /pkgs/development/interpreters/php/default.nix | |
parent | 1b69056e4626fd95f7bfad2cc1423662828addf1 (diff) | |
download | nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar.gz nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar.bz2 nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar.lz nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar.xz nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.tar.zst nixlib-4ff523f691c2caf9e878b6f3ec1b6f14513bd226.zip |
php: Simplify php-packages import, rename exts -> extensions
Diffstat (limited to 'pkgs/development/interpreters/php/default.nix')
-rw-r--r-- | pkgs/development/interpreters/php/default.nix | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 99a859cb5742..2558cf2c4b5d 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -150,27 +150,22 @@ let let php = generic (builtins.removeAttrs args [ "self" "selfWithExtensions" ]); - packages = (callPackage ../../../top-level/php-packages.nix { + php-packages = (callPackage ../../../top-level/php-packages.nix { php = self; phpWithExtensions = selfWithExtensions; - }).packages; - - extensions = (callPackage ../../../top-level/php-packages.nix { - php = self; - phpWithExtensions = selfWithExtensions; - }).extensions; + }); - buildEnv = { exts ? (_: []), extraConfig ? "" }: + buildEnv = { extensions ? (_: []), extraConfig ? "" }: let getExtName = ext: lib.removePrefix "php-" (builtins.parseDrvName ext.name).name; - extList = exts extensions; - - # Generate extension load configuration snippets from - # exts. This is an attrset suitable for use with - # textClosureList, which is used to put the strings in the - # right order - if a plugin which is dependent on another - # plugin is placed before its dependency, it will fail to - # load. + extList = extensions php-packages.extensions; + + # Generate extension load configuration snippets from the + # extension parameter. This is an attrset suitable for use + # with textClosureList, which is used to put the strings in + # the right order - if a plugin which is dependent on + # another plugin is placed before its dependency, it will + # fail to load. extensionTexts = lib.listToAttrs (map (ext: @@ -198,7 +193,8 @@ let inherit (php) dev; nativeBuildInputs = [ makeWrapper ]; passthru = { - inherit buildEnv packages extensions; + inherit buildEnv; + inherit (php-packages) packages extensions; }; paths = [ php ]; postBuild = '' @@ -214,7 +210,8 @@ let in php.overrideAttrs (_: { passthru = { - inherit buildEnv packages extensions; + inherit buildEnv; + inherit (php-packages) packages extensions; }; }); @@ -246,7 +243,7 @@ let }; defaultPhpExtensions = { - exts = pp: with pp; ([ + extensions = extensions: with extensions; ([ bcmath calendar curl ctype dom exif fileinfo filter ftp gd gettext gmp iconv intl json ldap mbstring mysqli mysqlnd opcache openssl pcntl pdo pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql |