2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
2022-08-21 13:32:41 +00:00
|
|
|
, rustPlatform
|
2022-11-21 17:40:18 +00:00
|
|
|
, fetchCrate
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, openssl
|
2022-08-21 13:32:41 +00:00
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-wasi";
|
|
|
|
version = "0.1.26";
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit version;
|
|
|
|
pname = "cargo-wasi-src";
|
|
|
|
sha256 = "sha256-/u5GKqGwJWS6Gzc1WZ7O5ZSHHGoqBVZ4jQDEIfAyciE=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cargoSha256 = "sha256-eF3HrulY7HrKseCYyZyC2EuWboFvmia2qLymBxvopKI=";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
|
|
|
# Checks need to be disabled here because the current test suite makes assumptions
|
|
|
|
# about the surrounding environment that aren't Nix friendly. See these lines for specifics:
|
|
|
|
# https://github.com/bytecodealliance/cargo-wasi/blob/0.1.26/tests/tests/support.rs#L13-L18
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A lightweight Cargo subcommand to build code for the wasm32-wasi target";
|
|
|
|
homepage = "https://bytecodealliance.github.io/cargo-wasi";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ lucperkins ];
|
|
|
|
};
|
|
|
|
}
|