Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo-geiger: fix darwin build #72927

Merged
merged 1 commit into from Nov 7, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1,6 +1,8 @@
{ stdenv, lib, fetchFromGitHub
, rustPlatform, pkgconfig
, openssl, Security }:
, rustPlatform, pkgconfig, openssl
# darwin dependencies
, Security, CoreFoundation, libiconv
}:

rustPlatform.buildRustPackage rec {
pname = "cargo-geiger";
@@ -26,9 +28,16 @@ rustPlatform.buildRustPackage rec {
--skip test_package::case_6
'';

buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
nativeBuildInputs = [ pkgconfig ];

# 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 = stdenv.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/anderejd/cargo-geiger;
@@ -8535,7 +8535,8 @@ in
cargo-expand = callPackage ../development/tools/rust/cargo-expand { };
cargo-fuzz = callPackage ../development/tools/rust/cargo-fuzz { };
cargo-geiger = callPackage ../development/tools/rust/cargo-geiger {
inherit (darwin.apple_sdk.frameworks) Security;
inherit (darwin) libiconv;
inherit (darwin.apple_sdk.frameworks) Security CoreFoundation;
};
cargo-inspect = callPackage ../development/tools/rust/cargo-inspect {
inherit (darwin.apple_sdk.frameworks) Security;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.