depot/third_party/nixpkgs/pkgs/development/interpreters/wasmtime/default.nix
Default email 410b979fe2 Project import generated by Copybara.
GitOrigin-RevId: a64e169e396460d6b5763a1de1dd197df8421688
2023-03-24 01:07:29 +01:00

54 lines
1.7 KiB
Nix

{ rustPlatform, fetchFromGitHub, lib, stdenv }:
rustPlatform.buildRustPackage rec {
pname = "wasmtime";
version = "7.0.0";
src = fetchFromGitHub {
owner = "bytecodealliance";
repo = pname;
rev = "v${version}";
hash = "sha256-vbsjUJH6wHmSTwUV5tXrTUljPJNLTms8K6EyWi0mipA=";
fetchSubmodules = true;
};
cargoHash = "sha256-eTm0FfWiNpEwj2egLrQGPA1lZ0K5GfVOeULsbNyf18Q=";
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");
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
'';
meta = with lib; {
description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
homepage = "https://github.com/bytecodealliance/wasmtime";
license = licenses.asl20;
maintainers = with maintainers; [ ereslibre matthewbauer ];
platforms = platforms.unix;
};
}