aboutsummaryrefslogtreecommitdiffstats
path: root/community/php7-pecl-msgpack/APKBUILD
blob: 0570176dfc15c804bc61fd24deea7959a5b829ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-msgpack
_pkgreal=msgpack
pkgver=2.0.3
pkgrel=1
pkgdesc="PHP extension provides API for communicating with MessagePack serialization - PECL"
url="https://pecl.php.net/package/msgpack"
arch="all !armv7" # tests fails on armv7
license="PHP"
depends="php7-session php7-sockets"
makedepends="php7-dev autoconf re2c"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz
	7c1eb7f70b82bcf611bebc9a9cfd88d5832443a1.patch
	"
# Patch skips broken tests https://github.com/msgpack/msgpack-php/issues/123
builddir="$srcdir"/$_pkgreal-$pkgver
provides="php7-msgpack=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-msgpack" # for backward compatibility

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

check() {
	cd "$builddir"
	# Tests require session and sockets extensions which are not bundled
	sed -i 's#PHP_TEST_SHARED_EXTENSIONS =  `#PHP_TEST_SHARED_EXTENSIONS = -d extension=/usr/lib/php7/modules/session.so -d extension=/usr/lib/php7/modules/sockets.so `#' Makefile
	case "$CARCH" in
		aarch64 | armv7) rm -f tests/035.phpt # https://github.com/msgpack/msgpack-php/issues/123#issuecomment-451620789 ;;
	esac
	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=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/50_$_pkgreal.ini
}

sha512sums="4eaf5d2cd50796349414d8272e210f1c8c2e82d72383f440e13d31742a75b0e2fa1f48bd916c057b4c65778bd90eace7dcc0cdb86931620963e666f3aa6905db  msgpack-2.0.3.tgz
ae8c505b64631e310020f3addf561a0c5855ebed07eaa0e4c1155dbd77a6e25a2e824d87684298d91f021cf8d028b88a6883f26c21cbea40d8acf46332dd2ce9  7c1eb7f70b82bcf611bebc9a9cfd88d5832443a1.patch"