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