From df3a334c1a2c39f6037f6d997a4eab38a9b1d3a1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 26 Aug 2024 09:57:25 +0200 Subject: [PATCH] Avoid multiple definitions of pcre2 --- pkgs/phps.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/phps.nix b/pkgs/phps.nix index cd8f721d..36739d53 100644 --- a/pkgs/phps.nix +++ b/pkgs/phps.nix @@ -11,14 +11,14 @@ let _mkArgs = args: - { - inherit packageOverrides; - - # For passing pcre2 to generic.nix. + let pcre2 = if prev.lib.versionAtLeast args.version "7.3" then prev.pcre2 else prev.pcre; + in + { + inherit packageOverrides pcre2; phpAttrsOverrides = attrs: @@ -108,10 +108,7 @@ let # Only pass these attributes if the package function actually expects them. prev.lib.filterAttrs (key: _v: builtins.hasAttr key prevArgs) { - pcre2 = - if prev.lib.versionAtLeast args.version "7.3" - then prev.pcre2 - else prev.pcre; + inherit pcre2; # For passing pcre2 to stuff called with callPackage in php-packages.nix. pkgs = @@ -120,10 +117,7 @@ let prev.lib.makeScope prev.newScope (self: { - pcre2 = - if prev.lib.versionAtLeast args.version "7.3" - then prev.pcre2 - else prev.pcre; + inherit pcre2; }) ); }