Merge pull request #115089 from Ma27/php-ext-fix

Revert "php: Add php package versions to extensions/packages pnames"
This commit is contained in:
Elis Hirwing 2021-03-04 18:10:14 +01:00 committed by GitHub
commit bc8532b8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View File

@ -2,8 +2,14 @@
, config ? {} , config ? {}
, pkgs ? import ../../.. { inherit system config; } , pkgs ? import ../../.. { inherit system config; }
, php ? pkgs.php , php ? pkgs.php
}: { }:
fpm = import ./fpm.nix { inherit system pkgs php; };
httpd = import ./httpd.nix { inherit system pkgs php; }; let
pcre = import ./pcre.nix { inherit system pkgs php; }; php' = php.buildEnv {
extensions = { enabled, all }: with all; enabled ++ [ apcu ];
};
in {
fpm = import ./fpm.nix { inherit system pkgs; php = php'; };
httpd = import ./httpd.nix { inherit system pkgs; php = php'; };
pcre = import ./pcre.nix { inherit system pkgs; php = php'; };
} }

View File

@ -3,6 +3,8 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
machine = { config, lib, pkgs, ... }: { machine = { config, lib, pkgs, ... }: {
environment.systemPackages = [ php ];
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -48,7 +50,8 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
assert "PHP Version ${php.version}" in response, "PHP version not detected" assert "PHP Version ${php.version}" in response, "PHP version not detected"
# Check so we have database and some other extensions loaded # Check so we have database and some other extensions loaded
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite", "apcu"]:
assert ext in response, f"Missing {ext} extension" assert ext in response, f"Missing {ext} extension"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
''; '';
}) })

View File

@ -16,10 +16,10 @@
}@args: }@args:
stdenv.mkDerivation (args // { stdenv.mkDerivation (args // {
pname = "php-${php.version}-${pname}"; name = "php-${pname}-${version}";
extensionName = pname; extensionName = pname;
inherit version src; inherit src;
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs; nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
buildInputs = [ php ] ++ peclDeps ++ buildInputs; buildInputs = [ php ] ++ peclDeps ++ buildInputs;

View File

@ -16,7 +16,7 @@ lib.makeScope pkgs.newScope (self: with self; {
# Wrap mkDerivation to prepend pname with "php-" to make names consistent # Wrap mkDerivation to prepend pname with "php-" to make names consistent
# with how buildPecl does it and make the file easier to overview. # with how buildPecl does it and make the file easier to overview.
mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // { mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // {
pname = "php-${php.version}-${pname}"; pname = "php-${pname}";
}); });
pcre' = if (lib.versionAtLeast php.version "7.3") then pcre2 else pcre; pcre' = if (lib.versionAtLeast php.version "7.3") then pcre2 else pcre;