2021-06-28 23:13:55 +00:00
|
|
|
{ rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, curl
|
|
|
|
, Security
|
2020-07-18 16:06:22 +00:00
|
|
|
, runCommand
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasm-bindgen-cli";
|
2021-08-11 14:56:57 +00:00
|
|
|
version = "0.2.75";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
src =
|
|
|
|
let
|
|
|
|
tarball = fetchFromGitHub {
|
|
|
|
owner = "rustwasm";
|
|
|
|
repo = "wasm-bindgen";
|
|
|
|
rev = version;
|
2021-08-11 14:56:57 +00:00
|
|
|
hash = "sha256-eRAe6/v0Xrtd1d2k6p0WETZ2vkQkiDRZOds7y0DidY0=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
2021-06-28 23:13:55 +00:00
|
|
|
in
|
|
|
|
runCommand "source" { } ''
|
2020-07-18 16:06:22 +00:00
|
|
|
cp -R ${tarball} $out
|
|
|
|
chmod -R +w $out
|
|
|
|
cp ${./Cargo.lock} $out/Cargo.lock
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security curl ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-11 14:56:57 +00:00
|
|
|
cargoHash = "sha256-xZrGBRnsBQKvqGkZyU7FQCkx0dHt/hXlrVLSvGKx27k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
cargoBuildFlags = [ "-p" pname ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://rustwasm.github.io/docs/wasm-bindgen/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = "Facilitating high-level interactions between wasm modules and JavaScript";
|
2021-08-11 14:56:57 +00:00
|
|
|
maintainers = with maintainers; [ ma27 nitsky rizary ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|