From 5c8612d90cc9028d6b99804ea08c266a1db7f236 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Wed, 12 Feb 2020 17:00:19 +0100 Subject: [PATCH 1/2] cargo: use bundled libgit2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cargo uses git-rs which is made to be built against the bundled libgit2 version that hasn't been part of a stable release yet. Using our libgit2 instead of the master version fails during runtime as they are not compatible anymore. After the next libgit2 update we can try again but it is likely that there will also be yet another cargo release at that point in timeā€¦ --- pkgs/development/compilers/rust/cargo.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index f639d330566..6259101f6b6 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -1,5 +1,5 @@ { stdenv, file, curl, pkgconfig, python3, openssl, cmake, zlib -, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2 +, makeWrapper, libiconv, cacert, rustPlatform, rustc , CoreFoundation, Security }: @@ -18,10 +18,12 @@ rustPlatform.buildRustPackage { dontUpdateAutotoolsGnuConfigScripts = true; nativeBuildInputs = [ pkgconfig cmake makeWrapper ]; - buildInputs = [ cacert file curl python3 openssl zlib libgit2 ] + buildInputs = [ cacert file curl python3 openssl zlib ] ++ 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 RUSTC_BOOTSTRAP = 1; From e1ed62abc2b5f628a3e1184a757d0be4f0d1228e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 11 Feb 2020 17:52:11 +0000 Subject: [PATCH 2/2] cargo: install man pages I thought about doing a seperate output for these, but they're tiny compared to the size of the binary, so there's no point. (cherry picked from commit 0489c1b4b20d13fa04e6460ead73893889ff2529) --- pkgs/development/compilers/rust/cargo.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 6259101f6b6..6625367262a 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -1,5 +1,5 @@ { stdenv, file, curl, pkgconfig, python3, openssl, cmake, zlib -, makeWrapper, libiconv, cacert, rustPlatform, rustc +, installShellFiles, makeWrapper, libiconv, cacert, rustPlatform, rustc , CoreFoundation, Security }: @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage { # changes hash of vendor directory otherwise dontUpdateAutotoolsGnuConfigScripts = true; - nativeBuildInputs = [ pkgconfig cmake makeWrapper ]; + nativeBuildInputs = [ pkgconfig cmake installShellFiles makeWrapper ]; buildInputs = [ cacert file curl python3 openssl zlib ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; @@ -37,6 +37,8 @@ rustPlatform.buildRustPackage { --suffix PATH : "${rustc}/bin" \ --set CARGO_HTTP_CAINFO "${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 = ''