Skip to content

Commit 6a926ec

Browse files
committed
pkgs/phps: Fix type error
configureFlags should take array but lib.optionalString will return a string when the condition is false. It only ever worked because we always run the code on PHP < 7.4 and lib.optionalString returns the argument as is when the condition is false.
1 parent c783031 commit 6a926ec

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

flake.nix

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010

1111
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
1212

13+
php-src = {
14+
url = "github:php/php-src";
15+
flake = false;
16+
};
17+
1318
utils.url = "github:numtide/flake-utils";
1419
};
1520

16-
outputs = { self, flake-compat, nixpkgs, utils }:
21+
outputs = { self, flake-compat, nixpkgs, php-src, utils }:
1722
# For each supported platform,
1823
utils.lib.eachDefaultSystem (system:
1924
let
@@ -29,14 +34,16 @@
2934
};
3035
in rec {
3136
packages = {
32-
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81;
37+
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php-master;
3338
};
3439

3540
checks = import ./checks.nix {
3641
inherit packages pkgs system;
3742
};
3843
}
3944
) // {
40-
overlay = import ./pkgs/phps.nix nixpkgs.outPath;
45+
overlay = import ./pkgs/phps.nix {
46+
inherit nixpkgs php-src;
47+
};
4148
};
4249
}

pkgs/phps.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
nixpkgs:
1+
{
2+
nixpkgs,
3+
php-src,
4+
}:
25

36
# These are older versions of PHP removed from Nixpkgs.
47

@@ -43,7 +46,7 @@ let
4346

4447
configureFlags =
4548
attrs.configureFlags
46-
++ prev.lib.optionalString (prev.lib.versionOlder args.version "7.4") [
49+
++ prev.lib.optionals (prev.lib.versionOlder args.version "7.4") [
4750
# phar extension’s build system expects hash or it will degrade.
4851
"--enable-hash"
4952
];

0 commit comments

Comments
 (0)