# 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=574b88da481569b65a237cb80daf9a2d5aeaf82d release=1 source=(https://github.com/WebAssembly/$name/archive/$_commit/$name-$version.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 BULK_MEMORY_SOURCES=" for target in wasi wasip1 wasip1-threads wasip2; do case $target in wasip1-threads) MAKE_ARGS=' THREAD_MODEL=posix';; wasip2) MAKE_ARGS=' WASI_SNAPSHOT=p2';; esac make TARGET_TRIPLE="wasm32-$target" $MAKE_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 }