contrib/wasi-libc/Pkgfile
2022-04-10 12:25:50 +10:00

32 lines
773 B
Plaintext

# Description: WASI libc implementation for WebAssembly
# URL: https://github.com/WebAssembly/wasi-libc
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: clang
name=wasi-libc
version=232.3eb02a7
_commit=3eb02a798b3ec0048c39d2ab8b97a70575892a5a
release=1
source=(https://github.com/WebAssembly/wasi-libc/archive/$_commit/$name-$version.tar.gz
llvm-14.patch)
build() {
cd $name-$_commit
patch -p1 -i $SRC/llvm-14.patch
make \
WASM_CC=/usr/bin/clang \
WASM_AR=/usr/bin/llvm-ar \
WASM_NM=/usr/bin/llvm-nm
install -dm755 $PKG/usr/share
cp -dr --preserve=mode,timestamp sysroot $PKG/usr/share/wasi-sysroot
cd $PKG/usr/share/wasi-sysroot/lib/wasm32-wasi
for f in *.a; do
/usr/bin/llvm-ranlib $f
/usr/bin/llvm-strip --strip-debug $f
done
}