cargo: fix darwin build

It depends the Security framework now.
This commit is contained in:
Daiderd Jordan 2018-10-26 16:06:56 +01:00
parent 0d64e81ce6
commit 1b47b95638
No known key found for this signature in database
GPG Key ID: D02435D05B810C96
3 changed files with 11 additions and 13 deletions

View File

@ -1,13 +1,10 @@
{ stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib { stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
, CoreFoundation, Security
, version , version
, patches ? [] , patches ? []
, src }: , src }:
let
inherit (darwin.apple_sdk.frameworks) CoreFoundation;
in
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
name = "cargo-${version}"; name = "cargo-${version}";
inherit version src patches; inherit version src patches;
@ -24,7 +21,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cacert file curl python openssl cmake zlib makeWrapper libgit2 ] buildInputs = [ cacert file curl python openssl cmake zlib makeWrapper libgit2 ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation libiconv ]; ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
LIBGIT2_SYS_USE_PKG_CONFIG=1; LIBGIT2_SYS_USE_PKG_CONFIG=1;

View File

@ -1,4 +1,5 @@
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl { stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
, CoreFoundation, Security
, targets ? [] , targets ? []
, targetToolchains ? [] , targetToolchains ? []
, targetPatches ? [] , targetPatches ? []
@ -44,8 +45,7 @@ in rec {
cargo = callPackage ./cargo.nix rec { cargo = callPackage ./cargo.nix rec {
version = cargoVersion; version = cargoVersion;
inherit src; inherit src stdenv CoreFoundation Security;
inherit stdenv;
inherit rustc; # the rustc that will be wrapped by cargo inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo inherit rustPlatform; # used to build cargo
}; };

View File

@ -7327,10 +7327,11 @@ with pkgs;
}; };
# For beta and nightly releases use the nixpkgs-mozilla overlay # For beta and nightly releases use the nixpkgs-mozilla overlay
rust = callPackage ../development/compilers/rust rust = callPackage ../development/compilers/rust ({
(stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4' } // stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
}); stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
});
inherit (rust) cargo rustc; inherit (rust) cargo rustc;
buildRustCrate = callPackage ../build-support/rust/build-rust-crate { }; buildRustCrate = callPackage ../build-support/rust/build-rust-crate { };
@ -21152,7 +21153,7 @@ with pkgs;
liblapackWithAtlas = liblapack; liblapackWithAtlas = liblapack;
liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { }; liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
lrs = callPackage ../development/libraries/science/math/lrs { }; lrs = callPackage ../development/libraries/science/math/lrs { };
m4ri = callPackage ../development/libraries/science/math/m4ri { }; m4ri = callPackage ../development/libraries/science/math/m4ri { };