aboutsummaryrefslogtreecommitdiffstats
path: root/community/binaryen/APKBUILD
blob: 9f0dfdff05575a65d87578f2658f14c66f18043c (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
48
49
50
51
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=binaryen
pkgver=1.37.14
pkgrel=0
pkgdesc="Compiler infrastructure and toolchain library for WebAssembly, in C++"
url="https://github.com/WebAssembly/binaryen"
arch="all !s390x"
license="ASL-2.0"
makedepends="cmake"
checkdepends="nodejs python2"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/WebAssembly/$pkgname/archive/$pkgver.tar.gz
	link-dynamically.patch"
builddir="$srcdir/$pkgname-$pkgver"

case "$CARCH" in
	x86) options="!check";;  # XXX: two tests fail
esac

build() {
	cd "$builddir"

	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DBUILD_SHARED_LIBS=ON
	make
}

check() {
	cd "$builddir"

	# waterfall requires additional dependency
	# gcc-tests fail, dunno why
	python2 check.py --no-test-waterfall --no-run-gcc-tests
}

package() {
	cd "$builddir"

	make install DESTDIR="$pkgdir"
	rm "$pkgdir"/usr/share/binaryen/binaryen.js
}

sha512sums="420a79020fdbf9e79ac55441c27839db5a55c5ce4ace21f289bb2e6a96bde79f47b93097a570f5ace8b80837c51b91c115727283b9d11731120749f6e107dd5b  binaryen-1.37.14.tar.gz
4a6f6708b8d72ba0be901eb0a6cba4e07e40270fc1d5abf5bea5f82ef34100ecb2017a1c8ae1c4b10446ef87d0328f4b4f9a7776ec8c2f850170fe241cfda1c6  link-dynamically.patch"