# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php83-pecl-grpc
_extname=grpc
pkgver=1.66.0
pkgrel=0
pkgdesc="PHP 8.3 extension provide a concrete implementation of the gRPC protocol, layered over HTTP/2."
url="https://pecl.php.net/package/grpc"
arch="all !s390x !ppc64le !riscv64" # build failures
license="Apache-2.0"
_phpv=83
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev openssl-dev linux-headers"
source="
	php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz
	boringssl.patch
	"
builddir="$srcdir"/$_extname-$pkgver

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

check() {
	# Test suite is not a part of pecl release.
	$_php -d extension=modules/$_extname.so --ri $_extname
}

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

sha512sums="
50b2a491607a815e249ec1ab7e5252709092579dda6ac55c80169afd8699bf5f8e294603b8eea04d30cb37af21f68590ec572c58faae6bab2e7c7844f98a5da4  php-pecl-grpc-1.66.0.tgz
6b551439ad5fd513720f1a267dab743b1c261f1662dd7a364080ec5e38a41eaf402e8950c8d8a5c3ef49297be8954f10d1ae9414da3ebce96a2dc8d87bee6bfd  boringssl.patch
"
