# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-runkit7
_extname=runkit7
pkgver=4.0.0_alpha6
pkgrel=1
pkgdesc="PHP 8.2 extension for replace, rename, and remove user defined functions, methods, and constants - PECL"
url="https://pecl.php.net/package/runkit7"
arch="all"
license="BSD-3-Clause"
_phpv=82
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-${pkgver//_alpha/a}.tgz"
builddir="$srcdir/$_extname-${pkgver//_alpha/a}"

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=/usr/bin/php-config$_phpv
	make
}

check() {
	$_php -dextension=modules/$_extname.so --ri $_extname
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
fd54b395ab07806035d18ba4efa4337304c345d8800063755c94b0b776b254b41ed7932ca0a9e366fe8f0a8e4e184355ed2e1b3452fbe3c45e6fa28750aa956e  php-pecl-runkit7-4.0.0_alpha6.tgz
"
