@@ -1,6 +1,8 @@
11{ stdenv, lib, fetchFromGitHub
2−, rustPlatform, pkgconfig
3−, openssl, Security }:
2+, rustPlatform, pkgconfig, openssl
3+# darwin dependencies
4+, Security, CoreFoundation, libiconv
5+}:
46
57rustPlatform.buildRustPackage rec {
68 pname = "cargo-geiger";
@@ -26,9 +28,16 @@ rustPlatform.buildRustPackage rec {
2628 --skip test_package::case_6
2729 '';
2830
29− buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
31+ buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
3032 nativeBuildInputs = [ pkgconfig ];
3133
34+ # FIXME: Use impure version of CoreFoundation because of missing symbols.
35+ # CFURLSetResourcePropertyForKey is defined in the headers but there's no
36+ # corresponding implementation in the sources from opensource.apple.com.
37+ preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
38+ export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
39+ '';
40+
3241 meta = with lib; {
3342 description = "Detects usage of unsafe Rust in a Rust crate and its dependencies.";
3443 homepage = https://github.com/anderejd/cargo-geiger;