| 1 | # Maintainer: Andy Postnikov <[email protected]> |
| 2 | pkgname=php83-pecl-swoole |
| 3 | _extname=swoole |
| 4 | pkgver=6.2.2 |
| 5 | _pkgver=${pkgver/_rc/RC} |
| 6 | pkgrel=0 |
| 7 | pkgdesc="Event-driven asynchronous and concurrent networking engine with high performance for PHP 8.3 - PECL" |
| 8 | url="https://pecl.php.net/package/swoole" |
| 9 | arch="all !x86 !armv7 !armhf" # no 32-bit support |
| 10 | license="Apache-2.0" |
| 11 | _phpv=83 |
| 12 | _php=php$_phpv |
| 13 | depends=" |
| 14 | $_php-pecl-brotli |
| 15 | $_php-curl |
| 16 | $_php-mysqlnd |
| 17 | $_php-openssl |
| 18 | $_php-pdo |
| 19 | $_php-sockets |
| 20 | " |
| 21 | makedepends="$_php-dev |
| 22 | brotli-dev |
| 23 | c-ares-dev |
| 24 | curl-dev |
| 25 | linux-headers |
| 26 | libpq-dev |
| 27 | liburing-dev |
| 28 | nghttp2-dev |
| 29 | openssl-dev |
| 30 | sqlite-dev |
| 31 | " |
| 32 | source="php-pecl-$_extname-$_pkgver.tgz::https://pecl.php.net/get/$_extname-$_pkgver.tgz" |
| 33 | builddir="$srcdir"/$_extname-$_pkgver |
| 34 | subpackages="$pkgname-dev" |
| 35 | |
| 36 | case "$CARCH" in |
| 37 | ppc64le|s390x|loongarch64) makedepends="$makedepends libucontext-dev" ;; |
| 38 | esac |
| 39 | |
| 40 | build() { |
| 41 | sed -i s/OS_SHOULD_HAVE_LIBRT=1/OS_SHOULD_HAVE_LIBRT=0/ config.m4 |
| 42 | case "$CARCH" in |
| 43 | ppc64le|s390x|loongarch64) export LDFLAGS="$LDFLAGS -lucontext" ;; |
| 44 | esac |
| 45 | phpize$_phpv |
| 46 | ./configure --prefix=/usr \ |
| 47 | --with-php-config=php-config$_phpv \ |
| 48 | --with-nghttp2_dir=/usr \ |
| 49 | --enable-mysqlnd \ |
| 50 | --enable-openssl --with-openssl-dir=/usr \ |
| 51 | --enable-sockets \ |
| 52 | --enable-swoole-curl \ |
| 53 | --enable-swoole-pgsql \ |
| 54 | --enable-swoole-sqlite \ |
| 55 | --enable-brotli --with-brotli-dir=/usr \ |
| 56 | --enable-zstd \ |
| 57 | --enable-iouring \ |
| 58 | --enable-cares |
| 59 | make |
| 60 | } |
| 61 | |
| 62 | check() { |
| 63 | # needs extra services to test all suite |
| 64 | $_php -d extension=modules/swoole.so --ri swoole |
| 65 | } |
| 66 | |
| 67 | package() { |
| 68 | make INSTALL_ROOT="$pkgdir" install |
| 69 | local _confdir="$pkgdir"/etc/$_php/conf.d |
| 70 | install -d $_confdir |
| 71 | echo "extension=$_extname" > $_confdir/50_$_extname.ini |
| 72 | } |
| 73 | |
| 74 | sha512sums=" |
| 75 | e6c247458e4e5ea8f16de6690687eb0460a4787f49e6b446e5e924d1244a7d36266bf54567674e09a03e0f3af8057cc90e23d21cc3323f85f8e36d60d6078a9d php-pecl-swoole-6.2.2.tgz |
| 76 | " |