php: Add withExtensions as a simpler alternative to buildEnv

This commit is contained in:
talyz 2020-04-03 18:18:36 +02:00
parent 4ff523f691
commit 1345e5b763
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
1 changed files with 14 additions and 14 deletions

View File

@ -193,7 +193,7 @@ let
inherit (php) dev; inherit (php) dev;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
passthru = { passthru = {
inherit buildEnv; inherit buildEnv withExtensions;
inherit (php-packages) packages extensions; inherit (php-packages) packages extensions;
}; };
paths = [ php ]; paths = [ php ];
@ -207,10 +207,12 @@ let
fi fi
''; '';
}; };
withExtensions = extensions: buildEnv { inherit extensions; };
in in
php.overrideAttrs (_: { php.overrideAttrs (_: {
passthru = { passthru = {
inherit buildEnv; inherit buildEnv withExtensions;
inherit (php-packages) packages extensions; inherit (php-packages) packages extensions;
}; };
}); });
@ -242,19 +244,17 @@ let
selfWithExtensions = php74; selfWithExtensions = php74;
}; };
defaultPhpExtensions = { defaultPhpExtensions = extensions: with extensions; ([
extensions = extensions: with extensions; ([ bcmath calendar curl ctype dom exif fileinfo filter ftp gd
bcmath calendar curl ctype dom exif fileinfo filter ftp gd gettext gmp iconv intl json ldap mbstring mysqli mysqlnd opcache
gettext gmp iconv intl json ldap mbstring mysqli mysqlnd opcache openssl pcntl pdo pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql
openssl pcntl pdo pdo_mysql pdo_odbc pdo_pgsql pdo_sqlite pgsql posix readline session simplexml sockets soap sodium sqlite3
posix readline session simplexml sockets soap sodium sqlite3 tokenizer xmlreader xmlwriter zip zlib
tokenizer xmlreader xmlwriter zip zlib ] ++ lib.optionals (!stdenv.isDarwin) [ imap ]);
] ++ lib.optionals (!stdenv.isDarwin) [ imap ]);
};
php74 = php74base.buildEnv defaultPhpExtensions; php74 = php74base.withExtensions defaultPhpExtensions;
php73 = php73base.buildEnv defaultPhpExtensions; php73 = php73base.withExtensions defaultPhpExtensions;
php72 = php72base.buildEnv defaultPhpExtensions; php72 = php72base.withExtensions defaultPhpExtensions;
in { in {
inherit php72base php73base php74base php72 php73 php74; inherit php72base php73base php74base php72 php73 php74;