summaryrefslogtreecommitdiff
path: root/skip/wasi-libcxx/wasi-libcxx.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-25 22:50:03 +0100
committerdavidovski <david@davidovski.xyz>2022-05-25 22:50:03 +0100
commit7b0628f037dcbf85cfb381d5e05dea39a2059d33 (patch)
tree4a534ef861d19cdf5235b504af5be2a5d0becb71 /skip/wasi-libcxx/wasi-libcxx.xibuild
parent79062a39e9bcb9731adbacd0bd9bcd0b59d19d0a (diff)
fixed various broken dependencies
Diffstat (limited to 'skip/wasi-libcxx/wasi-libcxx.xibuild')
-rw-r--r--skip/wasi-libcxx/wasi-libcxx.xibuild96
1 files changed, 96 insertions, 0 deletions
diff --git a/skip/wasi-libcxx/wasi-libcxx.xibuild b/skip/wasi-libcxx/wasi-libcxx.xibuild
new file mode 100644
index 0000000..45f3772
--- /dev/null
+++ b/skip/wasi-libcxx/wasi-libcxx.xibuild
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+NAME="wasi-libcxx"
+DESC="WASI LLVM C++ standard library"
+
+MAKEDEPS="cmake "
+DEPS="musl "
+
+PKG_VER=13.0.1
+wasi_sdk_ver=14
+
+SOURCE="https://github.com/WebAssembly/wasi-sdk/archive/refs/tags/wasi-sdk-$wasi_sdk_ver.tar.gz"
+ADDITIONAL="
+https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/libcxx-$PKG_VER.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/libcxxabi-$PKG_VER.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/llvm-$PKG_VER.src.tar.xz
+"
+
+builddir="$BUILD_ROOT/wasi-libcxx"
+
+prepare () {
+ mkdir -p $builddir/
+
+ for s in libcxx libcxxabi llvm; do
+ tar xf $s-$PKG_VER.src.tar.xz
+ mv $s-$PKG_VER.src $builddir/$s
+ done
+
+ mv wasi-sdk.cmake "$builddir"
+ mv cmake "$builddir"
+}
+
+build () {
+ export CFLAGS="$CFLAGS -fno-exceptions --sysroot=/usr/share/wasi-sysroot"
+ export CXXFLAGS="$CXXFLAGS -fno-exceptions --sysroot=/usr/share/wasi-sysroot"
+
+ cd $builddir
+ cmake -B build-libcxx -G Ninja \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DCMAKE_MODULE_PATH="$builddir"/cmake \
+ -DCMAKE_TOOLCHAIN_FILE="$builddir"/wasi-sdk.cmake \
+ -DCMAKE_C_COMPILER_WORKS=ON \
+ -DCMAKE_CXX_COMPILER_WORKS=ON \
+ -DCMAKE_STAGING_PREFIX=/usr/share/wasi-sysroot \
+ -DLIBCXX_INCLUDE_TESTS=ON \
+ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
+ -DLIBCXX_ENABLE_SHARED=OFF \
+ -DLIBCXX_ENABLE_THREADS=OFF \
+ -DLIBCXX_HAS_PTHREAD_API=OFF \
+ -DLIBCXX_HAS_EXTERNAL_THREAD_API=OFF \
+ -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY=OFF \
+ -DLIBCXX_HAS_WIN32_THREAD_API=OFF \
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
+ -DLIBCXX_ENABLE_FILESYSTEM=OFF \
+ -DLIBCXX_CXX_ABI=libcxxabi \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=libcxxabi/include \
+ -DLIBCXX_HAS_MUSL_LIBC=ON \
+ -DLIBCXX_ABI_VERSION=2 \
+ -DWASI_SDK_PREFIX=/usr \
+ -DLIBCXX_LIBDIR_SUFFIX=/wasm32-wasi \
+ libcxx
+
+ cmake -B build-libcxxabi -G Ninja \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DCMAKE_MODULE_PATH="$builddir"/cmake \
+ -DCMAKE_TOOLCHAIN_FILE="$builddir"/wasi-sdk.cmake \
+ -DCMAKE_C_COMPILER_WORKS=ON \
+ -DCMAKE_CXX_COMPILER_WORKS=ON \
+ -DCMAKE_STAGING_PREFIX=/usr/share/wasi-sysroot \
+ -DLIBCXXABI_INCLUDE_TESTS=ON \
+ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
+ -DLIBCXXABI_ENABLE_SHARED=OFF \
+ -DLIBCXXABI_ENABLE_THREADS=OFF \
+ -DLIBCXXABI_HAS_PTHREAD_API=OFF \
+ -DLIBCXXABI_HAS_EXTERNAL_THREAD_API=OFF \
+ -DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY=OFF \
+ -DLIBCXXABI_HAS_WIN32_THREAD_API=OFF \
+ -DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \
+ -DLIBCXXABI_ENABLE_PIC=OFF \
+ -DUNIX=ON \
+ -DCXX_SUPPORTS_CXX11=ON \
+ -DLIBCXXABI_LIBCXX_PATH=libcxx \
+ -DLIBCXXABI_LIBCXX_INCLUDES="$builddir"/build-libcxx/include/c++/v1 \
+ -DWASI_SDK_PREFIX=/usr \
+ -DLIBCXXABI_LIBDIR_SUFFIX=/wasm32-wasi \
+ libcxxabi
+
+ cmake --build build-libcxx
+ cmake --build build-libcxxabi
+
+}
+
+package () {
+ DESTDIR="$PKG_DEST" cmake --install build-libcxx
+ DESTDIR="$PKG_DEST" cmake --install build-libcxxabi
+}