Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php-imagick: Update for PHP84 and IM7 #27588

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions php/php-imagick/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories-append graphics
maintainers {ryandesign @ryandesign} openmaintainer
license PHP-3.01

php.branches 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
php.branches 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
php.pecl yes

description PHP extension to create and modify images with \
Expand All @@ -20,7 +20,7 @@ long_description Imagick is a native PHP extension for creating and \
if {[vercmp ${php.branch} >= 5.4]} {
epoch 1
version 3.7.0
revision 1
revision 2
checksums rmd160 60d5c6cc154b65bdfd31be6980633ff1e659bc73 \
sha256 5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e \
size 360138
Expand All @@ -29,7 +29,7 @@ if {[vercmp ${php.branch} >= 5.4]} {
# https://pecl.php.net/package-info.php?package=imagick&version=3.4.0RC1
epoch 2
version 3.3.0
revision 1
revision 2
checksums rmd160 5746dc20ed455049a6eb5cea8dfe2b6c702c8f7c \
sha256 bd69ebadcedda1d87592325b893fa78a5710a0ca7307f8e18c5e593949b1db2d \
size 179978
Expand All @@ -39,9 +39,14 @@ if {${name} ne ${subport}} {
depends_build-append \
path:bin/pkg-config:pkgconfig

depends_lib-append port:ImageMagick
depends_lib-append port:ImageMagick7

# Temporary, imagick 3.7.0, remove when fixed in new upstream version.
# Fix removed "php_strtolower" for PHP 8.4
# https://github.com/Imagick/imagick/pull/690
patchfiles-append patch-imagick_c.strtolower.diff

configure.args --with-imagick=${prefix}
configure.args --with-imagick=${prefix}/lib/ImageMagick7

post-destroot {
set docdir ${prefix}/share/doc/${subport}
Expand Down
32 changes: 32 additions & 0 deletions php/php-imagick/files/patch-imagick_c.strtolower.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Fix removed "php_strtolower" for PHP 8.4
# https://github.com/Imagick/imagick/pull/690

--- imagick.c.orig 2022-01-11 08:23:47
+++ imagick.c 2025-02-06 09:51:27
@@ -603,7 +603,7 @@
if (format) {
retval = rv;
ZVAL_STRING(retval, format);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
@@ -676,7 +676,7 @@
if (format) {
retval = rv;
ZVAL_STRING(retval, format);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
@@ -759,7 +759,7 @@

if (format) {
ZVAL_STRING(retval, format, 1);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
ZVAL_STRING(retval, "", 1);
Loading