From 562619bd964e404314b4340f1753c37f7909e46c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 9 May 2022 22:09:36 +0200 Subject: [PATCH] Fix `tokenizer` extension compilation. --- pkgs/package-overrides.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/package-overrides.nix b/pkgs/package-overrides.nix index 6111c8b4..8359e6c3 100644 --- a/pkgs/package-overrides.nix +++ b/pkgs/package-overrides.nix @@ -575,7 +575,9 @@ in ourPatches ++ upstreamPatches; nativeBuildInputs = attrs.nativeBuildInputs ++ [ + # Tarballs ship pre-generated parser files. pkgs.bison + pkgs.flex ]; postPatch = '' @@ -720,22 +722,22 @@ in patchName patch == "fix-tokenizer-php81.patch" -> lib.versionAtLeast prev.php.version "8.1" ) (attrs.patches or []); - }); - tokenizer = prev.extensions.tokenizer.overrideAttrs (attrs: { - patches = builtins.filter - (patch: - # The patch do not apply to PHP < 8.1 - patchName patch == "fix-tokenizer-php81.patch" -> lib.versionAtLeast prev.php.version "8.1" - ) - (attrs.patches or []); - - nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ lib.optionals isBuiltFromGit [ + nativeBuildInputs = attrs.nativeBuildInputs ++ [ # Tarballs ship pre-generated parser files. pkgs.bison pkgs.flex ]; + postPatch = '' + echo ' + # TODO: Add explanation here. + # See https://github.com/fossar/nix-phps/pull/104#issuecomment-1113964195 + PHP_PROG_BISON([3.0.0]) + PHP_PROG_RE2C([0.13.4]) + ' | cat - ext/tokenizer/config.m4 > ext/tokenizer/config.m4.tmp + mv ext/tokenizer/config.m4{.tmp,} + ''; }); wddx =