diff --git a/community/php83-pecl-imagick/APKBUILD b/community/php83-pecl-imagick/APKBUILD index cbef63c40c2ddc3f0c1b834cf295acc47252861d..cb7caef3865e6510a4d6ec6ecfad073d92b1939e 100644 --- a/community/php83-pecl-imagick/APKBUILD +++ b/community/php83-pecl-imagick/APKBUILD @@ -2,7 +2,8 @@ # Maintainer: Andy Postnikov <apostnikov@gmail.com> pkgname=php83-pecl-imagick _extname=imagick -pkgver=3.7.0 +pkgver=3.8.0_rc2 +_pkgver=${pkgver/_rc/RC} pkgrel=0 pkgdesc="PHP 8.3 extension provides a wrapper to the ImageMagick library - PECL" url="https://pecl.php.net/package/imagick" @@ -17,10 +18,8 @@ checkdepends="ghostscript-fonts " makedepends="$_php-dev imagemagick-dev" subpackages="$pkgname-dev" -source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz - tests-316_Imagick_getImageKurtosis.patch - " -builddir="$srcdir/$_extname-$pkgver" +source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$_pkgver.tgz" +builddir="$srcdir/$_extname-$_pkgver" install_if="php-$_extname php$_phpv" @@ -47,6 +46,5 @@ package() { } sha512sums=" -c84408e4e4a0c46d979240e06d58d264c6bb21f3b95e3d434c8a21cd808f6c495fd453ef9c07b5c44dac81c6f205b6697f8ecaf1a65a86ce4e9052328a389ebe php-pecl-imagick-3.7.0.tgz -24ad7801e70c0a68a190a1adfdfafcfd3f957afbe5813a8cf459e55658413070b794cee31808415ca2d229e2bb942fad260571657018fec141d7a59c215380a3 tests-316_Imagick_getImageKurtosis.patch +f94ef037df8afb371b8b8b0cac96fc72e4719b0c73537b65ceb36ba5db10b6b172b94374b41349ffba6854fa1177344007bf528e378cb720fe562fd9d4170185 php-pecl-imagick-3.8.0_rc2.tgz " diff --git a/community/php83-pecl-imagick/tests-316_Imagick_getImageKurtosis.patch b/community/php83-pecl-imagick/tests-316_Imagick_getImageKurtosis.patch deleted file mode 100644 index 20184eefea9653a36504ad86424a3d70563b1181..0000000000000000000000000000000000000000 --- a/community/php83-pecl-imagick/tests-316_Imagick_getImageKurtosis.patch +++ /dev/null @@ -1,91 +0,0 @@ -Patch-Source: https://github.com/Imagick/imagick/commit/944b67fce68bcb5835999a149f917670555b6fcb.patch --- -From 944b67fce68bcb5835999a149f917670555b6fcb Mon Sep 17 00:00:00 2001 -From: Danack <Danack@basereality.com> -Date: Fri, 9 Feb 2024 13:59:39 +0000 -Subject: [PATCH] Improve test so that is passes. - -The underlying maths for some statistics changed: https://github.com/ImageMagick/ImageMagick/issues/6924 so the tests need to pass on both before and after maths. ---- - -diff --git a/tests/316_Imagick_getImageKurtosis.phpt b/tests/316_Imagick_getImageKurtosis.phpt -index 2618924a..61370b57 100644 ---- a/tests/316_Imagick_getImageKurtosis.phpt -+++ b/tests/316_Imagick_getImageKurtosis.phpt -@@ -14,8 +14,16 @@ function getImageKurtosis() { - $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); - $values = $imagick->getImageKurtosis(); - -- check_value($values, "kurtosis", -0.9379261035010518); -- check_value($values, "skewness", 0.4562517200972045); -+ check_value_posibilities( -+ $values, -+ "kurtosis", -+ [-0.9379261035010518, -0.70925995674921] -+ ); -+ check_value_posibilities( -+ $values, -+ "skewness", -+ [0.4562517200972045, 0.56839010636614] -+ ); - } - - getImageKurtosis() ; -diff --git a/tests/functions.inc b/tests/functions.inc -index bbd60ac0..11012864 100644 ---- a/tests/functions.inc -+++ b/tests/functions.inc -@@ -111,7 +111,10 @@ function setFontForImagickDraw(\ImagickDraw $imagickDraw) - $imagickDraw->setFont($font); - } - -- -+/** -+ * Checks that a named value exists in an array and it matches -+ * an expected value. -+ */ - function check_value(array $values, $name, $expected_value) - { - if (array_key_exists($name, $values) !== true) { -@@ -136,6 +139,41 @@ function check_value(array $values, $name, $expected_value) - } - - -+/** -+ * Checks that a named value exists in an array and it matches -+ * one of a number of expected values. -+ * This function exists because the expected values for Kurtosis can -+ * change when the underlying maths changes: https://github.com/ImageMagick/ImageMagick/issues/6924 -+ */ -+function check_value_posibilities(array $values, $name, array $expected_values) -+{ -+ if (array_key_exists($name, $values) !== true) { -+ -+ $message = "Expected key '$name' not set. Array contains:\n"; -+ $message .= var_export($values, true); -+ -+ throw new \Exception($message); -+ } -+ -+ -+ $value = $values[$name]; -+ -+ $epsilon = 0.01; -+ -+ foreach ($expected_values as $expected_value) { -+ if (($value > $expected_value - $epsilon) && ($value < $expected_value + $epsilon)) { -+ echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; -+ return; -+ } -+ } -+ -+ $expected_string = implode(", ", $expected_values); -+ -+ $message = "Value for $name doesn't match expected possibilities. Expected one of: $expected_string, actual: $value"; -+ throw new \Exception($message); -+} -+ -+ - function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon) - { - if (array_key_exists($name, $values) !== true) {