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

Revert "php: Add php package versions to extensions/packages pnames"
wip/yesman
Elis Hirwing 3 years ago committed by GitHub
commit bc8532b8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      nixos/tests/php/default.nix
  2. 5
      nixos/tests/php/fpm.nix
  3. 4
      pkgs/build-support/build-pecl.nix
  4. 2
      pkgs/top-level/php-packages.nix

@ -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'; };
}

@ -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})"')
'';
})

@ -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;

@ -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;

Loading…
Cancel
Save