about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rust/cargo-wasi/default.nix
blob: 7fcdf761ad2fdb923abef9f64b4490d9d574f669 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, rustPlatform
, fetchCrate
, pkg-config
, stdenv
, openssl
, Security
}:

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 [ 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 = "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 ];
  };
}