From 52def9e3f3ce94fb33f2561b6a978b58a1a456e7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 19 Feb 2020 11:20:56 +0100 Subject: better workaround to https://bugs.php.net/78465 --- gmagick-bug78465.patch | 38 ++++++++++++++++++++++++++------------ php-pecl-gmagick.spec | 13 ++++++++----- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/gmagick-bug78465.patch b/gmagick-bug78465.patch index c61f9b9..41c27a2 100644 --- a/gmagick-bug78465.patch +++ b/gmagick-bug78465.patch @@ -1,15 +1,29 @@ Workaround to https://bugs.php.net/78465 -diff --git a/gmagick.c b/gmagick.c -index 27ec8cc..2df8f5e 100644 ---- a/gmagick.c -+++ b/gmagick.c -@@ -1722,6 +1722,8 @@ PHP_MINIT_FUNCTION(gmagick) - PHP_MSHUTDOWN_FUNCTION(gmagick) - { - DestroyMagick(); -+ usleep(4242); -+ - return SUCCESS; + +diff -up ./gmagick.c.old ./gmagick.c +--- ./gmagick.c.old 2020-02-19 11:10:43.388127352 +0100 ++++ ./gmagick.c 2020-02-19 11:10:48.691101111 +0100 +@@ -1742,6 +1742,13 @@ PHP_MINFO_FUNCTION(gmagick) + php_info_print_table_end(); } - /* }}} */ + ++/* {{{ PHP_MINFO_FUNCTION(gmagick) ++*/ ++PHP_RINIT_FUNCTION(gmagick) ++{ ++ MagickSetResourceLimit(ThreadsResource, 1); ++} ++ + /* {{{ zend_module_entry gmagick_module_entry + */ + zend_module_entry gmagick_module_entry = +@@ -1751,7 +1758,7 @@ zend_module_entry gmagick_module_entry = + php_gmagick_functions, /* Functions */ + PHP_MINIT(gmagick), /* MINIT */ + PHP_MSHUTDOWN(gmagick), /* MSHUTDOWN */ +- NULL, /* RINIT */ ++ PHP_RINIT(gmagick), /* RINIT */ + NULL, /* RSHUTDOWN */ + PHP_MINFO(gmagick), /* MINFO */ + PHP_GMAGICK_VERSION, /* Version */ diff --git a/php-pecl-gmagick.spec b/php-pecl-gmagick.spec index aacbc95..3fb1f49 100644 --- a/php-pecl-gmagick.spec +++ b/php-pecl-gmagick.spec @@ -1,6 +1,6 @@ # spec file for php-pecl-gmagick # -# Copyright (c) 2010-2019 Remi Collet +# Copyright (c) 2010-2020 Remi Collet # Copyright (c) 2009-2010 Pavel Alexeev # License: MIT # http://opensource.org/licenses/MIT @@ -23,10 +23,10 @@ Summary: Provides a wrapper to the GraphicsMagick library Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP -URL: http://pecl.php.net/package/%{pecl_name} -Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +URL: https://pecl.php.net/package/%{pecl_name} +Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz Patch0: %{pecl_name}-bug78465.patch @@ -175,7 +175,7 @@ fi %check -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 7 # see https://bugzilla.redhat.com/1530057 rm ?TS/tests/gmagick-006-annotateimage.phpt rm ?TS/tests/gmagickdraw-003-annotate.phpt @@ -227,6 +227,9 @@ export TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" %changelog +* Wed Feb 19 2020 Remi Collet - 2.0.5~RC1-7 +- better workaround to https://bugs.php.net/78465 + * Tue Sep 03 2019 Remi Collet - 2.0.5~RC1-6 - rebuild for 7.4.0RC1 -- cgit