From 53951c0c1444e500585205e8b2510270b2ad188f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 23 May 2021 20:59:33 +0200 Subject: [PATCH] phpExtensions.dom: fix build ZHF #122042 --- pkgs/top-level/php-packages.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index af47529f364..0f61402bb05 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -235,7 +235,7 @@ lib.makeScope pkgs.newScope (self: with self; { (dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}") internalDeps} ''; - checkPhase = "echo n | make test"; + checkPhase = "runHook preCheck; echo n | make test; runHook postCheck"; outputs = [ "out" "dev" ]; installPhase = '' mkdir -p $out/lib/php/extensions @@ -270,6 +270,20 @@ lib.makeScope pkgs.newScope (self: with self; { { name = "dba"; } { name = "dom"; buildInputs = [ libxml2 ]; + patches = [ + # https://github.com/php/php-src/pull/7030 + (fetchpatch { + url = "https://github.com/php/php-src/commit/4cc261aa6afca2190b1b74de39c3caa462ec6f0b.patch"; + sha256 = "11qsdiwj1zmpfc2pgh6nr0sn7qa1nyjg4jwf69cgwnd57qfjcy4k"; + excludes = [ "ext/dom/tests/bug43364.phpt" "ext/dom/tests/bug80268.phpt" ]; + }) + ]; + # For some reason `patch` fails to remove these files correctly. + # Since `postPatch` is already used in `mkExtension`, we have to make it here. + preCheck = '' + rm tests/bug43364.phpt + rm tests/bug80268.phpt + ''; configureFlags = [ "--enable-dom" ] # Required to build on darwin. ++ lib.optionals (lib.versionOlder php.version "7.4") [ "--with-libxml-dir=${libxml2.dev}" ]; }