Merge pull request #79930 from andir/cargo-no-system-libgit2

cargo: use bundled libgit2
This commit is contained in:
Andreas Rammhold 2020-02-12 23:21:46 +01:00 committed by GitHub
commit b86512e893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
{ stdenv, file, curl, pkgconfig, python3, openssl, cmake, zlib { stdenv, file, curl, pkgconfig, python3, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2 , installShellFiles, makeWrapper, libiconv, cacert, rustPlatform, rustc
, CoreFoundation, Security , CoreFoundation, Security
}: }:
@ -17,11 +17,13 @@ rustPlatform.buildRustPackage {
# changes hash of vendor directory otherwise # changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true; dontUpdateAutotoolsGnuConfigScripts = true;
nativeBuildInputs = [ pkgconfig cmake makeWrapper ]; nativeBuildInputs = [ pkgconfig cmake installShellFiles makeWrapper ];
buildInputs = [ cacert file curl python3 openssl zlib libgit2 ] buildInputs = [ cacert file curl python3 openssl zlib ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
LIBGIT2_SYS_USE_PKG_CONFIG = 1; # cargo uses git-rs which is made for a version of libgit2 from recent master that
# is not compatible with the current version in nixpkgs.
#LIBGIT2_SYS_USE_PKG_CONFIG = 1;
# fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel # fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel
RUSTC_BOOTSTRAP = 1; RUSTC_BOOTSTRAP = 1;
@ -35,6 +37,8 @@ rustPlatform.buildRustPackage {
--suffix PATH : "${rustc}/bin" \ --suffix PATH : "${rustc}/bin" \
--set CARGO_HTTP_CAINFO "${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" --set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
installManPage src/tools/cargo/src/etc/man/*
''; '';
checkPhase = '' checkPhase = ''