depot/third_party/nixpkgs/pkgs/by-name/ca/cargo-wasi/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

39 lines
1.1 KiB
Nix

{ lib
, rustPlatform
, fetchCrate
, pkg-config
, stdenv
, openssl
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-wasi";
version = "0.1.28";
src = fetchCrate {
inherit version;
pname = "cargo-wasi-src";
sha256 = "sha256-fmQ23BtcBUPNcgZgvNq85iqdY6WRUhqwAp4aIobqMIw=";
};
cargoHash = "sha256-yXtxznUp2gECq2CvRByiFzbTjYtWvTheDjGoynJWb+o=";
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ 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.28/tests/tests/support.rs#L13-L18
doCheck = false;
meta = with lib; {
description = "Lightweight Cargo subcommand to build code for the wasm32-wasi target";
mainProgram = "cargo-wasi";
homepage = "https://bytecodealliance.github.io/cargo-wasi";
license = licenses.asl20;
maintainers = with maintainers; [ lucperkins ];
};
}