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";
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "3.0.0";
|
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}";
|
2022-11-27 09:42:12 +00:00
|
|
|
sha256 = "sha256-DDgt7NjTNiqSq8+yC7bjlpKvWt36ybRCGByx07N4hC8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
cargoSha256 = "sha256-xYOSMWPGLI6xnYhAZDM+MvD/zI0hsoqie86SUGn2EDI=";
|
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");
|
2022-04-03 18:54:34 +00:00
|
|
|
checkFlags = [
|
|
|
|
"--skip=cli_tests::run_cwasm"
|
2022-08-12 12:06:08 +00:00
|
|
|
"--skip=commands::compile::test::test_unsupported_flags_compile"
|
2022-04-03 18:54:34 +00:00
|
|
|
"--skip=commands::compile::test::test_aarch64_flags_compile"
|
2022-06-26 10:26:21 +00:00
|
|
|
"--skip=commands::compile::test::test_successful_compile"
|
2022-04-03 18:54:34 +00:00
|
|
|
"--skip=commands::compile::test::test_x64_flags_compile"
|
|
|
|
"--skip=commands::compile::test::test_x64_presets_compile"
|
|
|
|
"--skip=traps::parse_dwarf_info"
|
|
|
|
];
|
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
|
|
|
};
|
|
|
|
}
|