From 6d8aca107e10374d5e74ed09166393a42980afa0 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 1 May 2022 21:27:23 +0200 Subject: [PATCH] php-master: Fix a build issue on PHP < 7.4.0RC1 The `--enable-xml` flag was renamed in 7.4.0RC1 to `--with-xml`: https://github.com/php/php-src/commit/9f0c9b7ad6316b6185a2fc2997bf241785c30120 But `generic.nix` applies the old flag for `lib.versionOlder php.version "7.4"` so we need to re-add it manually to also cover 7.4 development versions. --- pkgs/phps.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/phps.nix b/pkgs/phps.nix index 38c70e0d..97674283 100644 --- a/pkgs/phps.nix +++ b/pkgs/phps.nix @@ -15,7 +15,11 @@ let composeOverrides = a: b: prev.lib.composeExtensions (_: a) (_: b) { }; _mkArgs = - args: + { + # Keep default flags in sync with generic.nix + pearSupport ? true, + ... + }@args: args // { inherit packageOverrides; @@ -58,6 +62,10 @@ let ++ prev.lib.optionals (prev.lib.versionOlder args.version "7.4") [ # phar extension’s build system expects hash or it will degrade. "--enable-hash" + ] ++ prev.lib.optionals (pearSupport && (prev.lib.versionOlder args.version "7.4" || prev.lib.hasPrefix "7.4.0.pre" args.version)) [ + # The flag was renamed in 7.4.0RC1 but `generic.nix` applies it for PHP < 7.4. + # https://github.com/php/php-src/commit/9f0c9b7ad6316b6185a2fc2997bf241785c30120 + "--enable-libxml" ]; preConfigure =