Skip to content

Commit 0df5b31

Browse files
committed
[new package] wasmer 4.3.5
1 parent 9eaf745 commit 0df5b31

File tree

4 files changed

+637
-0
lines changed

4 files changed

+637
-0
lines changed

mingw-w64-wasmer/PKGBUILD

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Maintainer: Maksim Bondarenkov <[email protected]>
2+
3+
_realname=wasmer
4+
pkgbase=mingw-w64-${_realname}
5+
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
6+
pkgver=4.3.5
7+
pkgrel=1
8+
pkgdesc="Universal Binaries Powered by WebAssembly (mingw-w64)"
9+
arch=('any')
10+
mingw_arch=('ucrt64' 'clang64')
11+
url="https://github.com/wasmerio/wasmer"
12+
license=('spdx:MIT')
13+
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
14+
"${MINGW_PACKAGE_PREFIX}-sqlite3")
15+
makedepends=("${MINGW_PACKAGE_PREFIX}-rust"
16+
"${MINGW_PACKAGE_PREFIX}-cmake"
17+
"${MINGW_PACKAGE_PREFIX}-pkgconf"
18+
"${MINGW_PACKAGE_PREFIX}-openssl"
19+
'git')
20+
source=("git+${url}.git#tag=v${pkgver}"
21+
"tun-tap.tar.gz::https://crates.io/api/v1/crates/tun-tap/0.1.4/download"
22+
"tun-tap-update-tokio.patch"
23+
"mingw-build.patch"
24+
"reproducible-builds.patch")
25+
sha256sums=('9d82eba29ea066ba762d0994b3986dcb1cf99deaefe851ccd33a12bb1a2dab37'
26+
'9a477a4e9367c72ac875d23cd07ac99ffa932497d8428767fed0cfa27bbabe50'
27+
'5ed51ede5cd2831399c8afced87cfe7b28bf51fa952909bd00d32f83166002da'
28+
'39e6ab2fc90b9bb7c664c40291b8d6b68d7d7e99026b2d97f4856decc2d28c79'
29+
'7f08b41e0077a23b16eb2e9410ac953b293d1eeeaf1b83915a596ac437f81125')
30+
31+
prepare() {
32+
cd "${_realname}"
33+
rm -f rust-toolchain
34+
35+
patch -Np1 -i "${srcdir}/reproducible-builds.patch"
36+
patch -Np1 -i "${srcdir}/mingw-build.patch"
37+
# update tokio in tun-tap dependency so outdated [email protected], kerenel32-sys and ws2_32-sys are dropped
38+
rm ../tun-tap-0.1.4/Cargo.lock && mv -f ../tun-tap-0.1.4/Cargo.toml.orig ../tun-tap-0.1.4/Cargo.toml
39+
patch -d ../tun-tap-0.1.4 -Np1 -i "${srcdir}/tun-tap-update-tokio.patch"
40+
sed -i 's|^tun-tap = { version = "0.1.3"|tun-tap = { version = "0.1.4"|' lib/cli/Cargo.toml
41+
cat >> Cargo.toml <<END
42+
43+
[patch.crates-io]
44+
tun-tap = { path = "../tun-tap-0.1.4" }
45+
END
46+
47+
cargo update -p tun-tap
48+
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
49+
}
50+
51+
build() {
52+
cd "${_realname}"
53+
54+
export WINAPI_NO_BUNDLED_LIBRARIES=1
55+
export LIBSQLITE3_SYS_USE_PKG_CONFIG=1
56+
make ENABLE_SINGLEPASS=1 ENABLE_CRANELIFT=0 WASMER_INSTALL_PREFIX=${MINGW_PREFIX}
57+
}
58+
59+
# tests require rustup binary
60+
# check() {
61+
# cd "${_realame}"
62+
# make test-examples
63+
# }
64+
65+
package() {
66+
cd "${_realname}"
67+
68+
make DESTDIR="${pkgdir}${MINGW_PREFIX}" install
69+
}

mingw-w64-wasmer/mingw-build.patch

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/Makefile b/Makefile
2+
index 97dc61d550..d85714db57 100644
3+
--- a/Makefile
4+
+++ b/Makefile
5+
@@ -44,52 +44,11 @@ SHELL=/usr/bin/env bash
6+
IS_DARWIN := 0
7+
IS_LINUX := 0
8+
IS_FREEBSD := 0
9+
-IS_WINDOWS := 0
10+
-IS_AMD64 := 0
11+
+IS_WINDOWS := 1
12+
+IS_AMD64 := 1
13+
IS_AARCH64 := 0
14+
IS_RISCV64 := 0
15+
16+
-# Test Windows apart because it doesn't support `uname -s`.
17+
-ifeq ($(OS), Windows_NT)
18+
- # We can assume it will likely be in amd64.
19+
- IS_AMD64 := 1
20+
- IS_WINDOWS := 1
21+
-else
22+
- # Platform
23+
- uname := $(shell uname -s)
24+
-
25+
- ifeq ($(uname), Darwin)
26+
- IS_DARWIN := 1
27+
- else ifeq ($(uname), Linux)
28+
- IS_LINUX := 1
29+
- else ifeq ($(uname), FreeBSD)
30+
- IS_FREEBSD := 1
31+
- else
32+
- # We use spaces instead of tabs to indent `$(error)`
33+
- # otherwise it's considered as a command outside a
34+
- # target and it will fail.
35+
- $(error Unrecognized platform, expect `Darwin`, `Linux` or `Windows_NT`)
36+
- endif
37+
-
38+
- # Architecture
39+
- uname := $(shell uname -m)
40+
-
41+
- ifneq (, $(filter $(uname), x86_64 amd64))
42+
- IS_AMD64 := 1
43+
- else ifneq (, $(filter $(uname), aarch64 arm64))
44+
- IS_AARCH64 := 1
45+
- else ifneq (, $(filter $(uname), riscv64))
46+
- IS_RISCV64 := 1
47+
- else
48+
- # We use spaces instead of tabs to indent `$(error)`
49+
- # otherwise it's considered as a command outside a
50+
- # target and it will fail.
51+
- $(error Unrecognized architecture, expect `x86_64`, `aarch64`, `arm64`, 'riscv64')
52+
- endif
53+
-
54+
- # Libc
55+
- LIBC ?= $(shell ldd 2>&1 | grep -o musl | head -n1)
56+
-endif
57+
58+
59+
#####
60+
@@ -887,13 +846,7 @@ install-capi-headers:
61+
62+
# Currently implemented for linux only. TODO
63+
install-capi-lib:
64+
- pkgver=$$($(CARGO_BINARY) pkgid --manifest-path lib/c-api/Cargo.toml | sed 's/^.*wasmer-c-api@//') && \
65+
- shortver="$${pkgver%.*}" && \
66+
- majorver="$${shortver%.*}" && \
67+
- install -Dm755 target/release/libwasmer.so "$(DESTDIR)/lib/libwasmer.so.$$pkgver" && \
68+
- ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so.$$shortver" && \
69+
- ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so.$$majorver" && \
70+
- ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so"
71+
+ install -Dm755 target/release/libwasmer.dll "$(DESTDIR)/bin/libwasmer.dll
72+
73+
install-misc:
74+
install -Dm644 LICENSE "$(DESTDIR)"/share/licenses/wasmer/LICENSE
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/lib/cli/build.rs
2+
+++ b/lib/cli/build.rs
3+
@@ -21,7 +21,7 @@ pub fn main() {
4+
println!("cargo:rustc-env=WASMER_BUILD_GIT_HASH_SHORT=???????");
5+
}
6+
7+
- let utc: DateTime<Utc> = Utc::now();
8+
+ let utc: DateTime<Utc> = DateTime::from_timestamp(0, 0).unwrap();
9+
let date = utc.format("%Y-%m-%d").to_string();
10+
println!("cargo:rustc-env=WASMER_BUILD_DATE={}", date);
11+
}

0 commit comments

Comments
 (0)