| 1 | # Maintainer: Andy Postnikov <[email protected]> |
| 2 | pkgname=php86-pecl-xhprof |
| 3 | _extname=xhprof |
| 4 | pkgver=2.3.10 |
| 5 | pkgrel=2 |
| 6 | pkgdesc="A Hierarchical Profiler for PHP 8.6 - PECL" |
| 7 | url="https://pecl.php.net/package/xhprof" |
| 8 | arch="all" |
| 9 | license="Apache-2.0" |
| 10 | _phpv=86 |
| 11 | _php=php$_phpv |
| 12 | depends="$_php-common" |
| 13 | makedepends="$_php-dev" |
| 14 | _assetsdepends="$_php-ctype graphviz ghostscript-fonts" |
| 15 | subpackages="$pkgname-assets::noarch" |
| 16 | #source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz" |
| 17 | source="php-$_extname-$pkgver.tgz::https://github.com/longxinH/xhprof/archive/refs/tags/v$pkgver.tar.gz" |
| 18 | builddir="$srcdir/$_extname-$pkgver/extension" |
| 19 | provides="$_php-xhprof=$pkgver-r$pkgrel" # for backward compatibility |
| 20 | replaces="$_php-xhprof" # for backward compatibility |
| 21 | |
| 22 | install_if="php-$_extname php$_phpv" |
| 23 | |
| 24 | build() { |
| 25 | phpize$_phpv |
| 26 | ./configure --with-php-config=php-config$_phpv |
| 27 | make |
| 28 | } |
| 29 | |
| 30 | check() { |
| 31 | [ $CARCH = s390x ] && rm -fr tests/xhprof_005.phpt # sleeping longer in CI |
| 32 | make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TESTS=--show-diff test |
| 33 | $_php -d extension=modules/$_extname.so --ri $_extname |
| 34 | } |
| 35 | |
| 36 | package() { |
| 37 | make INSTALL_ROOT="$pkgdir" install |
| 38 | local _confdir="$pkgdir"/etc/$_php/conf.d |
| 39 | install -d $_confdir |
| 40 | cat > $_confdir/$_extname.ini <<-EOF |
| 41 | extension=$_extname |
| 42 | xhprof.output_dir=/tmp |
| 43 | EOF |
| 44 | } |
| 45 | |
| 46 | assets() { |
| 47 | pkgdesc="A Hierarchical Profiler for PHP (UI assets)" |
| 48 | depends="$_assetsdepends" |
| 49 | provides="$_php-xhprof-assets=$pkgver-r$pkgrel" # for backward compatibility |
| 50 | replaces="$_php-xhprof-assets" # for backward compatibility |
| 51 | |
| 52 | local _assetsdir="$subpkgdir"/usr/share/$_php/xhprof |
| 53 | install -d $_assetsdir |
| 54 | cp -R "$builddir"/../xhprof_lib $_assetsdir |
| 55 | cp -R "$builddir"/../xhprof_html $_assetsdir |
| 56 | cp -R "$builddir"/../examples $_assetsdir |
| 57 | } |
| 58 | |
| 59 | sha512sums=" |
| 60 | e12d3b3771e62f1e31171ded5cddada2c3827f0837aaa76fb1ea7cb74f0031a51f62290a0bfc36dd78f64066d94b25513ef354a6528d1d35f170dbc9d586f5fb php-xhprof-2.3.10.tgz |
| 61 | " |