cargo: don't use vendored curl

Using the curl from Nixpkgs will fix Cargo 0.55.0 on Darwin.
This commit is contained in:
Alyssa Ross 2021-09-10 09:26:04 +00:00
parent 0f89cfc988
commit a43efb9884
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -1,4 +1,5 @@
{ lib, stdenv, file, curl, pkg-config, python3, openssl, cmake, zlib
{ lib, stdenv, pkgsHostHost
, file, curl, pkg-config, python3, openssl, cmake, zlib
, installShellFiles, makeWrapper, cacert, rustPlatform, rustc
, CoreFoundation, Security
}:
@ -16,7 +17,10 @@ rustPlatform.buildRustPackage {
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
nativeBuildInputs = [ pkg-config cmake installShellFiles makeWrapper ];
nativeBuildInputs = [
pkg-config cmake installShellFiles makeWrapper
(lib.getDev pkgsHostHost.curl)
];
buildInputs = [ cacert file curl python3 openssl zlib ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
@ -54,6 +58,14 @@ rustPlatform.buildRustPackage {
# Disable check phase as there are failures (4 tests fail)
doCheck = false;
doInstallCheck = !stdenv.hostPlatform.isStatic &&
stdenv.hostPlatform.parsed.kernel.execFormat == lib.systems.parse.execFormats.elf;
installCheckPhase = ''
runHook preInstallCheck
readelf -a $out/bin/.cargo-wrapped | grep -F 'Shared library: [libcurl.so'
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://crates.io";
description = "Downloads your Rust project's dependencies and builds your project";