nixpkgs/pkgs/development/interpreters/wasmtime/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
2.0 KiB
Nix
Raw Normal View History

{ rustPlatform, fetchFromGitHub, Security, lib, stdenv }:
2020-01-07 16:36:29 +00:00
rustPlatform.buildRustPackage rec {
2019-06-09 09:48:14 +00:00
pname = "wasmtime";
2024-02-29 04:51:03 +00:00
version = "18.0.2";
src = fetchFromGitHub {
2019-11-25 11:04:40 +00:00
owner = "bytecodealliance";
repo = pname;
rev = "v${version}";
2024-02-29 04:51:03 +00:00
hash = "sha256-R/emS2h9YM9LwgQARphFPaX1S62T8Rwqs0uLq1y929o=";
fetchSubmodules = true;
};
# Disable cargo-auditable until https://github.com/rust-secure-code/cargo-auditable/issues/124 is solved.
auditable = false;
2024-02-29 04:51:03 +00:00
cargoHash = "sha256-r7fmKriChDvd09eynpxVOywBMkArMR4epsmtY6U6JI4=";
cargoBuildFlags = [ "--package" "wasmtime-cli" "--package" "wasmtime-c-api" ];
outputs = [ "out" "dev" ];
2023-05-23 19:42:42 +00:00
buildInputs = lib.optional stdenv.isDarwin Security;
# SIMD tests are only executed on platforms that support all
# required processor features (e.g. SSE3, SSSE3 and SSE4.1 on x86_64):
# https://github.com/bytecodealliance/wasmtime/blob/v9.0.0/cranelift/codegen/src/isa/x64/mod.rs#L220
doCheck = with stdenv.buildPlatform; (isx86_64 -> sse3Support && ssse3Support && sse4_1Support);
cargoTestFlags = ["--package" "wasmtime-runtime"];
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
'' + lib.optionalString stdenv.isDarwin ''
install_name_tool -id \
$dev/lib/libwasmtime.dylib \
$dev/lib/libwasmtime.dylib
'';
meta = with lib; {
description =
"Standalone JIT-style runtime for WebAssembly, using Cranelift";
homepage = "https://wasmtime.dev/";
license = licenses.asl20;
2023-08-22 12:33:28 +00:00
mainProgram = "wasmtime";
maintainers = with maintainers; [ ereslibre matthewbauer ];
platforms = platforms.unix;
changelog = "https://github.com/bytecodealliance/wasmtime/blob/v${version}/RELEASES.md";
};
}