2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
# darwin dependencies
|
2023-04-29 16:46:19 +00:00
|
|
|
, darwin
|
2022-05-18 14:49:53 +00:00
|
|
|
, libiconv
|
|
|
|
, curl
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-geiger";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.11.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rust-secure-code";
|
|
|
|
repo = pname;
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "cargo-geiger@v${version}";
|
|
|
|
hash = "sha256-/5yuayqneZV6aVQ6YFgqNS2XY3W6yETRQ0kE5ovc7p8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
|
|
|
|
cargoPatches = [
|
|
|
|
# https://github.com/geiger-rs/cargo-geiger/pull/528
|
|
|
|
./fix-build-with-rust-1.80.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoHash = "sha256-511KeTykHw3xbnsuwIt2QmBK3mG9yK23z0yrS3eIY74=";
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./allow-warnings.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
buildInputs = [ openssl ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation Security libiconv curl ]);
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ]
|
|
|
|
# curl-sys wants to run curl-config on darwin
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ curl.dev ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
# skip tests with networking or other failures
|
|
|
|
checkFlags = [
|
2024-05-15 15:35:15 +00:00
|
|
|
"--skip serialize_test1_quick_report"
|
2022-01-25 03:21:06 +00:00
|
|
|
"--skip serialize_test2_quick_report"
|
|
|
|
"--skip serialize_test3_quick_report"
|
2024-05-15 15:35:15 +00:00
|
|
|
"--skip serialize_test4_quick_report"
|
2022-01-25 03:21:06 +00:00
|
|
|
"--skip serialize_test6_quick_report"
|
2024-05-15 15:35:15 +00:00
|
|
|
"--skip serialize_test7_quick_report"
|
|
|
|
"--skip serialize_test1_report"
|
2022-01-25 03:21:06 +00:00
|
|
|
"--skip serialize_test2_report"
|
|
|
|
"--skip serialize_test3_report"
|
2024-05-15 15:35:15 +00:00
|
|
|
"--skip serialize_test4_report"
|
2022-01-25 03:21:06 +00:00
|
|
|
"--skip serialize_test6_report"
|
2024-05-15 15:35:15 +00:00
|
|
|
"--skip serialize_test7_report"
|
2023-04-29 16:46:19 +00:00
|
|
|
# multiple test cases that time-out or cause memory leaks
|
|
|
|
"--skip test_package"
|
2022-01-25 03:21:06 +00:00
|
|
|
"--skip test_package_update_readme::case_2"
|
|
|
|
"--skip test_package_update_readme::case_3"
|
|
|
|
"--skip test_package_update_readme::case_5"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/rust-secure-code/cargo-geiger";
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/rust-secure-code/cargo-geiger/blob/cargo-geiger-${version}/CHANGELOG.md";
|
2022-01-25 03:21:06 +00:00
|
|
|
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cargo-geiger";
|
2022-01-25 03:21:06 +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.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ evanjs gepbird jk matthiasbeyer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|