From 536658f68226f0d11a4c24e2eefd87fbf49067f8 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 24 Aug 2024 01:27:00 +0200 Subject: [PATCH] php84: init at 8.4.0beta3 --- .github/workflows/build.yaml | 1 + README.md | 1 + flake.nix | 2 +- pkgs/package-overrides.nix | 29 ++++++++++++++++++++++++++++- pkgs/phps.nix | 4 ++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 79fbfb35..1c9d2795 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,7 @@ jobs: strategy: matrix: php: + - branch: '8.4' - branch: '8.3' - branch: '8.2' - branch: '8.1' diff --git a/README.md b/README.md index 6fed4bd4..02b98130 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ The following versions are currently available: - `php81` - `php82` - `php83` +- `php84` There is also a `php` package which is the alias of the default PHP version in Nixpkgs. diff --git a/flake.nix b/flake.nix index c55dac3f..8cd2db03 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ }; in rec { packages = { - inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83; + inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83 php84; }; checks = import ./checks.nix { diff --git a/pkgs/package-overrides.nix b/pkgs/package-overrides.nix index 634187ed..39882fa2 100644 --- a/pkgs/package-overrides.nix +++ b/pkgs/package-overrides.nix @@ -708,6 +708,16 @@ in } // lib.optionalAttrs (lib.versionOlder prev.php.version "7.2" && pkgs.stdenv.cc.isClang) { NIX_CFLAGS_COMPILE = (attrs.NIX_CFLAGS_COMPILE or "") + " -Wno-implicit-function-declaration -Wno-int-conversion"; }) + else if lib.versionAtLeast prev.php.version "8.4" then + prev.extensions.redis.overrideAttrs (attrs: { + patches = [ + # Fix build with PHP 8.4. + (pkgs.fetchpatch { + url = "https://github.com/phpredis/phpredis/commit/a51215ce2b22bcd1f506780c35b6833471e0b8cb.patch"; + hash = "sha256-DoGPMyuI/IZdF+8jG5faoyG2aM+WDz0obH6S7HoOMX8="; + }) + ]; + }) else prev.extensions.redis; @@ -840,7 +850,24 @@ in xdebug = # xdebug versions were determined using https://xdebug.org/docs/compat - if lib.versionAtLeast prev.php.version "8.0" then + if lib.versionAtLeast prev.php.version "8.4" then + prev.extensions.xdebug.overrideAttrs (attrs: { + name = "xdebug-3.4.0alpha1"; + version = "3.4.0alpha1"; + src = pkgs.fetchurl { + url = "https://xdebug.org/files/xdebug-3.4.0alpha1.tgz"; + hash = "sha256-S4oizwlhom50uV+ToV6ctdWka8d2CKnAPb2YmWOytOc="; + }; + + patches = [ + # Fix missing ZEND_EXIT + (pkgs.fetchpatch { + url = "https://github.com/xdebug/xdebug/commit/6ecd35f898e67cbe7f9257e7cb3a4c602a3dc8ec.patch"; + hash = "sha256-IYc1KKPBYek4AXEijoM9RaTwp51J0Gz/CQ1HgmTct3Q="; + }) + ]; + }) + else if lib.versionAtLeast prev.php.version "8.0" then prev.extensions.xdebug else if lib.versionAtLeast prev.php.version "7.2" then prev.extensions.xdebug.overrideAttrs (attrs: { diff --git a/pkgs/phps.nix b/pkgs/phps.nix index 49f6c27d..c53023b2 100644 --- a/pkgs/phps.nix +++ b/pkgs/phps.nix @@ -164,4 +164,8 @@ in php83 = prev.php83.override { inherit packageOverrides; }; + + php84 = prev.php84.override { + inherit packageOverrides; + }; }