Skip to content

Commit 55c8f33

Browse files
committed
Fix tokenizer extension compilation.
1 parent c220ea0 commit 55c8f33

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

pkgs/package-overrides.nix

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,9 @@ in
575575
ourPatches ++ upstreamPatches;
576576

577577
nativeBuildInputs = attrs.nativeBuildInputs ++ [
578+
# Tarballs ship pre-generated parser files.
578579
pkgs.bison
580+
pkgs.flex
579581
];
580582

581583
postPatch = ''
@@ -720,22 +722,22 @@ in
720722
patchName patch == "fix-tokenizer-php81.patch" -> lib.versionAtLeast prev.php.version "8.1"
721723
)
722724
(attrs.patches or []);
723-
});
724725

725-
tokenizer = prev.extensions.tokenizer.overrideAttrs (attrs: {
726-
patches = builtins.filter
727-
(patch:
728-
# The patch do not apply to PHP < 8.1
729-
patchName patch == "fix-tokenizer-php81.patch" -> lib.versionAtLeast prev.php.version "8.1"
730-
)
731-
(attrs.patches or []);
732-
733-
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ lib.optionals isBuiltFromGit [
726+
nativeBuildInputs = attrs.nativeBuildInputs ++ [
734727
# Tarballs ship pre-generated parser files.
735728
pkgs.bison
736729
pkgs.flex
737730
];
738731

732+
postPatch = ''
733+
echo '
734+
# TODO: Add explanation here.
735+
# See https://github.com/fossar/nix-phps/pull/104#issuecomment-1113964195
736+
PHP_PROG_BISON([3.0.0])
737+
PHP_PROG_RE2C([0.13.4])
738+
' | cat - ext/tokenizer/config.m4 > ext/tokenizer/config.m4.tmp
739+
mv ext/tokenizer/config.m4{.tmp,}
740+
'';
739741
});
740742

741743
wddx =

0 commit comments

Comments
 (0)