Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ca / cargo-geiger / package.nix
blobac3338a68a4bbb11be0844b271ac0a258cac5ef9
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , rustPlatform
5 , pkg-config
6 , openssl
7   # darwin dependencies
8 , darwin
9 , libiconv
10 , curl
13 rustPlatform.buildRustPackage rec {
14   pname = "cargo-geiger";
15   version = "0.11.7";
17   src = fetchFromGitHub {
18     owner = "rust-secure-code";
19     repo = pname;
20     rev = "cargo-geiger@v${version}";
21     hash = "sha256-/5yuayqneZV6aVQ6YFgqNS2XY3W6yETRQ0kE5ovc7p8=";
22   };
23   cargoHash = "sha256-lhojo3dhsM9y1SxpVMH93yv+JeNfTL7VLsbTp9ErgIQ=";
25   patches = [
26     ./allow-warnings.patch
27   ];
29   buildInputs = [ openssl ]
30     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation Security libiconv curl ]);
31   nativeBuildInputs = [ pkg-config ]
32     # curl-sys wants to run curl-config on darwin
33     ++ lib.optionals stdenv.isDarwin [ curl.dev ];
35   # skip tests with networking or other failures
36   checkFlags = [
37     "--skip serialize_test1_quick_report"
38     "--skip serialize_test2_quick_report"
39     "--skip serialize_test3_quick_report"
40     "--skip serialize_test4_quick_report"
41     "--skip serialize_test6_quick_report"
42     "--skip serialize_test7_quick_report"
43     "--skip serialize_test1_report"
44     "--skip serialize_test2_report"
45     "--skip serialize_test3_report"
46     "--skip serialize_test4_report"
47     "--skip serialize_test6_report"
48     "--skip serialize_test7_report"
49     # multiple test cases that time-out or cause memory leaks
50     "--skip test_package"
51     "--skip test_package_update_readme::case_2"
52     "--skip test_package_update_readme::case_3"
53     "--skip test_package_update_readme::case_5"
54   ];
56   meta = with lib; {
57     homepage = "https://github.com/rust-secure-code/cargo-geiger";
58     changelog = "https://github.com/rust-secure-code/cargo-geiger/blob/cargo-geiger-${version}/CHANGELOG.md";
59     description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
60     mainProgram = "cargo-geiger";
61     longDescription = ''
62       A cargo plugin that detects the usage of unsafe Rust in a Rust crate and
63       its dependencies. It provides information to aid auditing and guide
64       dependency selection but it can not help you decide when and why unsafe
65       code is appropriate.
66     '';
67     license = with licenses; [ asl20 /* or */ mit ];
68     maintainers = with maintainers; [ evanjs gepbird jk matthiasbeyer ];
69   };