Skip to content

Commit

Permalink
Fix tokenizer extension compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 7, 2023
1 parent 661159d commit 562619b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkgs/package-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ in
ourPatches ++ upstreamPatches;

nativeBuildInputs = attrs.nativeBuildInputs ++ [
# Tarballs ship pre-generated parser files.
pkgs.bison
pkgs.flex
];

postPatch = ''
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 562619b

Please sign in to comment.