about summary refs log tree commit diff
path: root/pkgs/development/interpreters/wasmtime
diff options
context:
space:
mode:
authorMichael Livshin <repo@cmm.kakpryg.net>2022-02-20 10:18:36 +0200
committerRafael Fernández López <ereslibre@ereslibre.es>2022-08-25 00:34:10 +0200
commit153f2f6f067dcf6b56c8c0f44591f48370603203 (patch)
tree24e60a57b078336abdaba2409e6b9527899b97bb /pkgs/development/interpreters/wasmtime
parentb5d72febf1592c44a2540501fa9c0a5987b700a9 (diff)
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.
Diffstat (limited to 'pkgs/development/interpreters/wasmtime')
-rw-r--r--pkgs/development/interpreters/wasmtime/default.nix25
1 files changed, 22 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix
index db113b2a48163..d3d4516ca3ebe 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";