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
|
2024-05-15 15:35:15 +00:00
|
|
|
, darwin
|
2022-08-21 13:32:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-wasi";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "0.1.28";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit version;
|
|
|
|
pname = "cargo-wasi-src";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-fmQ23BtcBUPNcgZgvNq85iqdY6WRUhqwAp4aIobqMIw=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
cargoHash = "sha256-yXtxznUp2gECq2CvRByiFzbTjYtWvTheDjGoynJWb+o=";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
|
2024-05-15 15:35:15 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security ]);
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
# 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:
|
2023-10-19 13:55:26 +00:00
|
|
|
# https://github.com/bytecodealliance/cargo-wasi/blob/0.1.28/tests/tests/support.rs#L13-L18
|
2022-08-21 13:32:41 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Lightweight Cargo subcommand to build code for the wasm32-wasi target";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cargo-wasi";
|
2022-08-21 13:32:41 +00:00
|
|
|
homepage = "https://bytecodealliance.github.io/cargo-wasi";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ lucperkins ];
|
|
|
|
};
|
|
|
|
}
|