# Description: WASI libc implementation for WebAssembly # URL: https://github.com/WebAssembly/wasi-libc # Maintainer: Tim Biermann, tbier at posteo dot de # Depends on: clang name=wasi-libc version=25 # https://github.com/WebAssembly/wasi-sdk/tree/main/src latest tagged version _commit=640c0cfc19a96b099e0791824be5ef0105ce2084 release=2 source=(https://github.com/WebAssembly/$name/archive/$_commit/$name-$version-$release.tar.gz no-double-build.patch) build() { cd $name-$_commit patch -p1 -i $SRC/no-double-build.patch MAKE_ARGS="WASM_CC=/usr/bin/clang WASM_AR=/usr/bin/llvm-ar WASM_NM=/usr/bin/llvm-nm" for target in wasi wasip1 wasip1-threads wasip2; do EXTRA_ARGS="" case $target in wasip1-threads) EXTRA_ARGS="THREAD_MODEL=posix" ;; wasip2) EXTRA_ARGS="WASI_SNAPSHOT=p2" ;; esac make TARGET_TRIPLE="wasm32-$target" $MAKE_ARGS $EXTRA_ARGS done make INSTALL_DIR="$PKG/usr/share/wasi-sysroot" install cd $PKG/usr/share/wasi-sysroot/lib for f in wasm32-wasi*/*.a; do /usr/bin/llvm-ranlib $f /usr/bin/llvm-strip --strip-debug $f done }