2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2019-04-01 02:48:12 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-02-11 10:34:23 +00:00
|
|
|
, libressl
|
2019-08-08 03:52:01 +01:00
|
|
|
, curl
|
|
|
|
, Security
|
2019-04-01 02:48:12 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "wasm-pack";
|
2020-02-11 10:34:23 +00:00
|
|
|
version = "0.9.1";
|
2019-04-01 02:48:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustwasm";
|
|
|
|
repo = "wasm-pack";
|
|
|
|
rev = "v${version}";
|
2020-02-11 10:34:23 +00:00
|
|
|
sha256 = "1rqyfg6ajxxyfx87ar25nf5ck9hd0p12qgv98dicniqag8l4rvsr";
|
2019-04-01 02:48:12 +01:00
|
|
|
};
|
|
|
|
|
2021-02-23 22:06:47 +00:00
|
|
|
cargoPatches = [
|
|
|
|
./update-deps.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoSha256 = "0br7r8wz3knzgl3gjpq6z8w33my0yiaq711s1wih9jizhia02y5r";
|
2019-04-01 02:48:12 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2019-04-01 02:48:12 +01:00
|
|
|
|
2020-02-11 10:34:23 +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-01-23 12:26:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ curl Security ];
|
2019-08-08 03:52:01 +01:00
|
|
|
|
2020-02-11 10:34:23 +00:00
|
|
|
# Most tests rely on external resources and build artifacts.
|
|
|
|
# Disabling check here to work with build sandboxing.
|
2019-04-01 02:48:12 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-04-01 02:48:12 +01:00
|
|
|
description = "A utility that builds rust-generated WebAssembly package";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/rustwasm/wasm-pack";
|
2019-04-01 02:48:12 +01:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = [ maintainers.dhkl ];
|
|
|
|
};
|
|
|
|
}
|