summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-08-22 14:55:10 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-08-22 14:55:10 -0700
commit805f6c24d6c19f9a85cfe1540ba5a5090562bfc1 (patch)
treefe97cfa47295f29b45062d4542ebf9b69052dba7 /pkg
parent36dceaef638141c1f74818760f3f61a35c7470c9 (diff)
downloadunit-805f6c24d6c19f9a85cfe1540ba5a5090562bfc1.tar.gz
unit-805f6c24d6c19f9a85cfe1540ba5a5090562bfc1.tar.bz2
contrib: added wasmtime.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/contrib/src/wasmtime/Makefile30
-rw-r--r--pkg/contrib/src/wasmtime/SHA512SUMS1
-rw-r--r--pkg/contrib/src/wasmtime/version1
3 files changed, 32 insertions, 0 deletions
diff --git a/pkg/contrib/src/wasmtime/Makefile b/pkg/contrib/src/wasmtime/Makefile
new file mode 100644
index 00000000..11797fee
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/Makefile
@@ -0,0 +1,30 @@
+# wasmtime
+
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
+WASMTIME_URL := https://github.com/bytecodealliance/wasmtime/releases/download/v$(WASMTIME_VERSION)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
+
+PKGS += wasmtime
+
+ifeq ($(shell which cargo >/dev/null 2>&1 || echo FAIL),)
+CARGO = cargo
+else
+CARGO = $(error Cargo (Rust package manager) not found)
+endif
+
+ifeq ($(shell uname -s),Linux)
+WASMTIME_ARGS=-Clink-arg=-Wl,-soname,libwasmtime.so
+endif
+
+$(TARBALLS)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz:
+ $(call download_pkg,$(WASMTIME_URL),wasmtime)
+
+.sum-wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
+
+wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz .sum-wasmtime
+ $(UNPACK)
+ $(MOVE)
+
+.wasmtime: wasmtime
+ cd $< && $(CARGO) rustc --release -p wasmtime-c-api -- $(WASMTIME_ARGS)
+ cp $</crates/c-api/wasm-c-api/include/wasm.h $</crates/c-api/include/
+ touch $@
diff --git a/pkg/contrib/src/wasmtime/SHA512SUMS b/pkg/contrib/src/wasmtime/SHA512SUMS
new file mode 100644
index 00000000..35e0e47f
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/SHA512SUMS
@@ -0,0 +1 @@
+4b67ba0742da0558efffe1dbde5512dc5f0201fad25f1027d277758e76778b2add11528dbe3f5b7759f2386859b52aea3a0526abaa481c2ed91eb56c5a531b49 wasmtime-v11.0.1-src.tar.gz
diff --git a/pkg/contrib/src/wasmtime/version b/pkg/contrib/src/wasmtime/version
new file mode 100644
index 00000000..1debf1ff
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/version
@@ -0,0 +1 @@
+WASMTIME_VERSION := 11.0.1