2022-05-09 17:18:27 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
# darwin dependencies
|
2023-04-23 11:52:55 +00:00
|
|
|
, darwin
|
2022-05-09 17:18:27 +00:00
|
|
|
, libiconv
|
|
|
|
, curl
|
2019-11-06 19:23:32 +00:00
|
|
|
}:
|
2019-11-02 22:27:34 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-geiger";
|
2024-05-10 19:47:30 +00:00
|
|
|
version = "0.11.7";
|
2019-11-02 22:27:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-01-30 02:40:49 +00:00
|
|
|
owner = "rust-secure-code";
|
2019-11-02 22:27:34 +00:00
|
|
|
repo = pname;
|
2024-05-10 19:47:30 +00:00
|
|
|
rev = "cargo-geiger@v${version}";
|
|
|
|
hash = "sha256-/5yuayqneZV6aVQ6YFgqNS2XY3W6yETRQ0kE5ovc7p8=";
|
2019-11-02 22:27:34 +00:00
|
|
|
};
|
2024-08-10 12:17:42 +00:00
|
|
|
|
|
|
|
cargoPatches = [
|
|
|
|
# https://github.com/geiger-rs/cargo-geiger/pull/528
|
|
|
|
./fix-build-with-rust-1.80.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoHash = "sha256-511KeTykHw3xbnsuwIt2QmBK3mG9yK23z0yrS3eIY74=";
|
2024-05-10 19:47:30 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./allow-warnings.patch
|
|
|
|
];
|
2019-11-04 00:13:08 +00:00
|
|
|
|
2022-05-09 17:18:27 +00:00
|
|
|
buildInputs = [ openssl ]
|
2023-04-23 11:52:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation Security libiconv curl ]);
|
2022-05-09 17:18:27 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ]
|
|
|
|
# curl-sys wants to run curl-config on darwin
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ curl.dev ];
|
2019-11-06 19:23:32 +00:00
|
|
|
|
2022-01-21 22:34:38 +00:00
|
|
|
# skip tests with networking or other failures
|
|
|
|
checkFlags = [
|
2024-05-10 19:47:30 +00:00
|
|
|
"--skip serialize_test1_quick_report"
|
2022-01-21 22:34:38 +00:00
|
|
|
"--skip serialize_test2_quick_report"
|
|
|
|
"--skip serialize_test3_quick_report"
|
2024-05-10 19:47:30 +00:00
|
|
|
"--skip serialize_test4_quick_report"
|
2022-01-21 22:34:38 +00:00
|
|
|
"--skip serialize_test6_quick_report"
|
2024-05-10 19:47:30 +00:00
|
|
|
"--skip serialize_test7_quick_report"
|
|
|
|
"--skip serialize_test1_report"
|
2022-01-21 22:34:38 +00:00
|
|
|
"--skip serialize_test2_report"
|
|
|
|
"--skip serialize_test3_report"
|
2024-05-10 19:47:30 +00:00
|
|
|
"--skip serialize_test4_report"
|
2022-01-21 22:34:38 +00:00
|
|
|
"--skip serialize_test6_report"
|
2024-05-10 19:47:30 +00:00
|
|
|
"--skip serialize_test7_report"
|
2023-04-23 11:52:55 +00:00
|
|
|
# multiple test cases that time-out or cause memory leaks
|
|
|
|
"--skip test_package"
|
2022-01-21 22:34:38 +00:00
|
|
|
"--skip test_package_update_readme::case_2"
|
|
|
|
"--skip test_package_update_readme::case_3"
|
|
|
|
"--skip test_package_update_readme::case_5"
|
|
|
|
];
|
|
|
|
|
2019-11-02 22:27:34 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/rust-secure-code/cargo-geiger";
|
2024-05-10 19:47:30 +00:00
|
|
|
changelog = "https://github.com/rust-secure-code/cargo-geiger/blob/cargo-geiger-${version}/CHANGELOG.md";
|
2022-01-21 22:34:38 +00:00
|
|
|
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "cargo-geiger";
|
2022-01-21 22:34:38 +00:00
|
|
|
longDescription = ''
|
|
|
|
A cargo plugin that detects the usage of unsafe Rust in a Rust crate and
|
|
|
|
its dependencies. It provides information to aid auditing and guide
|
|
|
|
dependency selection but it can not help you decide when and why unsafe
|
|
|
|
code is appropriate.
|
|
|
|
'';
|
2019-11-02 22:27:34 +00:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2024-05-10 20:27:54 +00:00
|
|
|
maintainers = with maintainers; [ evanjs gepbird jk matthiasbeyer ];
|
2019-11-02 22:27:34 +00:00
|
|
|
};
|
|
|
|
}
|