about summary refs log tree commit diff
path: root/pkgs/by-name/ca/cargo-information/package.nix
blob: e1ad75f3f2e301e38f45fe2a409828ef450cd94d (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, rustPlatform
, fetchFromGitHub
, makeWrapper
, pkg-config
, openssl
, rustc
, stdenv
, darwin
}:

rustPlatform.buildRustPackage rec {
  pname = "cargo-information";
  version = "0.6.0";

  src = fetchFromGitHub {
    owner = "hi-rustin";
    repo = "cargo-information";
    rev = "v${version}";
    hash = "sha256-5F8O8M8cz7sdXtqGYuDIeTolovZjx2BLEBCZuBIb9YA=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "cargo-test-macro-0.1.0" = "sha256-4u3Ium+WYBdyocuehDulRgUOR74JC6AUI2+A5xlnUGw=";
    };
  };

  checkFlags = [
    # Require network access
    "--skip=cargo_information::specify_version_within_ws_and_match_with_lockfile::case"
    "--skip=cargo_information::within_ws::case"
    "--skip=cargo_information::within_ws_with_alternative_registry::case"
    "--skip=cargo_information::within_ws_without_lockfile::case"
    "--skip=cargo_information::transitive_dependency_within_ws::case"
  ];

  nativeBuildInputs = [
    pkg-config
    makeWrapper
  ];

  buildInputs = [
    openssl
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.Security
  ];

  postFixup = ''
    wrapProgram $out/bin/cargo-info \
      --prefix PATH : ${lib.makeBinPath [ rustc ]}
  '';

  meta = with lib; {
    description = "A cargo subcommand to show information about crates";
    mainProgram = "cargo-info";
    homepage = "https://github.com/hi-rustin/cargo-information";
    changelog = "https://github.com/hi-rustin/cargo-information/blob/v${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ eopb ];
  };
}