summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-09-30 09:05:03 +0200
committerRemi Collet <remi@php.net>2024-09-30 09:05:03 +0200
commit58a9c96b46b5622614150bec697ee0ceef3dfe5f (patch)
tree314daec50018e0867ecbc684e21396527cd94f6f
parentafb38cb0ea3bbf55398e1336339b33cfd19049a8 (diff)
fix PHP 8.4 build using patch fromHEADmaster
https://github.com/php/pecl-xml-xmldiff/pull/2
-rw-r--r--2.patch24
-rw-r--r--php-pecl-xmldiff.spec50
2 files changed, 45 insertions, 29 deletions
diff --git a/2.patch b/2.patch
new file mode 100644
index 0000000..546b936
--- /dev/null
+++ b/2.patch
@@ -0,0 +1,24 @@
+From 6113283a3c2c44075eada797e5c294e185e09943 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 30 Sep 2024 08:53:27 +0200
+Subject: [PATCH] Fix DOM_RET_OBJ calls for 8.4
+
+---
+ php_xmldiff.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/php_xmldiff.h b/php_xmldiff.h
+index 9ab2d08..c9be5c7 100644
+--- a/php_xmldiff.h
++++ b/php_xmldiff.h
+@@ -190,7 +190,9 @@ php_xmldiff_do_diff_memory(const char *from, size_t from_len, const char *to, si
+ PHP_XMLDIFF_API xmlChar *
+ php_xmldiff_do_merge_memory(const char *src, size_t src_len, const char *diff, size_t diff_len, struct ze_xmldiff_obj *zxo TSRMLS_DC);
+
+-#if PHP_MAJOR_VERSION >= 7 || PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3
++#if PHP_MAJOR_VERSION > 8 || PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION > 3
++# define XMLDIFF_DOM_RET_OBJ(obj, ret, domobject) DOM_RET_OBJ(obj, domobject)
++#elif PHP_MAJOR_VERSION >= 7 || PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3
+ # define XMLDIFF_DOM_RET_OBJ DOM_RET_OBJ
+ #elif PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION > 6
+ # define XMLDIFF_DOM_RET_OBJ DOM_RET_OBJ_EX
diff --git a/php-pecl-xmldiff.spec b/php-pecl-xmldiff.spec
index 5b3fe74..7f8d9c1 100644
--- a/php-pecl-xmldiff.spec
+++ b/php-pecl-xmldiff.spec
@@ -1,7 +1,7 @@
# remirepo spec file for php-pecl-xmldiff
#
-# Copyright (c) 2013-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2013-2024 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@@ -23,11 +23,13 @@
Summary: XML diff and merge
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.1.3
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: 2.patch
+
BuildRequires: %{?dtsprefix}gcc
BuildRequires: make
BuildRequires: %{?scl_prefix}php-devel
@@ -72,10 +74,12 @@ These are the files needed to compile programs using %{name}.
%setup -q -c
sed -e '/name="diffmark/d' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
# drop bundled library to ensure it is not used
rm -rf diffmark
@@ -105,13 +109,16 @@ EOF
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure \
--with-libdiffmark \
--with-libdir=%{_lib} \
--with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+
+%make_build
%if %{with_zts}
cd ../ZTS
@@ -119,14 +126,15 @@ cd ../ZTS
--with-libdiffmark \
--with-libdir=%{_lib} \
--with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -135,7 +143,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -149,26 +157,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
done
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
cd %{sources}
# Minimal load test for NTS extension
@@ -199,7 +187,7 @@ REPORT_EXIT_STATUS=1 \
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -221,6 +209,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 1.1.3-4
+- fix PHP 8.4 build using patch from
+ https://github.com/php/pecl-xml-xmldiff/pull/2
+
* Wed Jul 19 2023 Remi Collet <remi@remirepo.net> - 1.1.3-3
- build out of sources tree