aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Postnikov <apostnikov@gmail.com>2019-02-08 12:39:26 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2019-06-14 12:00:37 +0000
commit117518f431e93c091455f46b0289ce7672b6ce90 (patch)
tree97b1a6d23356896ecdeb4c0427d6698fa5be2aca
parent4a5878c18686a27acd8c5c07e0babf8c5d2494cc (diff)
downloadaports-117518f431e93c091455f46b0289ce7672b6ce90.tar.bz2
aports-117518f431e93c091455f46b0289ce7672b6ce90.tar.xz
testing/php7-tideways_xhprof: enable on x390x and arm
-rw-r--r--testing/php7-tideways_xhprof/74.patch70
-rw-r--r--testing/php7-tideways_xhprof/APKBUILD14
2 files changed, 76 insertions, 8 deletions
diff --git a/testing/php7-tideways_xhprof/74.patch b/testing/php7-tideways_xhprof/74.patch
new file mode 100644
index 0000000000..40629a85c6
--- /dev/null
+++ b/testing/php7-tideways_xhprof/74.patch
@@ -0,0 +1,70 @@
+From 520315b6b12f9cd0e1f0d5532a60d80039a25e2d Mon Sep 17 00:00:00 2001
+From: Benjamin Eberlei <kontakt@beberlei.de>
+Date: Sun, 17 Feb 2019 22:25:26 +0100
+Subject: [PATCH] Add ARM and s309 architectures to clock timing.
+
+---
+ timer.h | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/timer.h b/timer.h
+index fd535e7..9c1f2ff 100644
+--- a/timer.h
++++ b/timer.h
+@@ -38,8 +38,14 @@ static zend_always_inline uint64 current_timestamp() {
+ * @author cjiang
+ */
+ static zend_always_inline uint64 time_milliseconds(int source, double timebase_factor) {
+-#ifdef __APPLE__
++#if defined(_APPLE__)
+ return mach_absolute_time() / timebase_factor;
++#elif defined(__s390__) // Covers both s390 and s390x.
++ uint64_t tsc;
++ // Return the CPU clock.
++ asm("stck %0" : "=Q" (tsc) : : "cc");
++
++ return tsc;
+ #elif defined(PHP_WIN32)
+
+ LARGE_INTEGER count;
+@@ -49,12 +55,14 @@ static zend_always_inline uint64 time_milliseconds(int source, double timebase_f
+ }
+
+ return (double)(count.QuadPart) / timebase_factor;
+-#else
++#elif defined(__x86_64__) || defined(__amd64__)
+ struct timespec s;
+ uint32 a, d;
+ uint64 val;
+-#if defined(__i386__)
++#elif defined(__i386__)
+ int64_t ret;
++#elif defined(__ARM_ARCH)
++ struct timeval tv;
+ #endif
+
+ switch (source) {
+@@ -84,17 +92,19 @@ static zend_always_inline uint64 time_milliseconds(int source, double timebase_f
+ #elif defined(__x86_64__) || defined(__amd64__)
+ asm volatile("rdtsc" : "=a" (a), "=d" (d));
+ (val) = ((uint64)a) | (((uint64)d)<<32);
++ return val / timebase_factor;
+ #elif defined(__powerpc__) || defined(__ppc__)
+ asm volatile ("mftb %0" : "=r" (val));
++ return val / timebase_factor;
++#elif defined(__ARM_ARCH)
++ gettimeofday(&tv, NULL);
++ return (tv.tv_sec) * 1000000 + tv.tv_usec;
+ #else
+-#error You need to define CycleTimer for your OS and CPU
++ return 0;
+ #endif
+- return val / timebase_factor;
+-
+ default:
+ return 0;
+ }
+-#endif
+ }
+
+ /**
diff --git a/testing/php7-tideways_xhprof/APKBUILD b/testing/php7-tideways_xhprof/APKBUILD
index 06cd28ed8b..a9944b0b64 100644
--- a/testing/php7-tideways_xhprof/APKBUILD
+++ b/testing/php7-tideways_xhprof/APKBUILD
@@ -5,19 +5,19 @@ _pkgext=tideways_xhprof
_pkgreal=php-xhprof-extension
pkgver=5.0_beta3
_pkgver=${pkgver/_/-}
-pkgrel=2
+pkgrel=3
pkgdesc="Modern XHProf compatible Profiler for PHP 7"
url="http://tideways.io"
-arch="all !armhf !armv7 !aarch64 !s390x" # fails to build
+arch="all"
license="Apache-2.0"
depends="php7"
makedepends="php7-dev autoconf"
source="$pkgname-$pkgver.tar.gz::https://github.com/tideways/php-xhprof-extension/archive/v$_pkgver.tar.gz
- 73.patch"
+ 73.patch
+ 74.patch"
builddir="$srcdir/$_pkgreal-$_pkgver"
build() {
- cd "$builddir"
phpize7
./configure --prefix=/usr \
--with-php-config=/usr/bin/php-config7
@@ -25,13 +25,10 @@ build() {
}
check() {
- cd "$builddir"
make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}
package() {
- cd "$builddir"
-
make INSTALL_ROOT="$pkgdir/" install
install -d "$pkgdir"/etc/php7/conf.d
@@ -39,4 +36,5 @@ package() {
}
sha512sums="5b682ed8cda21236c54c3161645620ba06f14478fcf1b45684788b742e47d63419b3e3f74da7d3e376ce5fafeb215ed40d080aaac0c2a8799315f83c877e3110 php7-tideways_xhprof-5.0_beta3.tar.gz
-2dfee43f28d7872f08688b354b25c177bb16a5474d2df999be0155362998841c1afa0b5adaf41d016be8c9e50f669d0f69bd56891d4e1e4ef999b9ea2118dfa8 73.patch"
+2dfee43f28d7872f08688b354b25c177bb16a5474d2df999be0155362998841c1afa0b5adaf41d016be8c9e50f669d0f69bd56891d4e1e4ef999b9ea2118dfa8 73.patch
+202c2f343d5b52479407b7e74e3fb6e9c7db7886fc1e72818ce9f00c4fab1934f1dee94829221a354caaed63299b9d0ca6c477dae9b3aeb5d68381abdcb6ba78 74.patch"