Skip to content

Commit

Permalink
Avoid multiple definitions of pcre2
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Aug 26, 2024
1 parent 17ba392 commit df3a334
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pkgs/phps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 =
Expand All @@ -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;
})
);
}
Expand Down

0 comments on commit df3a334

Please sign in to comment.