From 153f2f6f067dcf6b56c8c0f44591f48370603203 Mon Sep 17 00:00:00 2001 From: Michael Livshin Date: Sun, 20 Feb 2022 10:18:36 +0200 Subject: [PATCH] wasmtime: build c-api, bump version to 0.40.0 * build wasmtime c-api libraries & headers as the "dev" output. * bump wasmtime source version to 0.40.0. --- .../interpreters/wasmtime/default.nix | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix index db113b2a4816..d3d4516ca3eb 100644 --- a/pkgs/development/interpreters/wasmtime/default.nix +++ b/pkgs/development/interpreters/wasmtime/default.nix @@ -2,17 +2,24 @@ rustPlatform.buildRustPackage rec { pname = "wasmtime"; - version = "0.39.1"; + version = "0.40.0"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = pname; rev = "v${version}"; - sha256 = "sha256-cU03wm1+V++mV7j7VyMtjAYrPldzTysNzpJ8m0q4Rx8="; + sha256 = "sha256-i3dtjKy5YTyNkEaDcGxsrd4lbyUBd25OARESbJVK9uY="; fetchSubmodules = true; }; - cargoSha256 = "sha256-DnThste0SbBdpGAUYhmwbdQFNEB3LozyDf0X8r2A90Q="; + cargoSha256 = "sha256-wlcYdZ8Akkpicyw74sh4CNwSstCtUJxf+oSEL/mUtKc="; + + 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 @@ -31,6 +38,18 @@ rustPlatform.buildRustPackage rec { "--skip=traps::parse_dwarf_info" ]; + 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";