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 ? {}
, pkgs ? import ../../.. { inherit system config; }
, php ? pkgs.php
}: {
fpm = import ./fpm.nix { inherit system pkgs php; };
httpd = import ./httpd.nix { inherit system pkgs php; };
pcre = import ./pcre.nix { inherit system pkgs php; };
}:
let
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;
machine = { config, lib, pkgs, ... }: {
environment.systemPackages = [ php ];
services.nginx = {
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"
# 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"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
'';
})

View file

@ -16,10 +16,10 @@
}@args:
stdenv.mkDerivation (args // {
pname = "php-${php.version}-${pname}";
name = "php-${pname}-${version}";
extensionName = pname;
inherit version src;
inherit src;
nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
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
# with how buildPecl does it and make the file easier to overview.
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;