aboutsummaryrefslogtreecommitdiffstats
path: root/testing/emscripten-fastcomp/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/emscripten-fastcomp/APKBUILD')
-rw-r--r--testing/emscripten-fastcomp/APKBUILD79
1 files changed, 79 insertions, 0 deletions
diff --git a/testing/emscripten-fastcomp/APKBUILD b/testing/emscripten-fastcomp/APKBUILD
new file mode 100644
index 0000000000..8532d923d1
--- /dev/null
+++ b/testing/emscripten-fastcomp/APKBUILD
@@ -0,0 +1,79 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+
+# NOTE: This is a fork of LLVM project needed for emscripten. It provides
+# JSBackend and WebAssembly, these will be hopefully someday merged into
+# upstream LLVM.
+# TODO: Remove unneeded binaries.
+pkgname=emscripten-fastcomp
+# Keep in sync with package emscripten!
+pkgver=1.37.9
+pkgrel=0
+pkgdesc="The Clang + LLVM backend for Emscripten"
+url="https://kripken.github.io/emscripten-site/"
+arch="all"
+license="UOI-NCSA"
+depends="python2"
+makedepends="cmake paxmark zlib-dev"
+source="$pkgname.tar.gz::https://github.com/kripken/$pkgname/archive/$pkgver.tar.gz
+ $pkgname-clang.tar.gz::https://github.com/kripken/$pkgname-clang/archive/$pkgver.tar.gz
+ fix-build-with-musl-libc.patch
+ fix-DynamicLibrary-to-build-with-musl-libc.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+options="!check" # some tests are broken, don't bother with it for now
+
+_prefix="/usr/lib/$pkgname"
+ldpath="$_prefix/lib"
+
+prepare() {
+ ln -sf ../../$pkgname-clang-$pkgver "$builddir"/tools/clang
+
+ default_prepare
+}
+
+build() {
+ mkdir -p "$builddir"/build
+ cd "$builddir"/build
+
+ # XXX: Is it a good idea to omit X86 in LLVM_TARGETS_TO_BUILD?
+ # https://github.com/kripken/emscripten-fastcomp/issues/174
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX="$_prefix" \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DPYTHON_EXECUTABLE=/usr/bin/python2 \
+ -DLLVM_HOST_TRIPLE="$CHOST" \
+ -DLLVM_BUILD_LLVM_DYLIB=ON \
+ -DLLVM_LINK_LLVM_DYLIB=ON \
+ -DLLVM_TARGETS_TO_BUILD=JSBackend \
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \
+ -DLLVM_BUILD_RUNTIME=OFF \
+ -DLLVM_INCLUDE_EXAMPLES=OFF \
+ -DLLVM_ENABLE_ZLIB=ON \
+ -DCLANG_INCLUDE_EXAMPLES=OFF
+ make -j ${JOBS:-2}
+
+ paxmark m bin/llvm-rtdyld \
+ bin/lli \
+ bin/lli-child-target
+}
+
+package() {
+ cd "$builddir"/build
+ make install DESTDIR="$pkgdir"
+
+ cd "$pkgdir"/$_prefix
+
+ # emcc -v expects this file to exist.
+ cp ../emscripten-version.txt .
+
+ # Remove unneeded files and clutter.
+ rm -r include libexec share lib/clang lib/cmake
+ rm lib/*.a bin/*-test
+}
+
+sha512sums="443d22163866a409b6218bb686d52b845051350ef4af546e2d52ffaca03ed363f3cbf8f8e61b7fc28c1e1007d7e2789bfd74d91159deff46e3c6e1913ffebf34 emscripten-fastcomp.tar.gz
+5c1fae88e87575571fef767f9c3d664c0eed106d566517871503c75cb5e31777d5fd5773f914fbe932abde3b42870b25e4ca58cf458ceecd0f9a7a50e7d86af9 emscripten-fastcomp-clang.tar.gz
+5596bb1b4d4f7da8fef5f7e85a50de797dd88c1d93c7fcc9ff585093fd56d292222496e8e28e6a7d90effcfbf11c486636025646d65ba928fcb52352d1eb6336 fix-build-with-musl-libc.patch
+01c0f994eb364fc0b02f7c97268f0bc470ed9d404bb2c013196005a6c0be91c9634f092aa262fc5c4e7ae72e36140f259efe9d8ec3a613f4b9aa7aa7b4b57759 fix-DynamicLibrary-to-build-with-musl-libc.patch"