Skip to content
4 changes: 4 additions & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,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; };
Expand Down
57 changes: 57 additions & 0 deletions pkgs/development/interpreters/php/8.5.nix
Original file line number Diff line number Diff line change
@@ -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
]
)
4 changes: 4 additions & 0 deletions pkgs/development/interpreters/php/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/php-packages/grpc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pkg-config,
lib,
grpc,
php,
}:

buildPecl {
Expand All @@ -26,5 +27,6 @@ buildPecl {
homepage = "https://github.com/grpc/grpc/tree/master/src/php/ext/grpc";
license = lib.licenses.asl20;
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
8 changes: 6 additions & 2 deletions pkgs/development/php-packages/igbinary/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ buildPecl, lib }:

{
buildPecl,
lib,
php,
}:
buildPecl {
pname = "igbinary";
version = "3.2.14";
Expand All @@ -17,5 +20,6 @@ buildPecl {
homepage = "https://github.com/igbinary/igbinary/";
license = lib.licenses.bsd3;
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
1 change: 1 addition & 0 deletions pkgs/development/php-packages/ioncube-loader/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ stdenv.mkDerivation {
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ neverbehave ];
broken = lib.versionAtLeast php.version "8.5";
platforms = [
"x86_64-linux"
"aarch64-linux"
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/php-packages/memcache/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ buildPecl rec {
homepage = "https://github.com/websupport-sk/pecl-memcache";
maintainers = [ lib.maintainers.krzaczek ];
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
2 changes: 1 addition & 1 deletion pkgs/development/php-packages/openswoole/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ buildPecl {
You can use the sync or async, Coroutine API to write whole applications or create thousands of light weight Coroutines within one Linux process.
'';
teams = [ lib.teams.php ];
broken = lib.versionOlder php.version "8.2";
broken = lib.versionOlder php.version "8.2" || lib.versionAtLeast php.version "8.5";
};
}
1 change: 1 addition & 0 deletions pkgs/development/php-packages/pdo_sqlsrv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ buildPecl {
license = lib.licenses.mit;
homepage = "https://github.com/Microsoft/msphpsql";
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
1 change: 1 addition & 0 deletions pkgs/development/php-packages/phalcon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ buildPecl rec {
homepage = "https://phalcon.io";
maintainers = [ lib.maintainers.krzaczek ];
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
9 changes: 9 additions & 0 deletions pkgs/development/php-packages/rrd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
lib,
pkg-config,
rrdtool,
fetchpatch,
}:

buildPecl {
Expand All @@ -19,6 +20,14 @@ buildPecl {
pkg-config
];

patches = [
# PHP 8.5 compatibility patch
(fetchpatch {
url = "https://github.com/php/pecl-processing-rrd/pull/4/commits/dd4856dc89499a0141b1710e791f0e1096c7b244.patch";
hash = "sha256-ES+cMhMBUubFB5TpTZzzKKfEK2cY737z7zCuNy4XF8Y=";
})
];

# Fix GCC 14 build.
# from incompatible pointer type [-Wincompatible-pointer-types
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/php-packages/swoole/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ buildPecl {
homepage = "https://www.swoole.com";
license = lib.licenses.asl20;
teams = [ lib.teams.php ];
broken = lib.versionAtLeast php.version "8.5";
};
}
10 changes: 10 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5721,6 +5721,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;
Expand Down
50 changes: 28 additions & 22 deletions pkgs/top-level/php-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,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";
Expand Down Expand Up @@ -572,28 +576,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 ];
Expand Down Expand Up @@ -828,6 +810,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:
Expand Down
Loading