aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Postnikov <apostnikov@gmail.com>2022-06-10 13:11:54 +0300
committerAndy Postnikov <apostnikov@gmail.com>2022-06-10 10:23:03 +0000
commit5530cfbddbfd102d81fdd33a75db25acd6d7c36b (patch)
treefbf5db56e3676cac556cb18d5fae7aadf6edebf8
parentdca24f7d2a267c504b80022878a64acd9cd97831 (diff)
testing/php82-pecl-xhprof: new aport
-rw-r--r--testing/php82-pecl-xhprof/APKBUILD60
-rw-r--r--testing/php82-pecl-xhprof/fix-test.patch29
2 files changed, 89 insertions, 0 deletions
diff --git a/testing/php82-pecl-xhprof/APKBUILD b/testing/php82-pecl-xhprof/APKBUILD
new file mode 100644
index 00000000000..06e55db9467
--- /dev/null
+++ b/testing/php82-pecl-xhprof/APKBUILD
@@ -0,0 +1,60 @@
+# Contributor: Andy Postnikov <apostnikov@gmail.com>
+# Maintainer: Andy Postnikov <apostnikov@gmail.com>
+
+pkgname=php82-pecl-xhprof
+_extname=xhprof
+pkgver=2.3.5
+pkgrel=0
+pkgdesc="A Hierarchical Profiler for PHP 8.1 - PECL"
+url="https://pecl.php.net/package/xhprof"
+arch="all"
+license="Apache-2.0"
+depends="php82-common"
+makedepends="php82-dev"
+_assetsdepends="php82-ctype graphviz ghostscript-fonts"
+subpackages="$pkgname-assets::noarch"
+source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz
+ fix-test.patch
+ "
+builddir="$srcdir/$_extname-$pkgver/extension"
+provides="php82-xhprof=$pkgver-r$pkgrel" # for backward compatibility
+replaces="php82-xhprof" # for backward compatibility
+
+build() {
+ phpize82
+ ./configure --with-php-config=php-config82
+ make
+}
+
+check() {
+ [ $CARCH = s390x ] && rm -fr tests/xhprof_005.phpt # sleeping longer in CI
+ make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TESTS=--show-diff test
+}
+
+package() {
+ make INSTALL_ROOT="$pkgdir" install
+ local _confdir="$pkgdir"/etc/php82/conf.d
+ install -d $_confdir
+ cat > $_confdir/$_extname.ini <<-EOF
+ extension=$_extname
+ xhprof.output_dir=/tmp
+ EOF
+}
+
+assets() {
+ pkgdesc="A Hierarchical Profiler for PHP (UI assets)"
+ depends="$_assetsdepends"
+ provides="php82-xhprof-assets=$pkgver-r$pkgrel" # for backward compatibility
+ replaces="php82-xhprof-assets" # for backward compatibility
+
+ local _assetsdir="$subpkgdir"/usr/share/php82/xhprof
+ install -d $_assetsdir
+ cp -R "$builddir"/../xhprof_lib $_assetsdir
+ cp -R "$builddir"/../xhprof_html $_assetsdir
+ cp -R "$builddir"/../examples $_assetsdir
+}
+
+sha512sums="
+50ae6fb8d63ac8354b7887daecd1882f33e616cd1ef165b54d51f26fa93d2827f621e89d0d583979c453af5d66a83ddcbf0eb2d462df74ebb422294e601268f4 php-pecl-xhprof-2.3.5.tgz
+3716320192fbbebd9668eb0163604dafef1abd8a4ef9b881ac1eaf6037ee01b7ef7ec4c76dd2182e9a96d75069d6ebf89638d19061ee79f5b95cb8c2e2b01a40 fix-test.patch
+"
diff --git a/testing/php82-pecl-xhprof/fix-test.patch b/testing/php82-pecl-xhprof/fix-test.patch
new file mode 100644
index 00000000000..6fb69c08efd
--- /dev/null
+++ b/testing/php82-pecl-xhprof/fix-test.patch
@@ -0,0 +1,29 @@
+Patch-Source: https://github.com/longxinH/xhprof/pull/66
+
+diff --git a/extension/tests/xhprof_005.phpt b/extension/tests/xhprof_005.phpt
+index 5188257..9c2429a 100644
+--- a/tests/xhprof_005.phpt
++++ b/tests/xhprof_005.phpt
+@@ -49,7 +49,7 @@ $output = xhprof_disable();
+
+ function verify($expected, $actual, $description) {
+
+- echo "Verifying ${description}...\n";
++ echo "Verifying {$description}...\n";
+
+ // 25% tolerance
+ $range_low = ($expected * 0.75);
+@@ -57,10 +57,10 @@ function verify($expected, $actual, $description) {
+
+ if (($actual < $range_low) ||
+ ($actual > $range_high)) {
+- echo "Failed ${description}. Expected: ${expected} microsecs. ".
+- "Actual: ${actual} microsecs.\n";
++ echo "Failed {$description}. Expected: {$expected} microsecs. ".
++ "Actual: {$actual} microsecs.\n";
+ } else {
+- echo "OK: ${description}\n";
++ echo "OK: {$description}\n";
+ }
+ echo "-------------\n";
+ }