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 failures #172226

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions pkgs/development/tools/rust/cargo-geiger/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{ stdenv, lib, fetchFromGitHub
, rustPlatform, pkg-config, openssl
# darwin dependencies
, Security, CoreFoundation, libiconv
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
, pkg-config
, openssl
# darwin dependencies
, Security
, CoreFoundation
, libiconv
, curl
}:

rustPlatform.buildRustPackage rec {
Expand All @@ -16,15 +23,11 @@ rustPlatform.buildRustPackage rec {
};
cargoSha256 = "sha256-i7xDEzZAN2ubW1Q6MhY+xsb9XiUajNDHLdtDuO5r6jA=";

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"
'';
buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv curl ];
nativeBuildInputs = [ pkg-config ]
# curl-sys wants to run curl-config on darwin
++ lib.optionals stdenv.isDarwin [ curl.dev ];

# skip tests with networking or other failures
checkFlags = [
Expand Down