Skip to content

Commit acde5d0

Browse files
committed
php-master: init at 8.2.pre+date=20220426165801
1 parent 6a926ec commit acde5d0

File tree

4 files changed

+122
-29
lines changed

4 files changed

+122
-29
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ We use [Cachix](https://app.cachix.org/cache/fossar) to store `x86_64-linux` bin
1414

1515
This package is regularly updated to match latest Nixpkgs and the PHP packages use the [same API as those in Nixpkgs](https://nixos.org/manual/nixpkgs/unstable/#sec-php).
1616

17-
The following versions are currently supported:
17+
The following versions are currently available:
1818

1919
- `php56`
2020
- `php70`
@@ -24,6 +24,7 @@ The following versions are currently supported:
2424
- `php74`
2525
- `php80`
2626
- `php81`
27+
- `php-master`
2728

2829
There is also a `php` package which is the alias of the default PHP version in Nixpkgs.
2930

checks.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}:
66

77
let
8-
phpPackages = builtins.filter (name: builtins.match "php[0-9]+" name != null) (builtins.attrNames packages);
8+
phpPackages = builtins.filter (name: builtins.match "php([0-9]+|-master)" name != null) (builtins.attrNames packages);
99

1010
checks = {
1111
php = {

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/phps.nix

Lines changed: 102 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ prev:
1111
let
1212
packageOverrides = import ./package-overrides.nix prev;
1313

14+
/* Composes package overrides (i.e. overlays that only take prev). */
15+
composeOverrides = a: b: prev.lib.composeExtensions (_: a) (_: b) { };
16+
1417
_mkArgs =
1518
args:
1619

17-
{
20+
args // {
1821
inherit packageOverrides;
1922

2023
# For passing pcre2 to generic.nix.
@@ -23,34 +26,44 @@ let
2326
then prev.pcre2
2427
else prev.pcre;
2528

29+
# Overrides attributes passed to the stdenv.mkDerivation for the unwrapped PHP
30+
# in <nixpkgs/pkgs/development/interpreters/php/generic.nix>.
31+
# This will essentially end up creating a derivation equivalent to the following:
32+
# stdenv.mkDerivation (versionSpecificOverrides (commonOverrides { /* stuff passed to mkDerivation in generic.nix */ }))
2633
phpAttrsOverrides =
27-
attrs:
28-
29-
{
30-
patches =
31-
let
32-
upstreamPatches =
33-
attrs.patches or [ ];
34-
35-
ourPatches =
36-
prev.lib.optionals (prev.lib.versions.majorMinor args.version == "7.2") [
37-
# Building the bundled intl extension fails on Mac OS.
38-
# See https://bugs.php.net/bug.php?id=76826 for more information.
39-
(prev.pkgs.fetchpatch {
40-
url = "https://bugs.php.net/patch-display.php?bug_id=76826&patch=bug76826.poc.0.patch&revision=1538723399&download=1";
41-
sha256 = "aW+MW9Kb8N/yBO7MdqZMZzgMSF7b+IMLulJKgKPWrUA=";
42-
})
34+
let
35+
commonOverrides =
36+
attrs:
37+
38+
{
39+
patches =
40+
let
41+
upstreamPatches =
42+
attrs.patches or [ ];
43+
44+
ourPatches =
45+
prev.lib.optionals (prev.lib.versions.majorMinor args.version == "7.2") [
46+
# Building the bundled intl extension fails on Mac OS.
47+
# See https://bugs.php.net/bug.php?id=76826 for more information.
48+
(prev.pkgs.fetchpatch {
49+
url = "https://bugs.php.net/patch-display.php?bug_id=76826&patch=bug76826.poc.0.patch&revision=1538723399&download=1";
50+
sha256 = "aW+MW9Kb8N/yBO7MdqZMZzgMSF7b+IMLulJKgKPWrUA=";
51+
})
52+
];
53+
in
54+
ourPatches ++ upstreamPatches;
55+
56+
configureFlags =
57+
attrs.configureFlags
58+
++ prev.lib.optionals (prev.lib.versionOlder args.version "7.4") [
59+
# phar extension’s build system expects hash or it will degrade.
60+
"--enable-hash"
4361
];
44-
in
45-
ourPatches ++ upstreamPatches;
62+
};
4663

47-
configureFlags =
48-
attrs.configureFlags
49-
++ prev.lib.optionals (prev.lib.versionOlder args.version "7.4") [
50-
# phar extension’s build system expects hash or it will degrade.
51-
"--enable-hash"
52-
];
53-
};
64+
versionSpecificOverrides = args.phpAttrsOverrides or (attrs: { });
65+
in
66+
composeOverrides commonOverrides versionSpecificOverrides;
5467

5568
# For passing pcre2 to php-packages.nix.
5669
callPackage =
@@ -72,7 +85,7 @@ let
7285
else prev.pcre;
7386
});
7487
});
75-
} // args;
88+
};
7689

7790
generic = "${nixpkgs}/pkgs/development/interpreters/php/generic.nix";
7891

@@ -115,6 +128,16 @@ let
115128
})
116129
];
117130
});
131+
132+
base-master =
133+
prev.callPackage generic (_mkArgs {
134+
version = "8.2.0.pre+date=${php-src.lastModifiedDate}";
135+
sha256 = null;
136+
137+
phpAttrsOverrides = attrs: {
138+
src = php-src;
139+
};
140+
});
118141
in
119142
{
120143
php56 =
@@ -393,4 +416,56 @@ in
393416
prev.php81.override {
394417
inherit packageOverrides;
395418
};
419+
420+
php-master =
421+
base-master.withExtensions
422+
(
423+
{ all, ... }:
424+
425+
with all;
426+
([
427+
bcmath
428+
calendar
429+
curl
430+
ctype
431+
dom
432+
exif
433+
fileinfo
434+
filter
435+
ftp
436+
gd
437+
gettext
438+
gmp
439+
iconv
440+
intl
441+
ldap
442+
mbstring
443+
mysqli
444+
mysqlnd
445+
opcache
446+
openssl
447+
pcntl
448+
pdo
449+
pdo_mysql
450+
pdo_odbc
451+
pdo_pgsql
452+
pdo_sqlite
453+
pgsql
454+
posix
455+
readline
456+
session
457+
simplexml
458+
sockets
459+
soap
460+
sodium
461+
sqlite3
462+
tokenizer
463+
xmlreader
464+
xmlwriter
465+
zip
466+
zlib
467+
] ++ prev.lib.optionals (!prev.stdenv.isDarwin) [
468+
imap
469+
])
470+
);
396471
}

0 commit comments

Comments
 (0)