2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2019-04-01 03:48:12 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2021-01-19 07:50:56 +01:00
|
|
|
, pkg-config
|
2020-02-11 11:34:23 +01:00
|
|
|
, libressl
|
2019-08-08 04:52:01 +02:00
|
|
|
, curl
|
|
|
|
, Security
|
2019-04-01 03:48:12 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 13:41:23 +02:00
|
|
|
pname = "wasm-pack";
|
2021-12-22 02:53:42 +01:00
|
|
|
version = "0.10.2";
|
2019-04-01 03:48:12 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustwasm";
|
|
|
|
repo = "wasm-pack";
|
|
|
|
rev = "v${version}";
|
2021-12-22 02:53:42 +01:00
|
|
|
sha256 = "sha256-nhO/SLeJTq2viDqsJCRNLbgjyDKRli3RWExUNzKT9ug=";
|
2019-04-01 03:48:12 +02:00
|
|
|
};
|
|
|
|
|
2021-12-22 02:53:42 +01:00
|
|
|
cargoSha256 = "sha256-6qrCHpg92IRPsf/dK6xcLGX8BLmqox3vgLRqsV4ubsY=";
|
2019-04-01 03:48:12 +02:00
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2019-04-01 03:48:12 +02:00
|
|
|
|
2020-02-11 11:34:23 +01: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 13:26:19 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ curl Security ];
|
2019-08-08 04:52:01 +02:00
|
|
|
|
2021-09-20 21:38:53 +02:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
2020-02-11 11:34:23 +01:00
|
|
|
# Most tests rely on external resources and build artifacts.
|
|
|
|
# Disabling check here to work with build sandboxing.
|
2019-04-01 03:48:12 +02:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-04-01 03:48:12 +02:00
|
|
|
description = "A utility that builds rust-generated WebAssembly package";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/rustwasm/wasm-pack";
|
2019-04-01 03:48:12 +02:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = [ maintainers.dhkl ];
|
|
|
|
};
|
|
|
|
}
|