1{ lib
2, rustPlatform
3, fetchCrate
4, nix-update-script
5, nodejs
6, pkg-config
7, openssl
8, stdenv
9, curl
10, Security
11, version ? "0.2.92"
12, hash ? "sha256-1VwY8vQy7soKEgbki4LD+v259751kKxSxmo/gqE6yV0="
13, cargoHash ? "sha256-aACJ+lYNEU8FFBs158G1/JG8sc6Rq080PeKCMnwdpH0="
14}:
15
16rustPlatform.buildRustPackage rec {
17 pname = "wasm-bindgen-cli";
18 inherit version hash cargoHash;
19
20 src = fetchCrate {
21 inherit pname version hash;
22 };
23
24 nativeBuildInputs = [ pkg-config ];
25
26 buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ curl Security ];
27
28 nativeCheckInputs = [ nodejs ];
29
30 # tests require it to be ran in the wasm-bindgen monorepo
31 doCheck = false;
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; [ rizary ];
38 mainProgram = "wasm-bindgen";
39 };
40
41 passthru.updateScript = nix-update-script { };
42}