cargo: Force usage of pkgs.cacert.
This commit is contained in:
parent
3cfe3ab6b6
commit
57a690fbe4
@ -1,6 +1,7 @@
|
|||||||
{ stdenv, fetchgit, file, curl, pkgconfig, python, openssl, cmake, zlib
|
{ stdenv, fetchgit, file, curl, pkgconfig, python, openssl, cmake, zlib
|
||||||
, makeWrapper, libiconv, cacert, rustPlatform, rustc
|
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
|
||||||
, version, srcRev, srcSha, depsSha256 }:
|
, version, srcRev, srcSha, depsSha256
|
||||||
|
, patches ? []}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
name = "cargo-${version}";
|
name = "cargo-${version}";
|
||||||
@ -13,11 +14,14 @@ rustPlatform.buildRustPackage rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inherit depsSha256;
|
inherit depsSha256;
|
||||||
|
inherit patches;
|
||||||
|
|
||||||
passthru.rustc = rustc;
|
passthru.rustc = rustc;
|
||||||
|
|
||||||
buildInputs = [ file curl pkgconfig python openssl cmake zlib makeWrapper ]
|
buildInputs = [ file curl pkgconfig python openssl cmake zlib makeWrapper libgit2 ]
|
||||||
++ stdenv.lib.optional stdenv.isDarwin libiconv;
|
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
|
||||||
|
|
||||||
|
LIBGIT2_SYS_USE_PKG_CONFIG=1;
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
./configure --enable-optimize --prefix=$out --local-cargo=${rustPlatform.rust.cargo}/bin/cargo
|
./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/uninstall.sh" \
|
||||||
"$out/lib/rustlib/manifest-cargo"
|
"$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" \
|
wrapProgram "$out/bin/cargo" \
|
||||||
--suffix PATH : "${rustc}/bin" \
|
--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"''}
|
${stdenv.lib.optionalString stdenv.isDarwin ''--suffix DYLD_LIBRARY_PATH : "${rustc}/lib"''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -23,10 +23,15 @@ rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cargo = callPackage ./cargo.nix rec {
|
cargo = callPackage ./cargo.nix rec {
|
||||||
version = "0.11.0";
|
# TODO: We're temporarily tracking master here as Darwin needs the
|
||||||
srcRev = "refs/tags/${version}";
|
# `http.cainfo` option from .cargo/config which isn't released
|
||||||
srcSha = "0ic2093bmwiw6vl2l9yhip87ni6dbz7dhrizy9wdx61229k16hc4";
|
# yet.
|
||||||
depsSha256 = "0690sgn6fcay7sazlmrbbn4jbhnvmznrpz5z3rvkbaifkjrg4w6d";
|
|
||||||
|
version = "master-2016-07-25";
|
||||||
|
srcRev = "f09ef68cc47956ccc5f99212bdcdd15298c400a0";
|
||||||
|
srcSha = "1r6q9jd0fl6mzhwkvrrcv358q2784hg51dfpy28xgh4n61m7c155";
|
||||||
|
depsSha256 = "1p1ygabg9k9b0azm0mrx8asjzdi35c5zw53iysba198lli6bhdl4";
|
||||||
|
|
||||||
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
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user