aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php7-pecl-decimal/APKBUILD
blob: 7dd8428122a9a08f5af4f8fcf9c4a941656d1118 (plain) (blame)
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
47
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php7-pecl-decimal
_pkgreal=decimal
pkgver=2.0.0
pkgrel=2
pkgdesc="Correctly-rounded arbitrary precision decimal floating-point arithmetic in PHP."
# Some tests fail until 2.0.0 is released
# https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/17821#note_140064
options="!check"
url="https://pecl.php.net/package/decimal"
arch="all !x86 !ppc64le !armv7 !armhf" # mpdecimal missing
license="MIT"
depends="php7-json"
makedepends="php7-dev mpdecimal-dev"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz
	fix-build.patch
	fix-test.patch
	fix-tests.patch"
builddir="$srcdir/$_pkgreal-$pkgver"
provides="php7-decimal=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-decimal" # for backward compatibility

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

check() {
	# waiting upstream release
	rm -f tests/Decimal/operators.phpt tests/Number/operators.phpt tests/Rational/operators.phpt
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TESTS="--show-diff" \
		test PHP_TEST_SHARED_EXTENSIONS=" \
		-d extension=/usr/lib/php7/modules/json.so \
		-d extension=modules/$_pkgreal.so"
}

package() {
	make INSTALL_ROOT="$pkgdir"/ install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/$_pkgreal.ini
}

sha512sums="765a2871af38338d1020730936d70c7d493e07c4d0fe6da5b07bf1b5f6bd7ae45239351f9202ced8f579ad1e1c909fbfede1350cc1ec85e0f4cb5f1ef8617cfe  decimal-2.0.0.tgz
8db95e40c19806d2fbb88e8132a3f679f5856ce73548d0b72bb1c806fdb59bfadad0260dd89962f4ac4c41b388d98e8ec988b5bd989e582c9cffc521e832b6d7  fix-build.patch
36d24c2c2fd310d64f6c326ac5241c4732d323608d6dfc7e76d906cd30282e94bdbc5851f1de3e4e2056f005761af52c22afc7a7b672dc4a718f46a74bb75714  fix-test.patch
f972d727fba7bbdf827c2b5ba0cf7588b7e9234f3e5989f06dc92c1a8c34516fdca3e1089e98e3a8c092328a04f524d7d6a0a017869188e219f4bcc1e869a261  fix-tests.patch"