2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, libressl
|
|
|
|
, curl
|
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wasm-pack";
|
|
|
|
version = "0.9.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustwasm";
|
|
|
|
repo = "wasm-pack";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1rqyfg6ajxxyfx87ar25nf5ck9hd0p12qgv98dicniqag8l4rvsr";
|
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
cargoPatches = [
|
|
|
|
./update-deps.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoSha256 = "0br7r8wz3knzgl3gjpq6z8w33my0yiaq711s1wih9jizhia02y5r";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
# LibreSSL works around segfault issues caused by OpenSSL being unable to
|
|
|
|
# gracefully exit while doing work.
|
|
|
|
# See: https://github.com/rustwasm/wasm-pack/issues/650
|
|
|
|
libressl
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ curl Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Most tests rely on external resources and build artifacts.
|
|
|
|
# Disabling check here to work with build sandboxing.
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A utility that builds rust-generated WebAssembly package";
|
|
|
|
homepage = "https://github.com/rustwasm/wasm-pack";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = [ maintainers.dhkl ];
|
|
|
|
};
|
|
|
|
}
|