diff options
-rw-r--r-- | 238.patch | 210 | ||||
-rw-r--r-- | php-pecl-zmq.spec | 49 |
2 files changed, 229 insertions, 30 deletions
diff --git a/238.patch b/238.patch new file mode 100644 index 0000000..5b945ba --- /dev/null +++ b/238.patch @@ -0,0 +1,210 @@ +From b62f2d591937b766cd3d0a0d5731d2481ac33807 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Wed, 22 Jan 2025 15:50:22 +0100 +Subject: [PATCH] Fix incomplete function prototypes + +--- + php_zmq_pollset.h | 6 +++--- + php_zmq_private.h | 20 ++++++++++---------- + zmq.c | 4 ++-- + zmq_clock.c | 2 +- + zmq_helpers.c | 4 ++-- + zmq_pollset.c | 2 +- + zmq_shared_ctx.c | 10 +++++----- + 7 files changed, 24 insertions(+), 24 deletions(-) + +diff --git a/php_zmq_pollset.h b/php_zmq_pollset.h +index 1df9c3a..9bb0af4 100644 +--- a/php_zmq_pollset.h ++++ b/php_zmq_pollset.h +@@ -40,9 +40,9 @@ + #define PHP_ZMQ_POLLSET_ERR_INVALID_TYPE -7 + + +-/** {{{ php_zmq_pollset *php_zmq_pollset_init(); ++/** {{{ php_zmq_pollset *php_zmq_pollset_init(void); + */ +-php_zmq_pollset *php_zmq_pollset_init(); ++php_zmq_pollset *php_zmq_pollset_init(void); + /* }}} */ + + /** {{{ zend_bool php_zmq_pollset_items(php_zmq_pollset *set, zval *return_value); +@@ -83,7 +83,7 @@ size_t php_zmq_pollset_num_items(php_zmq_pollset *set); + + /** {{{ void php_zmq_pollset_delete_all(php_zmq_pollset *set); + */ +-zval *php_zmq_pollset_errors(); ++zval *php_zmq_pollset_errors(php_zmq_pollset *set); + /* }}} */ + + /** {{{ void php_zmq_pollset_deinit(php_zmq_pollset **set); +diff --git a/php_zmq_private.h b/php_zmq_private.h +index 2e5cd3b..7c86376 100644 +--- a/php_zmq_private.h ++++ b/php_zmq_private.h +@@ -190,8 +190,8 @@ PHP_METHOD(zmqsocket, getsockopt); + PHP_METHOD(zmqsocket, setsockopt); + zend_bool php_zmq_device(php_zmq_device_object *intern); + +-zend_class_entry *php_zmq_socket_exception_sc_entry_get (); +-zend_class_entry *php_zmq_device_exception_sc_entry_get (); ++zend_class_entry *php_zmq_socket_exception_sc_entry_get (void); ++zend_class_entry *php_zmq_device_exception_sc_entry_get (void); + + php_stream *php_zmq_create_zmq_fd(zval *obj); + +@@ -199,30 +199,30 @@ void php_zmq_register_sockopt_constants (zend_class_entry *ce); + + typedef struct _php_zmq_clock_ctx_t php_zmq_clock_ctx_t; + +-php_zmq_clock_ctx_t *php_zmq_clock_init (); ++php_zmq_clock_ctx_t *php_zmq_clock_init (void); + + uint64_t php_zmq_clock (php_zmq_clock_ctx_t *clock_ctx); + + void php_zmq_clock_destroy (php_zmq_clock_ctx_t **clock_ctx); + +-char *php_zmq_get_libzmq_version(); ++char *php_zmq_get_libzmq_version(void); + +-zend_long php_zmq_get_libzmq_version_id(); ++zend_long php_zmq_get_libzmq_version_id(void); + + char *php_zmq_printable_func (zend_fcall_info *fci, zend_fcall_info_cache *fci_cache); + + +-zend_bool php_zmq_shared_ctx_init(); ++zend_bool php_zmq_shared_ctx_init(void); + + void php_zmq_shared_ctx_assign_to(php_zmq_context *context); + +-void php_zmq_shared_ctx_destroy(); ++void php_zmq_shared_ctx_destroy(void); + +-int php_zmq_shared_ctx_socket_count(); ++int php_zmq_shared_ctx_socket_count(void); + +-void php_zmq_shared_ctx_socket_count_incr(); ++void php_zmq_shared_ctx_socket_count_incr(void); + +-void php_zmq_shared_ctx_socket_count_decr(); ++void php_zmq_shared_ctx_socket_count_decr(void); + + + +diff --git a/zmq.c b/zmq.c +index bd2401d..1fd9736 100644 +--- a/zmq.c ++++ b/zmq.c +@@ -71,12 +71,12 @@ zend_class_entry *php_zmq_context_exception_sc_entry_get () + return php_zmq_context_exception_sc_entry; + } + +-zend_class_entry *php_zmq_socket_exception_sc_entry_get () ++zend_class_entry *php_zmq_socket_exception_sc_entry_get (void) + { + return php_zmq_socket_exception_sc_entry; + } + +-zend_class_entry *php_zmq_device_exception_sc_entry_get () ++zend_class_entry *php_zmq_device_exception_sc_entry_get (void) + { + return php_zmq_device_exception_sc_entry; + } +diff --git a/zmq_clock.c b/zmq_clock.c +index 6533297..8e6950a 100644 +--- a/zmq_clock.c ++++ b/zmq_clock.c +@@ -73,7 +73,7 @@ uint64_t s_backup_clock () + + struct _php_zmq_clock_ctx_t {}; + +-php_zmq_clock_ctx_t *php_zmq_clock_init () ++php_zmq_clock_ctx_t *php_zmq_clock_init (void) + { + return + malloc (sizeof (php_zmq_clock_ctx_t)); +diff --git a/zmq_helpers.c b/zmq_helpers.c +index dfae5a6..30c3eaa 100644 +--- a/zmq_helpers.c ++++ b/zmq_helpers.c +@@ -33,7 +33,7 @@ + + /** {{{ char *php_zmq_libzmq_version() + */ +-char *php_zmq_get_libzmq_version() ++char *php_zmq_get_libzmq_version(void) + { + char *buffer = NULL; + +@@ -47,7 +47,7 @@ char *php_zmq_get_libzmq_version() + + /** {{{ zend_long php_zmq_libzmq_version_id() + */ +-zend_long php_zmq_get_libzmq_version_id() ++zend_long php_zmq_get_libzmq_version_id(void) + { + int major = 0, minor = 0, patch = 0; + +diff --git a/zmq_pollset.c b/zmq_pollset.c +index 0bf1098..2aeb96c 100644 +--- a/zmq_pollset.c ++++ b/zmq_pollset.c +@@ -184,7 +184,7 @@ zend_string *s_create_key(zval *entry) + } + } + +-php_zmq_pollset *php_zmq_pollset_init() ++php_zmq_pollset *php_zmq_pollset_init(void) + { + php_zmq_pollset *set = ecalloc (1, sizeof(php_zmq_pollset)); + +diff --git a/zmq_shared_ctx.c b/zmq_shared_ctx.c +index 2d86d91..0672ecb 100644 +--- a/zmq_shared_ctx.c ++++ b/zmq_shared_ctx.c +@@ -136,7 +136,7 @@ void s_shared_ctx_destroy() + } + #endif + +-zend_bool php_zmq_shared_ctx_init() ++zend_bool php_zmq_shared_ctx_init(void) + { + return + s_shared_ctx_init(); +@@ -150,7 +150,7 @@ void php_zmq_shared_ctx_assign_to(php_zmq_context *context) + } + } + +-void php_zmq_shared_ctx_destroy() ++void php_zmq_shared_ctx_destroy(void) + { + if (php_zmq_shared_ctx_socket_count() > 0) { + php_error_docref(NULL, E_WARNING, "php_zmq_shared_ctx_socket_count() > 0, please report a bug"); +@@ -158,7 +158,7 @@ void php_zmq_shared_ctx_destroy() + s_shared_ctx_destroy(); + } + +-int php_zmq_shared_ctx_socket_count() ++int php_zmq_shared_ctx_socket_count(void) + { + int value = 0; + +@@ -169,7 +169,7 @@ int php_zmq_shared_ctx_socket_count() + return value; + } + +-void php_zmq_shared_ctx_socket_count_incr() ++void php_zmq_shared_ctx_socket_count_incr(void) + { + if (s_shared_ctx_lock()) { + s_ctx_socket_count++; +@@ -177,7 +177,7 @@ void php_zmq_shared_ctx_socket_count_incr() + } + } + +-void php_zmq_shared_ctx_socket_count_decr() ++void php_zmq_shared_ctx_socket_count_decr(void) + { + if (s_shared_ctx_lock()) { + s_ctx_socket_count--; diff --git a/php-pecl-zmq.spec b/php-pecl-zmq.spec index b06f407..b109434 100644 --- a/php-pecl-zmq.spec +++ b/php-pecl-zmq.spec @@ -3,9 +3,9 @@ # # Fedora spec file for php-pecl-zmq # -# Copyright (c) 2013-2023 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2013-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -26,7 +26,7 @@ Summary: ZeroMQ messaging Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 1.1.3 -Release: 18%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 19%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD-3-Clause URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz @@ -34,6 +34,7 @@ Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz Patch0: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/216.patch Patch1: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/222.patch Patch2: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/228.patch +Patch3: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/238.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -74,6 +75,7 @@ cd %{sources} %patch -P0 -p1 -b .pr216 %patch -P1 -p1 -b .pr222 %patch -P2 -p1 -b .pr228 +%patch -P3 -p1 -b .pr238 if pkg-config libzmq --atleast-version=4 then @@ -108,13 +110,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-zmq \ --with-libdir=%{_lib} \ --with-php-config=%{__phpconfig} -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS @@ -122,15 +127,15 @@ cd ../ZTS --with-zmq \ --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} @@ -139,8 +144,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 @@ -151,26 +155,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{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} @@ -217,6 +201,11 @@ export TEST_PHP_EXECUTABLE=%{__ztsphp} %changelog +* Wed Jan 22 2025 Remi Collet <remi@remirepo.net> - 1.1.3-19 +- fix build with GCC 15 using patch from + https://github.com/zeromq/php-zmq/pull/238 +- re-license spec file to CECILL-2.1 + * Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.1.3-18 - rebuild for PHP 8.3.0RC1 |