2022-09-09 14:08:57 +00:00
|
|
|
{ rustPlatform, fetchFromGitHub, lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasmtime";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "8.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bytecodealliance";
|
2020-11-03 02:18:15 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-xSHwR2MGL49VDKjzAh+xYHbLz3FFg3KYVBjALVgKSQI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
cargoHash = "sha256-A2JhjRFKPltHubiJYHBXj2H4cdU43Y2x6UjEpRGPX7U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
cargoBuildFlags = [
|
|
|
|
"--package wasmtime-cli"
|
|
|
|
"--package wasmtime-c-api"
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
# We disable tests on x86_64-darwin because Hydra runners do not
|
|
|
|
# support SSE3, SSSE3, SSE4.1 and SSE4.2 at this time. This is
|
|
|
|
# required by wasmtime. Given this is very specific to Hydra
|
|
|
|
# runners, just disable tests on this platform, so we don't get
|
|
|
|
# false positives of this package being broken due to failed runs on
|
|
|
|
# Hydra (e.g. https://hydra.nixos.org/build/187667794/)
|
|
|
|
doCheck = (stdenv.system != "x86_64-darwin");
|
2023-02-09 11:40:11 +00:00
|
|
|
cargoTestFlags = [
|
|
|
|
"--package wasmtime-runtime"
|
2022-04-03 18:54:34 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postInstall = ''
|
|
|
|
# move libs from out to dev
|
|
|
|
install -d -m 0755 $dev/lib
|
|
|
|
install -m 0644 ''${!outputLib}/lib/* $dev/lib
|
|
|
|
rm -r ''${!outputLib}/lib
|
|
|
|
|
|
|
|
install -d -m0755 $dev/include/wasmtime
|
|
|
|
install -m0644 $src/crates/c-api/include/*.h $dev/include
|
|
|
|
install -m0644 $src/crates/c-api/include/wasmtime/*.h $dev/include/wasmtime
|
|
|
|
install -m0644 $src/crates/c-api/wasm-c-api/include/* $dev/include
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
|
2020-10-11 12:50:04 +00:00
|
|
|
homepage = "https://github.com/bytecodealliance/wasmtime";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ ereslibre matthewbauer ];
|
2022-06-16 17:23:12 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|