mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
85f96822a0
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in which cargo vendor erroneously changed permissions of vendored crates. This was fixed in Rust 1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are potentially broken. This change updates cargoSha256/cargoHash tree-wide. Fixes #121994.
43 lines
1.3 KiB
Nix
43 lines
1.3 KiB
Nix
{ stdenv, lib, fetchFromGitHub
|
|
, rustPlatform, pkg-config, openssl
|
|
# testing packages
|
|
, cargo-insta
|
|
# darwin dependencies
|
|
, Security, CoreFoundation, libiconv
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "cargo-geiger";
|
|
version = "0.10.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rust-secure-code";
|
|
repo = pname;
|
|
rev = "${pname}-${version}";
|
|
sha256 = "1z920p8i3gkjadyd6bqjk4i5yr5ds3m3sbcnf7plcqr69dsjr4b8";
|
|
};
|
|
|
|
cargoSha256 = "1wf9758gyaxgyajjzy5phirg922n9wv0qmy67zjmxj56ayf0l9lm";
|
|
|
|
checkPhase = ''
|
|
${cargo-insta}/bin/cargo-insta test
|
|
'';
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
# 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.
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
|
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Detects usage of unsafe Rust in a Rust crate and its dependencies";
|
|
homepage = "https://github.com/rust-secure-code/cargo-geiger";
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
maintainers = with maintainers; [ evanjs ];
|
|
};
|
|
}
|