summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-11-29 08:29:41 +0100
committerRemi Collet <remi@php.net>2022-11-29 08:29:41 +0100
commit0ca52cb424241b9542db58a940ba0b08679f50a2 (patch)
treee43dc2bd77efc318c5971b2ee4b850a6487a2609
parent687b033847a5d483dfb56a2fc423c2a362ddab19 (diff)
add upstream patch for https://github.com/jbboehr/php-handlebars/issues/77
-rw-r--r--php-pecl-handlebars.spec49
-rw-r--r--upstream.patch23
2 files changed, 31 insertions, 41 deletions
diff --git a/php-pecl-handlebars.spec b/php-pecl-handlebars.spec
index fe771ec..33fb80d 100644
--- a/php-pecl-handlebars.spec
+++ b/php-pecl-handlebars.spec
@@ -23,11 +23,13 @@
Summary: Handlebars templating language
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: upstream.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.2
@@ -74,6 +76,8 @@ mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
cd NTS
+%patch0 -p1 -b .up
+
# Honours RPM build options
sed -e '/ LDFLAGS=/d;/ CFLAGS=/d;' -i config.m4
@@ -195,46 +199,6 @@ OPT="-q -P --show-diff"
OPT="$OPT %{?_smp_mflags}"
%endif
-%if "%{php_version}" >= "8.1"
-rm ../?TS/tests/handlebars/export/helpers/050.phpt
-rm ../?TS/tests/handlebars/export/helpers/051.phpt
-rm ../?TS/tests/handlebars/export/helpers/053.phpt
-rm ../?TS/tests/handlebars/export/helpers/054.phpt
-rm ../?TS/tests/handlebars/export/helpers/055.phpt
-rm ../?TS/tests/handlebars/export/helpers/056.phpt
-rm ../?TS/tests/handlebars/export/helpers/064.phpt
-rm ../?TS/tests/handlebars/export/partials/007.phpt
-rm ../?TS/tests/handlebars/export/partials/008.phpt
-rm ../?TS/tests/handlebars/export/partials/054.phpt
-rm ../?TS/tests/handlebars/export/strict/005.phpt
-rm ../?TS/tests/handlebars/export/string-params/001.phpt
-rm ../?TS/tests/handlebars/export/string-params/002.phpt
-rm ../?TS/tests/handlebars/export/string-params/003.phpt
-rm ../?TS/tests/handlebars/export/string-params/004.phpt
-rm ../?TS/tests/handlebars/export/string-params/005.phpt
-rm ../?TS/tests/handlebars/export/string-params/006.phpt
-rm ../?TS/tests/handlebars/export/string-params/007.phpt
-rm ../?TS/tests/handlebars/export/string-params/008.phpt
-rm ../?TS/tests/handlebars/export/subexpressions/015.phpt
-rm ../?TS/tests/handlebars/export/subexpressions/016.phpt
-rm ../?TS/tests/handlebars/export/track-ids/002.phpt
-rm ../?TS/tests/handlebars/export/track-ids/003.phpt
-rm ../?TS/tests/handlebars/export/track-ids/004.phpt
-rm ../?TS/tests/handlebars/export/track-ids/005.phpt
-rm ../?TS/tests/handlebars/export/track-ids/006.phpt
-rm ../?TS/tests/handlebars/export/track-ids/007.phpt
-rm ../?TS/tests/handlebars/export/track-ids/008.phpt
-rm ../?TS/tests/handlebars/export/track-ids/009.phpt
-rm ../?TS/tests/handlebars/export/track-ids/010.phpt
-rm ../?TS/tests/handlebars/export/track-ids/011.phpt
-rm ../?TS/tests/handlebars/export/track-ids/012.phpt
-rm ../?TS/tests/handlebars/export/track-ids/013.phpt
-rm ../?TS/tests/handlebars/export/track-ids/014.phpt
-rm ../?TS/tests/handlebars/export/track-ids/015.phpt
-rm ../?TS/tests/handlebars/export/track-ids/016.phpt
-rm ../?TS/tests/handlebars/export/track-ids/017.phpt
-%endif
-
# Upstream test suite
TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
@@ -282,6 +246,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue Nov 29 2022 Remi Collet <remi@remirepo.net> - 1.0.0-2
+- add upstream patch for https://github.com/jbboehr/php-handlebars/issues/77
+
* Mon Nov 28 2022 Remi Collet <remi@remirepo.net> - 1.0.0-1
- update to 1.0.0
- raise dependency on libhandlebars 1.0.0
diff --git a/upstream.patch b/upstream.patch
new file mode 100644
index 0000000..d83e053
--- /dev/null
+++ b/upstream.patch
@@ -0,0 +1,23 @@
+From 685e73633f6d529870e2d9f3bfeb1ecda6b7d705 Mon Sep 17 00:00:00 2001
+From: John Boehr <john@johnboehr.is>
+Date: Mon, 28 Nov 2022 21:16:37 -0800
+Subject: [PATCH] Fix AST failures on PHP 8.1+
+
+Resolves #77
+---
+ src/compiler.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/compiler.c b/src/compiler.c
+index 1da0de7..53eb730 100644
+--- a/src/compiler.c
++++ b/src/compiler.c
+@@ -241,7 +241,7 @@ static void php_handlebars_compile(INTERNAL_FUNCTION_PARAMETERS, short print)
+ jmp_buf buf;
+ unsigned long flags;
+
+- ZEND_PARSE_PARAMETERS_START(1, 3)
++ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STR(tmpl)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(options)