diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b755852677560..4e3db17c525fd 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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; }; diff --git a/pkgs/development/interpreters/php/8.5.nix b/pkgs/development/interpreters/php/8.5.nix new file mode 100644 index 0000000000000..bf44a1aad7b7b --- /dev/null +++ b/pkgs/development/interpreters/php/8.5.nix @@ -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 + ] +) diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index 6eb8ec5966803..08cfabb16f126 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -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; diff --git a/pkgs/development/php-packages/grpc/default.nix b/pkgs/development/php-packages/grpc/default.nix index 5a5d261633fb6..c96c6090a0979 100644 --- a/pkgs/development/php-packages/grpc/default.nix +++ b/pkgs/development/php-packages/grpc/default.nix @@ -3,6 +3,7 @@ pkg-config, lib, grpc, + php, }: buildPecl { @@ -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"; }; } diff --git a/pkgs/development/php-packages/igbinary/default.nix b/pkgs/development/php-packages/igbinary/default.nix index a4be541075bc7..f93f16a06e03c 100644 --- a/pkgs/development/php-packages/igbinary/default.nix +++ b/pkgs/development/php-packages/igbinary/default.nix @@ -1,5 +1,8 @@ -{ buildPecl, lib }: - +{ + buildPecl, + lib, + php, +}: buildPecl { pname = "igbinary"; version = "3.2.14"; @@ -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"; }; } diff --git a/pkgs/development/php-packages/ioncube-loader/default.nix b/pkgs/development/php-packages/ioncube-loader/default.nix index 07c941094c6e0..b2cd73a9ed387 100644 --- a/pkgs/development/php-packages/ioncube-loader/default.nix +++ b/pkgs/development/php-packages/ioncube-loader/default.nix @@ -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" diff --git a/pkgs/development/php-packages/memcache/default.nix b/pkgs/development/php-packages/memcache/default.nix index 9cd31b635ee5b..e3ff44172ef71 100644 --- a/pkgs/development/php-packages/memcache/default.nix +++ b/pkgs/development/php-packages/memcache/default.nix @@ -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"; }; } diff --git a/pkgs/development/php-packages/openswoole/default.nix b/pkgs/development/php-packages/openswoole/default.nix index f46c8b6a8f9f9..2dec6017a6724 100644 --- a/pkgs/development/php-packages/openswoole/default.nix +++ b/pkgs/development/php-packages/openswoole/default.nix @@ -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"; }; } diff --git a/pkgs/development/php-packages/pdo_sqlsrv/default.nix b/pkgs/development/php-packages/pdo_sqlsrv/default.nix index b691d99487cbd..451942fe56044 100644 --- a/pkgs/development/php-packages/pdo_sqlsrv/default.nix +++ b/pkgs/development/php-packages/pdo_sqlsrv/default.nix @@ -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"; }; } diff --git a/pkgs/development/php-packages/phalcon/default.nix b/pkgs/development/php-packages/phalcon/default.nix index 1f81088f72513..94d0050da2ac5 100644 --- a/pkgs/development/php-packages/phalcon/default.nix +++ b/pkgs/development/php-packages/phalcon/default.nix @@ -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"; }; } diff --git a/pkgs/development/php-packages/rrd/default.nix b/pkgs/development/php-packages/rrd/default.nix index bdce061689b91..cc922092ec6dd 100644 --- a/pkgs/development/php-packages/rrd/default.nix +++ b/pkgs/development/php-packages/rrd/default.nix @@ -3,6 +3,7 @@ lib, pkg-config, rrdtool, + fetchpatch, }: buildPecl { @@ -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"; diff --git a/pkgs/development/php-packages/swoole/default.nix b/pkgs/development/php-packages/swoole/default.nix index bb86442b4bc22..a1a902b31f430 100644 --- a/pkgs/development/php-packages/swoole/default.nix +++ b/pkgs/development/php-packages/swoole/default.nix @@ -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"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5917942b6d27a..f327396bd0acd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index f1ec8be75759c..5e568e7412058 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -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"; @@ -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 ]; @@ -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: