(rustup): (add zlib to rpath in rustup libraries)
(Rust now has a dynamic library dependence on zlib. (see https://github.com/rust-lang/rust/pull/72696))
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{ stdenv, lib, runCommand, patchelf
|
||||
, fetchFromGitHub, rustPlatform
|
||||
, pkgconfig, curl, Security, CoreServices }:
|
||||
, pkgconfig, curl, zlib, Security, CoreServices }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "rustup";
|
||||
@@ -18,18 +18,25 @@ rustPlatform.buildRustPackage rec {
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
|
||||
buildInputs = [
|
||||
curl
|
||||
curl zlib
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
||||
|
||||
cargoBuildFlags = [ "--features no-self-update" ];
|
||||
|
||||
patches = lib.optionals stdenv.isLinux [
|
||||
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; } ''
|
||||
(let
|
||||
libPath = lib.makeLibraryPath [
|
||||
zlib # libz.so.1
|
||||
];
|
||||
in
|
||||
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } ''
|
||||
export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
|
||||
substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
|
||||
--subst-var patchelf \
|
||||
--subst-var dynamicLinker
|
||||
--subst-var dynamicLinker \
|
||||
--subst-var libPath
|
||||
'')
|
||||
)
|
||||
];
|
||||
|
||||
doCheck = !stdenv.isAarch64 && !stdenv.isDarwin;
|
||||
|
||||
Reference in New Issue
Block a user