about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorMoritz Ulrich <moritz@tarn-vedra.de>2016-08-08 15:55:26 +0200
committerMoritz Ulrich <moritz@tarn-vedra.de>2016-08-10 21:16:48 +0200
commit57a690fbe4fc046b8e7d59d0657d99451b9784e9 (patch)
tree6b57ba6aae399490998301a6ec9ff05e98676673 /pkgs/development
parent3cfe3ab6b686e3ec633323d8df8b70e782c56cdf (diff)
downloadnixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar.gz
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar.bz2
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar.lz
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar.xz
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.tar.zst
nixlib-57a690fbe4fc046b8e7d59d0657d99451b9784e9.zip
cargo: Force usage of pkgs.cacert.
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/rust/cargo.nix19
-rw-r--r--pkgs/development/compilers/rust/default.nix13
2 files changed, 23 insertions, 9 deletions
diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix
index fc4bf732cf6b..537764ebca2b 100644
--- a/pkgs/development/compilers/rust/cargo.nix
+++ b/pkgs/development/compilers/rust/cargo.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchgit, file, curl, pkgconfig, python, openssl, cmake, zlib
-, makeWrapper, libiconv, cacert, rustPlatform, rustc
-, version, srcRev, srcSha, depsSha256 }:
+, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
+, version, srcRev, srcSha, depsSha256
+, patches ? []}:
 
 rustPlatform.buildRustPackage rec {
   name = "cargo-${version}";
@@ -13,11 +14,14 @@ rustPlatform.buildRustPackage rec {
   };
 
   inherit depsSha256;
+  inherit patches;
 
   passthru.rustc = rustc;
 
-  buildInputs = [ file curl pkgconfig python openssl cmake zlib makeWrapper ]
-    ++ stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = [ file curl pkgconfig python openssl cmake zlib makeWrapper libgit2 ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
+
+  LIBGIT2_SYS_USE_PKG_CONFIG=1;
 
   configurePhase = ''
     ./configure --enable-optimize --prefix=$out --local-cargo=${rustPlatform.rust.cargo}/bin/cargo
@@ -37,9 +41,14 @@ rustPlatform.buildRustPackage rec {
        "$out/lib/rustlib/uninstall.sh" \
        "$out/lib/rustlib/manifest-cargo"
 
+    # NOTE: We override the `http.cainfo` option usually specified in
+    # `.cargo/config`. This is an issue when users want to specify
+    # their own certificate chain as environment variables take
+    # precedence
     wrapProgram "$out/bin/cargo" \
       --suffix PATH : "${rustc}/bin" \
-      --run "export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" \
+      --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"''}
   '';
 
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index adabdd71a1dd..bfab4453a349 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -23,10 +23,15 @@ rec {
   };
 
   cargo = callPackage ./cargo.nix rec {
-    version = "0.11.0";
-    srcRev = "refs/tags/${version}";
-    srcSha = "0ic2093bmwiw6vl2l9yhip87ni6dbz7dhrizy9wdx61229k16hc4";
-    depsSha256 = "0690sgn6fcay7sazlmrbbn4jbhnvmznrpz5z3rvkbaifkjrg4w6d";
+    # TODO: We're temporarily tracking master here as Darwin needs the
+    # `http.cainfo` option from .cargo/config which isn't released
+    # yet.
+
+    version = "master-2016-07-25";
+    srcRev = "f09ef68cc47956ccc5f99212bdcdd15298c400a0";
+    srcSha = "1r6q9jd0fl6mzhwkvrrcv358q2784hg51dfpy28xgh4n61m7c155";
+    depsSha256 = "1p1ygabg9k9b0azm0mrx8asjzdi35c5zw53iysba198lli6bhdl4";
+
     inherit rustc; # the rustc that will be wrapped by cargo
     inherit rustPlatform; # used to build cargo
   };