Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkgs/development/compilers/rust/binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ rec {
patchShebangs ./install.sh
./install.sh --prefix=$out \
--components=cargo

wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin"
'';
};
}
23 changes: 18 additions & 5 deletions pkgs/development/compilers/rust/cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, CoreFoundation, Security
}:

rustPlatform.buildRustPackage {
stdenv.mkDerivation {
pname = "cargo";
inherit (rustc) version src;

Expand All @@ -17,11 +17,26 @@ rustPlatform.buildRustPackage {
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;

configurePhase = ''
runHook preConfigure
runHook postConfigure
'';

nativeBuildInputs = [
pkg-config cmake installShellFiles makeWrapper
pkg-config installShellFiles makeWrapper zlib
(lib.getDev pkgsHostHost.curl)

rustc
rustPlatform.cargoSetupHook
rustPlatform.cargoInstallHook
rustPlatform.cargoBuildHook
rustPlatform.cargoCheckHook
];
buildInputs = [ cacert file curl python3 openssl zlib ]

cargoBuildType = "release";
cargoCheckType = "release";

buildInputs = [ cacert file curl python3 openssl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];

# cargo uses git-rs which is made for a version of libgit2 from recent master that
Expand Down Expand Up @@ -72,7 +87,5 @@ rustPlatform.buildRustPackage {
maintainers = with maintainers; [ retrry ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.unix;
# weird segfault in a build script
broken = stdenv.targetPlatform.isMusl && !stdenv.targetPlatform.isStatic;
};
}
2 changes: 2 additions & 0 deletions pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ in stdenv.mkDerivation rec {

# Useful debugging parameter
# export VERBOSE=1

sed -i "s/base.crt_static_default = true/base.crt_static_default = false/" compiler/rustc_target/src/spec/linux_musl_base.rs
'';

# rustc unfortunately needs cmake to compile llvm-rt but doesn't
Expand Down