# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php7-tideways_xhprof
_pkgext=tideways_xhprof
_pkgreal=php-xhprof-extension
pkgver=5.0_beta2
_pkgver=${pkgver/_/-}
pkgrel=0
pkgdesc="Modern XHProf compatible Profiler for PHP 7"
url="http://tideways.io"
arch="all !armhf !aarch64"  # fails to build
license="Apache-2.0"
depends="php7"
makedepends="php7-dev autoconf"
source="$pkgname-$pkgver.tar.gz::https://github.com/tideways/$_pkgreal/archive/v$_pkgver.tar.gz
	timer_ppc64le.patch"
builddir="$srcdir/$_pkgreal-$_pkgver"

build() {
	cd "$builddir"
	phpize7
	./configure --prefix=/usr \
		--with-php-config=/usr/bin/php-config7
	make
}

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
	echo "extension=$_pkgext.so" > "$pkgdir"/etc/php7/conf.d/$_pkgext.ini
}

sha512sums="1e42589b81f39272cf62a058e1ecd82532b076bebe583d13b797d448891ff615aedf1e990785fbba7302daa34a977bf748cf2deaaf4fd334af800a556849334c  php7-tideways_xhprof-5.0_beta2.tar.gz
62f09c950a5b85efd87159e9e747298fd7c9b2bbec060745adf120c5cf5748e4cdfa4625c8b49e15f9905bf3833dab91f81a297e5a68fbb9e3778025846c12b6  timer_ppc64le.patch"
