rust: fix cross-compilation

This commit is contained in:
Jörg Thalheim
2019-03-29 11:11:00 -04:00
committed by John Ericson
parent 3c930188c8
commit 912dca193a
6 changed files with 196 additions and 126 deletions
+5 -7
View File
@@ -1,13 +1,11 @@
{ stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
, CoreFoundation, Security
, version
, patches ? []
, src }:
}:
rustPlatform.buildRustPackage rec {
name = "cargo-${version}";
inherit version src patches;
name = "cargo-${rustc.version}";
inherit (rustc) version src;
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
@@ -19,8 +17,8 @@ rustPlatform.buildRustPackage rec {
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cacert file curl python openssl cmake zlib makeWrapper libgit2 ]
nativeBuildInputs = [ pkgconfig cmake makeWrapper ];
buildInputs = [ cacert file curl python openssl zlib libgit2 ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
LIBGIT2_SYS_USE_PKG_CONFIG = 1;