Skip to content

Commit 805f6c2

Browse files
committed
contrib: added wasmtime.
1 parent 36dceae commit 805f6c2

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

pkg/contrib/src/wasmtime/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# wasmtime
2+
3+
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
4+
WASMTIME_URL := https://github.com/bytecodealliance/wasmtime/releases/download/v$(WASMTIME_VERSION)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
5+
6+
PKGS += wasmtime
7+
8+
ifeq ($(shell which cargo >/dev/null 2>&1 || echo FAIL),)
9+
CARGO = cargo
10+
else
11+
CARGO = $(error Cargo (Rust package manager) not found)
12+
endif
13+
14+
ifeq ($(shell uname -s),Linux)
15+
WASMTIME_ARGS=-Clink-arg=-Wl,-soname,libwasmtime.so
16+
endif
17+
18+
$(TARBALLS)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz:
19+
$(call download_pkg,$(WASMTIME_URL),wasmtime)
20+
21+
.sum-wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
22+
23+
wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz .sum-wasmtime
24+
$(UNPACK)
25+
$(MOVE)
26+
27+
.wasmtime: wasmtime
28+
cd $< && $(CARGO) rustc --release -p wasmtime-c-api -- $(WASMTIME_ARGS)
29+
cp $</crates/c-api/wasm-c-api/include/wasm.h $</crates/c-api/include/
30+
touch $@

pkg/contrib/src/wasmtime/SHA512SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4b67ba0742da0558efffe1dbde5512dc5f0201fad25f1027d277758e76778b2add11528dbe3f5b7759f2386859b52aea3a0526abaa481c2ed91eb56c5a531b49 wasmtime-v11.0.1-src.tar.gz

pkg/contrib/src/wasmtime/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WASMTIME_VERSION := 11.0.1

0 commit comments

Comments
 (0)