wasmtime: include `conf.h` in `include/wasmtime` (#394859)

authored by Weijia Wang and committed by GitHub a5748d3a 9a62eb09

+21 -22
+21 -22
pkgs/development/interpreters/wasmtime/default.nix
··· 2 2 lib, 3 3 rustPlatform, 4 4 cmake, 5 - rustfmt, 6 5 fetchFromGitHub, 7 6 Security, 8 7 stdenv, 9 8 }: 10 - 11 - rustPlatform.buildRustPackage rec { 9 + let 10 + inherit (stdenv.targetPlatform.rust) cargoShortTarget; 11 + in 12 + rustPlatform.buildRustPackage (finalAttrs: { 12 13 pname = "wasmtime"; 13 14 version = "31.0.0"; 14 15 15 16 src = fetchFromGitHub { 16 17 owner = "bytecodealliance"; 17 - repo = pname; 18 - rev = "v${version}"; 18 + repo = "wasmtime"; 19 + tag = "v${finalAttrs.version}"; 19 20 hash = "sha256-IQeYmqCXhzWsuufrLKeBI2sw86dXbn7c5DbmcoJTWvo="; 20 21 fetchSubmodules = true; 21 22 }; ··· 37 38 ]; 38 39 39 40 buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; 40 - 41 - # rustfmt is brought into scope to fix the following 42 - # warning: cranelift-codegen@0.108.0: 43 - # Failed to run `rustfmt` on ISLE-generated code: Os 44 - # { code: 2, kind: NotFound, message: "No such file or directory" } 45 - nativeBuildInputs = [ 46 - cmake 47 - rustfmt 48 - ]; 41 + nativeBuildInputs = [ cmake ]; 49 42 50 43 doCheck = 51 44 with stdenv.buildPlatform; ··· 65 58 install -m 0644 ''${!outputLib}/lib/* $dev/lib 66 59 rm -r ''${!outputLib}/lib 67 60 61 + # copy the build.rs generated c-api headers 68 62 install -d -m0755 $dev/include/wasmtime 69 - install -m0644 $src/crates/c-api/include/*.h $dev/include 70 - install -m0644 $src/crates/c-api/include/wasmtime/*.h $dev/include/wasmtime 63 + # https://github.com/rust-lang/cargo/issues/9661 64 + install -m0644 \ 65 + target/${cargoShortTarget}/release/build/wasmtime-c-api-impl-*/out/include/*.h \ 66 + $dev/include 67 + install -m0644 \ 68 + target/${cargoShortTarget}/release/build/wasmtime-c-api-impl-*/out/include/wasmtime/*.h \ 69 + $dev/include/wasmtime 71 70 '' 72 71 + lib.optionalString stdenv.hostPlatform.isDarwin '' 73 72 install_name_tool -id \ ··· 75 74 $dev/lib/libwasmtime.dylib 76 75 ''; 77 76 78 - meta = with lib; { 77 + meta = { 79 78 description = "Standalone JIT-style runtime for WebAssembly, using Cranelift"; 80 79 homepage = "https://wasmtime.dev/"; 81 - license = licenses.asl20; 80 + license = lib.licenses.asl20; 82 81 mainProgram = "wasmtime"; 83 - maintainers = with maintainers; [ 82 + maintainers = with lib.maintainers; [ 84 83 ereslibre 85 84 matthewbauer 86 85 ]; 87 - platforms = platforms.unix; 88 - changelog = "https://github.com/bytecodealliance/wasmtime/blob/v${version}/RELEASES.md"; 86 + platforms = lib.platforms.unix; 87 + changelog = "https://github.com/bytecodealliance/wasmtime/blob/v${finalAttrs.version}/RELEASES.md"; 89 88 }; 90 - } 89 + })