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";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustwasm";
|
|
|
|
repo = "wasm-pack";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-oIMS0kln+HCW9kFfLU+Vi0/4EYKYzzlA1BQHZNQkJMI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
cargoHash = "sha256-l6zn714DMQ+frU9Mppz4LuGY6Zf9qmxZ9MuwIvYvQMU=";
|
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
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|