From 3ee19f120e6abdc27198e25718c65a16b5c2879e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 21 Jul 2021 14:09:25 +0200 Subject: update to 3.5.1RC1 add patch for PHP 8.1.0beta1 from https://github.com/Imagick/imagick/pull/450 --- PHPINFO | 8 +-- imagick-php81.patch | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-imagick.spec | 15 ++++-- 3 files changed, 159 insertions(+), 7 deletions(-) create mode 100644 imagick-php81.patch diff --git a/PHPINFO b/PHPINFO index b189a04..3e646d6 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,12 +2,12 @@ imagick imagick module => enabled -imagick module version => 3.5.0 +imagick module version => 3.5.1RC1 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel -Imagick compiled with ImageMagick version => ImageMagick 7.1.0-2 Q16 x86_64 2021-06-25 https://imagemagick.org -Imagick using ImageMagick library version => ImageMagick 7.1.0-2 Q16 x86_64 2021-06-25 https://imagemagick.org +Imagick compiled with ImageMagick version => ImageMagick 7.1.0-4 Q16 x86_64 2021-07-18 https://imagemagick.org +Imagick using ImageMagick library version => ImageMagick 7.1.0-4 Q16 x86_64 2021-07-18 https://imagemagick.org ImageMagick copyright => (C) 1999-2021 ImageMagick Studio LLC -ImageMagick release date => 2021-06-25 +ImageMagick release date => 2021-07-18 ImageMagick number of supported formats: => 259 ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV diff --git a/imagick-php81.patch b/imagick-php81.patch new file mode 100644 index 0000000..86c71ae --- /dev/null +++ b/imagick-php81.patch @@ -0,0 +1,143 @@ +From 28508a8b376a866a653ae4fba5d920d8277c83a3 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 21 Jul 2021 10:53:38 +0200 +Subject: [PATCH] fix for PHP 8.1.0beta1 + +--- + Imagick.stub.php | 12 ++++++++---- + ImagickPixelIterator.stub.php | 14 +++++++++----- + ImagickPixelIterator_arginfo.h | 5 +++-- + Imagick_arginfo.h | 5 +++-- + regen_arginfo.sh | 4 ++-- + shim_php7_to_php8.h | 7 ++++++- + 6 files changed, 31 insertions(+), 16 deletions(-) + +diff --git a/Imagick.stub.php b/Imagick.stub.php +index b1189b64..7fe3ed82 100644 +--- a/Imagick.stub.php ++++ b/Imagick.stub.php +@@ -1223,11 +1223,15 @@ public function key(): int {} + //# endif + //#endif + +- /** @alias Imagick::nextImage */ +- public function next(): bool {} ++ /** @alias Imagick::nextImage ++ * @tentative-return-type ++ */ ++ public function next(): void {} + +- /** @alias Imagick::setFirstIterator */ +- public function rewind(): bool {} ++ /** @alias Imagick::setFirstIterator ++ * @tentative-return-type ++ */ ++ public function rewind(): void {} + + public function valid(): bool {} + +diff --git a/ImagickPixelIterator.stub.php b/ImagickPixelIterator.stub.php +index 8a5b7cde..96072333 100644 +--- a/ImagickPixelIterator.stub.php ++++ b/ImagickPixelIterator.stub.php +@@ -30,11 +30,15 @@ public function getPreviousIteratorRow(): array {} + /** @alias ImagickPixelIterator::getIteratorRow */ + public function key(): int {} + +- /** @alias ImagickPixelIterator::getNextIteratorRow */ +- public function next(): array {} ++ /** @alias ImagickPixelIterator::getNextIteratorRow ++ * @tentative-return-type ++ */ ++ public function next(): void {} + +- /** @alias ImagickPixelIterator::resetIterator */ +- public function rewind(): bool {} ++ /** @alias ImagickPixelIterator::resetIterator ++ * @tentative-return-type ++ */ ++ public function rewind(): void {} + + /** @alias ImagickPixelIterator::getCurrentIteratorRow */ + public function current(): array {} +@@ -59,4 +63,4 @@ public function setIteratorRow(int $row): bool {} + public function syncIterator(): bool {} + + public function valid(): bool {} +-} +\ No newline at end of file ++} +diff --git a/ImagickPixelIterator_arginfo.h b/ImagickPixelIterator_arginfo.h +index ef20a02e..26237941 100644 +--- a/ImagickPixelIterator_arginfo.h ++++ b/ImagickPixelIterator_arginfo.h +@@ -85,9 +85,10 @@ ZEND_END_ARG_INFO() + + #define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow + +-#define arginfo_class_ImagickPixelIterator_next arginfo_class_ImagickPixelIterator_getCurrentIteratorRow ++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0) ++ZEND_END_ARG_INFO() + +-#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_clear ++#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next + + #define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow + +diff --git a/Imagick_arginfo.h b/Imagick_arginfo.h +index db2b2ee5..2df4076c 100644 +--- a/Imagick_arginfo.h ++++ b/Imagick_arginfo.h +@@ -4786,11 +4786,12 @@ ZEND_END_ARG_INFO() + #endif + + #if MagickLibVersion > 0x628 +-#define arginfo_class_Imagick_next arginfo_class_Imagick_optimizeImageLayers ++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_next, 0, 0, IS_VOID, 0) ++ZEND_END_ARG_INFO() + #endif + + #if MagickLibVersion > 0x628 +-#define arginfo_class_Imagick_rewind arginfo_class_Imagick_optimizeImageLayers ++#define arginfo_class_Imagick_rewind arginfo_class_Imagick_next + #endif + + #if MagickLibVersion > 0x628 +diff --git a/regen_arginfo.sh b/regen_arginfo.sh +index 96c24cea..1df4ade5 100755 +--- a/regen_arginfo.sh ++++ b/regen_arginfo.sh +@@ -2,9 +2,9 @@ + + VER=0$(php-config --vernum 2>/dev/null) + +-if [ $VER -lt 70100 ]; then ++if [ $VER -lt 80100 ]; then + +- echo "You need php >= 7.1 to run this script" ++ echo "You need php >= 8.1 to run this script" + + elif [ ! -f build/gen_stub.php ]; then + +diff --git a/shim_php7_to_php8.h b/shim_php7_to_php8.h +index 5f8d89b4..7c4e92c7 100644 +--- a/shim_php7_to_php8.h ++++ b/shim_php7_to_php8.h +@@ -1,5 +1,10 @@ + + ++#if PHP_VERSION_ID < 80100 ++#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ ++ ZEND_BEGIN_ARG_INFO_EX(name, return_reference, required_num_args, allow_null) ++#endif ++ + #if PHP_VERSION_ID < 80000 + // Allow the generated stubs to work on previous versions of PHP + +@@ -11,4 +16,4 @@ + + #define MAY_BE_STRING "" + +-#endif +\ No newline at end of file ++#endif diff --git a/php-pecl-imagick.spec b/php-pecl-imagick.spec index 31cae7a..5bbdc7b 100644 --- a/php-pecl-imagick.spec +++ b/php-pecl-imagick.spec @@ -34,8 +34,8 @@ %else %global ini_name 40-%{pecl_name}.ini %endif -%global upstream_version 3.5.0 -#global upstream_prever RC2 +%global upstream_version 3.5.1 +%global upstream_prever RC1 %if %{with im7} Summary: Extension to create and modify images using ImageMagick 7 @@ -49,12 +49,14 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz %endif License: PHP URL: https://pecl.php.net/package/imagick +Patch0: %{pecl_name}-php81.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel @@ -194,6 +196,8 @@ then : "Font files detected!" fi cd NTS +%patch0 -p1 -b .pr450 + : Fix permission for archive generated on Windows find . -type f -exec chmod -x {} \; @@ -361,6 +365,11 @@ cd ../ZTS %changelog +* Wed Jul 21 2021 Remi Collet - 3.5.1~RC1-1 +- update to 3.5.1RC1 +- add patch for PHP 8.1.0beta1 from + https://github.com/Imagick/imagick/pull/450 + * Thu Jun 24 2021 Remi Collet - 3.5.0-2 - add REFLECTION in package documentation -- cgit