From 2dbf96e7cc594162706e88e01f406e27ca8ebd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Mon, 20 Dec 2021 14:09:56 +0100 Subject: [PATCH] php81Extensions.tokenizer: fix build (cherry picked from commit cf7f4c058e822ee8eeaa2120c45f04b5b460a5db) --- .../interpreters/php/fix-tokenizer-php81.patch | 12 ++++++++++++ pkgs/top-level/php-packages.nix | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/php/fix-tokenizer-php81.patch diff --git a/pkgs/development/interpreters/php/fix-tokenizer-php81.patch b/pkgs/development/interpreters/php/fix-tokenizer-php81.patch new file mode 100644 index 000000000000..b43eeefa3c28 --- /dev/null +++ b/pkgs/development/interpreters/php/fix-tokenizer-php81.patch @@ -0,0 +1,12 @@ +diff --git a/ext/tokenizer/Makefile.frag b/ext/tokenizer/Makefile.frag +index 745cbfce91..07bace6022 100644 +--- a/ext/tokenizer/Makefile.frag ++++ b/ext/tokenizer/Makefile.frag +@@ -1,5 +1,5 @@ +-$(top_srcdir)/ext/tokenizer/tokenizer_data.c: $(top_srcdir)/Zend/zend_language_parser.y ++$(top_srcdir)/tokenizer_data.c: $(top_srcdir)/../../Zend/zend_language_parser.y + @if test ! -z "$(PHP)"; then \ + $(PHP) $(srcdir)/tokenizer_data_gen.php; \ + fi; +-$(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c $(top_srcdir)/Zend/zend_language_scanner.c ++$(builddir)/tokenizer.lo: $(top_srcdir)/../../Zend/zend_language_parser.c $(top_srcdir)/../../Zend/zend_language_scanner.c diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 6426b7846f5d..f26fb015e605 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -543,7 +543,11 @@ lib.makeScope pkgs.newScope (self: with self; { { name = "sysvsem"; } { name = "sysvshm"; } { name = "tidy"; configureFlags = [ "--with-tidy=${html-tidy}" ]; doCheck = false; } - { name = "tokenizer"; } + { + name = "tokenizer"; + patches = lib.optional (lib.versionAtLeast php.version "8.1") + ../development/interpreters/php/fix-tokenizer-php81.patch; + } { name = "wddx"; buildInputs = [ libxml2 ];