1{ lib
2, rustPlatform
3, fetchCrate
4, nodejs
5, pkg-config
6, openssl
7, stdenv
8, curl
9, Security
10, runCommand
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "wasm-bindgen-cli";
15 version = "0.2.83";
16
17 src = fetchCrate {
18 inherit pname version;
19 sha256 = "sha256-+PWxeRL5MkIfJtfN3/DjaDlqRgBgWZMa6dBt1Q+lpd0=";
20 };
21
22 cargoSha256 = "sha256-GwLeA6xLt7I+NzRaqjwVpt1pzRex1/snq30DPv4FR+g=";
23
24 nativeBuildInputs = [ pkg-config ];
25
26 buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ curl Security ];
27
28 checkInputs = [ nodejs ];
29
30 # other tests require it to be ran in the wasm-bindgen monorepo
31 cargoTestFlags = [ "--test=interface-types" ];
32
33 meta = with lib; {
34 homepage = "https://rustwasm.github.io/docs/wasm-bindgen/";
35 license = with licenses; [ asl20 /* or */ mit ];
36 description = "Facilitating high-level interactions between wasm modules and JavaScript";
37 maintainers = with maintainers; [ nitsky rizary ];
38 mainProgram = "wasm-bindgen";
39 };
40}