-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split wasmer; make libwasmer and libwasmtime conflict
- Loading branch information
Showing
4 changed files
with
38 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/wasmer | ||
/corosensei-fix-compilation.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
|
||
_realname=wasmer | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" | ||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" | ||
"${MINGW_PACKAGE_PREFIX}-lib${_realname}") | ||
pkgver=4.4.0 | ||
pkgrel=1 | ||
pkgdesc="Universal Binaries Powered by WebAssembly (mingw-w64)" | ||
pkgrel=2 | ||
pkgdesc="The leading Wasm Runtime supporting WASIX, WASI and Emscripten (mingw-w64)" | ||
arch=('any') | ||
mingw_arch=('ucrt64' 'clang64') | ||
url="https://github.com/wasmerio/wasmer" | ||
|
@@ -18,15 +19,13 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-rust" | |
'git') | ||
options=('!lto') | ||
source=("git+${url}.git#tag=v${pkgver}" | ||
"corosensei.tar.gz::https://crates.io/api/v1/crates/corosensei/0.1.4/download" | ||
"tun-tap.tar.gz::https://crates.io/api/v1/crates/tun-tap/0.1.4/download" | ||
"corosensei-fix-compilation.patch" | ||
"corosensei-fix-compilation.patch::${url}/commit/688cf64faba9c2420829cfbe94c0835c097c507c.patch" | ||
"tun-tap-update-tokio.patch" | ||
"reproducible-builds.patch") | ||
sha256sums=('1ab4b4b98cd1442b8b23336f78f7e0f2e167985bd50c5f923dbc6eeee56a9d1d' | ||
'80128832c58ea9cbd041d2a759ec449224487b2c1e400453d99d244eead87a8e' | ||
'9a477a4e9367c72ac875d23cd07ac99ffa932497d8428767fed0cfa27bbabe50' | ||
'1636cded85171dc138c68e81336823e2db1e269e744c428426ab05157b41cf34' | ||
'9b9264dffa90e10bfd098b0c8fab9183b7676809a9a8019dc779a64ece0d7bb6' | ||
'684f6a479385e3646b82d5d6588d9290a78708a59dec4aab7af76a0f23aaa249' | ||
'7f08b41e0077a23b16eb2e9410ac953b293d1eeeaf1b83915a596ac437f81125') | ||
|
||
|
@@ -38,17 +37,16 @@ prepare() { | |
# update old dependencies in corosensei and tun-tap crates so outdated [email protected], | ||
# kernel32-sys, ws2_32-sys and [email protected] are dropped; fix compile error in corosensei | ||
mv -f ../tun-tap-0.1.4/Cargo.toml.orig ../tun-tap-0.1.4/Cargo.toml | ||
mv -f ../corosensei-0.1.4/Cargo.toml.orig ../corosensei-0.1.4/Cargo.toml | ||
patch -d ../corosensei-0.1.4 -Np1 -i "../corosensei-fix-compilation.patch" | ||
# https://github.com/wasmerio/wasmer/commit/688cf64faba9c2420829cfbe94c0835c097c507c | ||
patch -Np1 -i "../corosensei-fix-compilation.patch" | ||
patch -d ../tun-tap-0.1.4 -Np1 -i "../tun-tap-update-tokio.patch" | ||
cat >> Cargo.toml <<END | ||
[patch.crates-io] | ||
corosensei = { path = "../corosensei-0.1.4" } | ||
tun-tap = { path = "../tun-tap-0.1.4" } | ||
END | ||
|
||
cargo update -p corosensei -p tun-tap | ||
cargo update -p tun-tap | ||
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" | ||
} | ||
|
||
|
@@ -67,16 +65,31 @@ build() { | |
# make test-examples | ||
# } | ||
|
||
package() { | ||
cd "${_realname}" | ||
package_wasmer() { | ||
install -Dm755 "${_realname}"/target/release/wasmer "${pkgdir}${MINGW_PREFIX}/bin/wasmer" | ||
install -Dm644 "${_realname}"/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" | ||
} | ||
|
||
package_libwasmer() { | ||
pkgdesc+=' (C-API)' | ||
conflicts=("${MINGW_PACKAGE_PREFIX}-libwasmtime") | ||
|
||
install -Dm755 target/release/wasmer "${pkgdir}${MINGW_PREFIX}/bin/wasmer" | ||
install -Dm755 target/release/wasmer.dll "${pkgdir}${MINGW_PREFIX}/bin/libwasmer-4.dll" | ||
install -Dm755 target/release/wasmer.dll.a "${pkgdir}${MINGW_PREFIX}/lib/libwasmer.dll.a" | ||
install -Dm755 target/release/libwasmer.a "${pkgdir}${MINGW_PREFIX}/lib/libwasmer.a" | ||
install -Dm644 lib/c-api/wasm.h "${pkgdir}${MINGW_PREFIX}/include/wasm.h" | ||
install -Dm644 lib/c-api/wasmer.h "${pkgdir}${MINGW_PREFIX}/include/wasmer.h" | ||
install -Dm644 lib/c-api/wasmer_wasm.h "${pkgdir}${MINGW_PREFIX}/include/wasmer_wasm.h" | ||
target/release/wasmer config --pkg-config | install -Dm644 /dev/stdin "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/wasmer.pc" | ||
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/wasmer/LICENSE" | ||
install -Dm755 "${_realname}"/target/release/wasmer.dll "${pkgdir}${MINGW_PREFIX}/bin/wasmer.dll" | ||
install -Dm755 "${_realname}"/target/release/wasmer.dll.a "${pkgdir}${MINGW_PREFIX}/lib/wasmer.dll.a" | ||
install -Dm755 "${_realname}"/target/release/libwasmer.a "${pkgdir}${MINGW_PREFIX}/lib/libwasmer.a" | ||
install -Dm644 "${_realname}"/lib/c-api/wasm.h "${pkgdir}${MINGW_PREFIX}/include/wasm.h" | ||
install -Dm644 "${_realname}"/lib/c-api/wasmer.h "${pkgdir}${MINGW_PREFIX}/include/wasmer.h" | ||
install -Dm644 "${_realname}"/lib/c-api/wasmer_wasm.h "${pkgdir}${MINGW_PREFIX}/include/wasmer_wasm.h" | ||
"${_realname}"/target/release/wasmer config --pkg-config | install -Dm644 /dev/stdin \ | ||
"${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/wasmer.pc" | ||
install -Dm644 "${_realname}"/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/lib${_realname}/LICENSE" | ||
} | ||
|
||
# vim: set ft=bash : | ||
|
||
# generate wrappers | ||
for _name in "${pkgname[@]}"; do | ||
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}" | ||
_func="$(declare -f "${_short}")" | ||
eval "${_func/#${_short}/package_${_name}}" | ||
done |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters