cargo: fix darwin build
This commit is contained in:
parent
2805444f96
commit
cf9e6f3a18
@ -3,6 +3,10 @@
|
||||
, version, srcSha, cargoSha256
|
||||
, patches ? [] }:
|
||||
|
||||
let
|
||||
inherit (darwin.apple_sdk.frameworks) CoreFoundation;
|
||||
in
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
name = "cargo-${version}";
|
||||
inherit version;
|
||||
@ -21,12 +25,16 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ file curl python openssl cmake zlib makeWrapper libgit2 ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation libiconv ];
|
||||
|
||||
LIBGIT2_SYS_USE_PKG_CONFIG=1;
|
||||
|
||||
# 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.
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation libiconv ];
|
||||
|
||||
LIBGIT2_SYS_USE_PKG_CONFIG=1;
|
||||
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# NOTE: We override the `http.cainfo` option usually specified in
|
||||
@ -36,8 +44,7 @@ rustPlatform.buildRustPackage rec {
|
||||
wrapProgram "$out/bin/cargo" \
|
||||
--suffix PATH : "${rustc}/bin" \
|
||||
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
||||
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
||||
${stdenv.lib.optionalString stdenv.isDarwin ''--suffix DYLD_LIBRARY_PATH : "${rustc}/lib"''}
|
||||
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user