php85: init at 8.5.2

This commit is contained in:
Piotr Kwiecinski
2026-01-17 18:53:55 +01:00
parent 3a6d2f4799
commit 21efaec96c
5 changed files with 103 additions and 22 deletions
+4
View File
@@ -1240,6 +1240,10 @@ in
inherit runTest;
php = pkgs.php84;
};
php85 = import ./php/default.nix {
inherit runTest;
php = pkgs.php85;
};
phylactery = runTest ./web-apps/phylactery.nix;
pict-rs = runTest ./pict-rs.nix;
pihole-ftl = import ./pihole-ftl { inherit runTest; };
+57
View File
@@ -0,0 +1,57 @@
{ callPackage, ... }@_args:
let
base = callPackage ./generic.nix (
_args
// {
version = "8.5.2";
hash = "sha256-9+/ezMOoELGJIGkjBlNrmaO6hmENvQeVopbPd9P7OgY=";
}
);
in
base.withExtensions (
{ all, ... }:
with all;
[
bcmath
calendar
curl
ctype
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
iconv
intl
ldap
mbstring
mysqli
mysqlnd
openssl
pcntl
pdo
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
posix
readline
session
simplexml
sockets
soap
sodium
sysvsem
sqlite3
tokenizer
xmlreader
xmlwriter
zip
zlib
]
)
@@ -346,6 +346,10 @@ let
substituteInPlace $dev/bin/phpize \
--replace-fail "$out/lib" "$dev/lib"
''
+ lib.optionalString (lib.versionAtLeast version "8.5") ''
# PHP 8.5+ has lexbor built into core; dom needs its headers.
cp -r ext/lexbor/lexbor $dev/include/php/ext/lexbor/
'';
src = if phpSrc == null then defaultPhpSrc else phpSrc;
+10
View File
@@ -5476,6 +5476,16 @@ with pkgs;
phpExtensions = recurseIntoAttrs php.extensions;
phpPackages = recurseIntoAttrs php.packages;
# Import PHP85 interpreter, extensions and packages
php85 = callPackage ../development/interpreters/php/8.5.nix {
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
pcre2 = pcre2.override {
withJitSealloc = false; # See https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630
};
};
php85Extensions = recurseIntoAttrs php85.extensions;
php85Packages = recurseIntoAttrs php85.packages;
# Import PHP84 interpreter, extensions and packages
php84 = callPackage ../development/interpreters/php/8.4.nix {
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
+28 -22
View File
@@ -447,6 +447,10 @@ lib.makeScope pkgs.newScope (
configureFlags = [
"--enable-dom"
];
# PHP 8.5+ has lexbor built into core; dom needs its headers.
env = lib.optionalAttrs (lib.versionAtLeast php.version "8.5") {
NIX_CFLAGS_COMPILE = "-I${php.unwrapped.dev}/include/php/ext/lexbor";
};
}
{
name = "enchant";
@@ -573,28 +577,6 @@ lib.makeScope pkgs.newScope (
'')
];
}
{
name = "opcache";
buildInputs = [
pcre2
]
++ lib.optional (
!stdenv.hostPlatform.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
) valgrind.dev;
configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit";
zendExtension = true;
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Tests are flaky on darwin
rm ext/opcache/tests/blacklist.phpt
rm ext/opcache/tests/bug66338.phpt
rm ext/opcache/tests/bug78106.phpt
rm ext/opcache/tests/issue0115.phpt
rm ext/opcache/tests/issue0149.phpt
rm ext/opcache/tests/revalidate_path_01.phpt
'';
# Tests launch the builtin webserver.
__darwinAllowLocalNetworking = true;
}
{
name = "openssl";
buildInputs = [ openssl ];
@@ -829,6 +811,30 @@ lib.makeScope pkgs.newScope (
"--with-kerberos"
];
}
]
++ lib.optionals (lib.versionOlder php.version "8.5") [
{
name = "opcache";
buildInputs = [
pcre2
]
++ lib.optional (
!stdenv.hostPlatform.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
) valgrind.dev;
configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit";
zendExtension = true;
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Tests are flaky on darwin
rm ext/opcache/tests/blacklist.phpt
rm ext/opcache/tests/bug66338.phpt
rm ext/opcache/tests/bug78106.phpt
rm ext/opcache/tests/issue0115.phpt
rm ext/opcache/tests/issue0149.phpt
rm ext/opcache/tests/revalidate_path_01.phpt
'';
# Tests launch the builtin webserver.
__darwinAllowLocalNetworking = true;
}
];
# Convert the list of attrs: