2019-11-02 22:27:34 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
2021-01-19 06:50:56 +00:00
|
|
|
, rustPlatform, pkg-config, openssl
|
2019-11-06 19:23:32 +00:00
|
|
|
# darwin dependencies
|
|
|
|
, Security, CoreFoundation, libiconv
|
|
|
|
}:
|
2019-11-02 22:27:34 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-geiger";
|
2022-01-21 22:34:38 +00:00
|
|
|
version = "0.11.2";
|
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;
|
|
|
|
rev = "${pname}-${version}";
|
2022-01-21 22:34:38 +00:00
|
|
|
sha256 = "sha256-KkOLDSnLneal3m+CrYKKIoeO61rjXEDq4GK3kPwQxj4=";
|
2019-11-02 22:27:34 +00:00
|
|
|
};
|
2022-01-21 22:34:38 +00:00
|
|
|
cargoSha256 = "sha256-i7xDEzZAN2ubW1Q6MhY+xsb9XiUajNDHLdtDuO5r6jA=";
|
2019-11-04 00:13:08 +00:00
|
|
|
|
2019-11-06 19:23:32 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2019-11-02 22:27:34 +00:00
|
|
|
|
2019-11-06 19:23:32 +00:00
|
|
|
# FIXME: Use impure version of CoreFoundation because of missing symbols.
|
|
|
|
# CFURLSetResourcePropertyForKey is defined in the headers but there's no
|
|
|
|
# corresponding implementation in the sources from opensource.apple.com.
|
2021-01-23 12:26:19 +00:00
|
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
2019-11-06 19:23:32 +00:00
|
|
|
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
|
|
|
|
'';
|
|
|
|
|
2022-01-21 22:34:38 +00:00
|
|
|
# skip tests with networking or other failures
|
|
|
|
checkFlags = [
|
|
|
|
"--skip serialize_test2_quick_report"
|
|
|
|
"--skip serialize_test3_quick_report"
|
|
|
|
"--skip serialize_test6_quick_report"
|
|
|
|
"--skip serialize_test2_report"
|
|
|
|
"--skip serialize_test3_report"
|
|
|
|
"--skip serialize_test6_report"
|
|
|
|
"--skip test_package::case_2"
|
|
|
|
"--skip test_package::case_3"
|
|
|
|
"--skip test_package::case_6"
|
|
|
|
"--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 02:11:51 +01:00
|
|
|
homepage = "https://github.com/rust-secure-code/cargo-geiger";
|
2022-01-21 22:34:38 +00:00
|
|
|
changelog = "https://github.com/rust-secure-code/cargo-geiger/blob/${pname}-${version}/CHANGELOG.md";
|
|
|
|
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
|
|
|
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 ];
|
2022-01-21 22:34:38 +00:00
|
|
|
maintainers = with maintainers; [ evanjs jk ];
|
2019-11-02 22:27:34 +00:00
|
|
|
};
|
|
|
|
}
|