Skip to content

Commit a8f1704

Browse files
authored
feat: support macos arm64 (#112)
1 parent dc44ef2 commit a8f1704

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

install-wasmtime.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,23 @@
1515
#
1616
set -euo pipefail -x
1717
arch=$(uname -m | tr '[:upper:]' '[:lower:]')
18-
18+
os=$(uname -s | tr '[:upper:]' '[:lower:]')
19+
if [ "$os" = "darwin" ]; then
20+
os="macos"
21+
if [ "$arch" = "arm64" ]; then
22+
arch="aarch64"
23+
fi
24+
else
25+
os="linux"
26+
fi
1927
ARCH=$arch
20-
VER=v0.35.1
21-
wget https://github.com/bytecodealliance/wasmtime/releases/download/${VER}/wasmtime-${VER}-${ARCH}-linux-c-api.tar.xz
22-
tar -xvf ./wasmtime-${VER}-${ARCH}-linux-c-api.tar.xz > /dev/null
28+
VER=v0.37.0
29+
wget https://github.com/bytecodealliance/wasmtime/releases/download/${VER}/wasmtime-${VER}-${ARCH}-${os}-c-api.tar.xz
30+
tar -xvf ./wasmtime-${VER}-${ARCH}-${os}-c-api.tar.xz > /dev/null
2331
if [ -d wasmtime-c-api ]; then
2432
rm -rf wasmtime-c-api
2533
fi
26-
mv wasmtime-${VER}-${ARCH}-linux-c-api wasmtime-c-api
34+
mv wasmtime-${VER}-${ARCH}-${os}-c-api wasmtime-c-api
2735
if echo "int main(void) {}" | gcc -o /dev/null -v -x c - &> /dev/stdout| grep collect | tr -s " " "\012" | grep musl; then
2836
# build from source code if the libc is musl
2937
git clone https://github.com/bytecodealliance/wasmtime -b ${VER} --depth 1 \

0 commit comments

Comments
 (0)