2022-08-21 08:44:31 +00:00
|
|
|
{ rustPlatform, fetchFromGitHub, lib, stdenv }:
|
2019-04-16 02:22:16 +00:00
|
|
|
|
2020-01-07 16:36:29 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-06-09 09:48:14 +00:00
|
|
|
pname = "wasmtime";
|
2022-12-24 13:06:50 +00:00
|
|
|
version = "4.0.0";
|
2019-04-16 02:22:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-11-25 11:04:40 +00:00
|
|
|
owner = "bytecodealliance";
|
2020-11-01 22:39:49 +00:00
|
|
|
repo = pname;
|
2020-04-14 17:49:12 +00:00
|
|
|
rev = "v${version}";
|
2022-12-24 13:06:50 +00:00
|
|
|
hash = "sha256-Vw3+KlAuCQiyBfPOZrUotgrdkG+FRjXg8AxAanfbwJQ=";
|
2019-04-16 02:22:16 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-12-24 13:06:50 +00:00
|
|
|
cargoHash = "sha256-gV3Yf7YL3D3hrymYW1b80uOlp7RYRWFC7GtxAot5Ut0=";
|
2022-02-20 08:18:36 +00:00
|
|
|
|
|
|
|
cargoBuildFlags = [
|
|
|
|
"--package wasmtime-cli"
|
|
|
|
"--package wasmtime-c-api"
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2019-04-16 02:22:16 +00:00
|
|
|
|
2022-08-21 08:44:31 +00:00
|
|
|
# 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-03-31 16:42:34 +00:00
|
|
|
checkFlags = [
|
|
|
|
"--skip=cli_tests::run_cwasm"
|
2022-08-05 16:48:57 +00:00
|
|
|
"--skip=commands::compile::test::test_unsupported_flags_compile"
|
2022-03-31 16:42:34 +00:00
|
|
|
"--skip=commands::compile::test::test_aarch64_flags_compile"
|
2022-05-23 06:39:29 +00:00
|
|
|
"--skip=commands::compile::test::test_successful_compile"
|
2022-03-31 16:42: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-02-29 11:58:22 +00:00
|
|
|
|
2022-02-20 08:18:36 +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
|
|
|
|
'';
|
|
|
|
|
2019-04-16 02:22:16 +00:00
|
|
|
meta = with lib; {
|
2020-01-07 16:36:29 +00:00
|
|
|
description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
|
2020-10-07 10:56:06 +00:00
|
|
|
homepage = "https://github.com/bytecodealliance/wasmtime";
|
2019-04-16 02:22:16 +00:00
|
|
|
license = licenses.asl20;
|
2022-05-23 06:39:29 +00:00
|
|
|
maintainers = with maintainers; [ ereslibre matthewbauer ];
|
2022-04-03 20:15:42 +00:00
|
|
|
platforms = platforms.unix;
|
2019-04-16 02:22:16 +00:00
|
|
|
};
|
|
|
|
}
|