mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-31 06:12:14 +01:00
79 lines
1.9 KiB
Plaintext
79 lines
1.9 KiB
Plaintext
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
pkgname=binaryen
|
|
pkgver=116
|
|
pkgrel=0
|
|
pkgdesc="Compiler infrastructure and toolchain library for WebAssembly, in C++"
|
|
url="https://github.com/WebAssembly/binaryen"
|
|
arch="all !s390x"
|
|
license="Apache-2.0"
|
|
makedepends="
|
|
clang
|
|
cmake
|
|
python3
|
|
samurai
|
|
"
|
|
checkdepends="
|
|
filecheck
|
|
gtest-dev
|
|
llvm-test-utils
|
|
nodejs
|
|
"
|
|
subpackages="$pkgname-dev"
|
|
source="https://github.com/WebAssembly/binaryen/archive/version_$pkgver/binaryen-$pkgver.tar.gz
|
|
use-system-gtest.patch
|
|
"
|
|
builddir="$srcdir/$pkgname-version_$pkgver"
|
|
|
|
build() {
|
|
case "$CARCH" in
|
|
arm*|aarch64|riscv64)
|
|
export CFLAGS="${CFLAGS/-fstack-clash-protection}"
|
|
export CXXFLAGS="${CFLAGS/-fstack-clash-protection}"
|
|
;;
|
|
esac
|
|
|
|
CC=clang \
|
|
CXX=clang++ \
|
|
LDFLAGS="$LDFLAGS -Wl,-z,stack-size=0x100000" \
|
|
cmake -G Ninja -B build \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
-DBUILD_TESTS=$(want_check && echo ON || echo OFF)
|
|
cmake --build build
|
|
}
|
|
|
|
check() {
|
|
# Tests are extremely chatty.
|
|
msg 'running tests with stdout/stderr redirected into ./check.log...'
|
|
python3 check.py --binaryen-bin build/bin > check.log 2>&1 || {
|
|
echo 'tests failed, printing last 1000 lines of check.log:' >&2
|
|
tail -n 1000 check.log
|
|
|
|
case "$CARCH" in
|
|
# XXX: Ignore test failures on 32-bit arches (broken tests).
|
|
arm* | x86) return 0;;
|
|
*) return 1;;
|
|
esac
|
|
}
|
|
}
|
|
|
|
package() {
|
|
DESTDIR="$pkgdir" cmake --install build
|
|
}
|
|
|
|
dev() {
|
|
default_dev
|
|
|
|
# XXX: doesn't exist on riscv64
|
|
amove usr/bin/binaryen-unittests || true
|
|
}
|
|
|
|
sha512sums="
|
|
a7333751befed6fe4236fa86d749fc8d0ee5e34100c265bce5fb29a0b035e719d3e5642240f26793a9f599fb9c01ca90f79cb3a4adf22e510989ae0fb3d054d6 binaryen-116.tar.gz
|
|
ea332616e91c7674c471eb8f8b6352c6d342a17e2b2fd585c6c2b10de89e1be74e63fe42d908af5b2e109d043085e4300905e4efb2ec57bd275db643b22e167d use-system-gtest.patch
|
|
"
|