rustup: add zlib as runtime dependency
Fixes https://github.com/NixOS/nixpkgs/issues/92946.
This commit is contained in:
parent
f9bf64f0c4
commit
b2679e8b41
@ -1,7 +1,13 @@
|
|||||||
{ stdenv, lib, runCommand, patchelf
|
{ stdenv, lib, runCommand, patchelf
|
||||||
, fetchFromGitHub, rustPlatform
|
, fetchFromGitHub, rustPlatform, makeWrapper
|
||||||
, pkgconfig, curl, zlib, Security, CoreServices }:
|
, pkgconfig, curl, zlib, Security, CoreServices }:
|
||||||
|
|
||||||
|
let
|
||||||
|
libPath = lib.makeLibraryPath [
|
||||||
|
zlib # libz.so.1
|
||||||
|
];
|
||||||
|
in
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "rustup";
|
pname = "rustup";
|
||||||
version = "1.22.1";
|
version = "1.22.1";
|
||||||
@ -15,7 +21,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
cargoSha256 = "0ghjrx7y25s6rjp06h0iyv4195x7daj57bqza01i1j4hm5nkhqhi";
|
cargoSha256 = "0ghjrx7y25s6rjp06h0iyv4195x7daj57bqza01i1j4hm5nkhqhi";
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
curl zlib
|
curl zlib
|
||||||
@ -24,19 +30,13 @@ rustPlatform.buildRustPackage rec {
|
|||||||
cargoBuildFlags = [ "--features no-self-update" ];
|
cargoBuildFlags = [ "--features no-self-update" ];
|
||||||
|
|
||||||
patches = lib.optionals stdenv.isLinux [
|
patches = lib.optionals stdenv.isLinux [
|
||||||
(let
|
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } ''
|
||||||
libPath = lib.makeLibraryPath [
|
export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
|
||||||
zlib # libz.so.1
|
substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
|
||||||
];
|
--subst-var patchelf \
|
||||||
in
|
--subst-var dynamicLinker \
|
||||||
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } ''
|
--subst-var libPath
|
||||||
export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
|
|
||||||
substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
|
|
||||||
--subst-var patchelf \
|
|
||||||
--subst-var dynamicLinker \
|
|
||||||
--subst-var libPath
|
|
||||||
'')
|
'')
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = !stdenv.isAarch64 && !stdenv.isDarwin;
|
doCheck = !stdenv.isAarch64 && !stdenv.isDarwin;
|
||||||
@ -53,6 +53,8 @@ rustPlatform.buildRustPackage rec {
|
|||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
wrapProgram $out/bin/rustup --prefix "LD_LIBRARY_PATH" : "${libPath}"
|
||||||
|
|
||||||
# tries to create .rustup
|
# tries to create .rustup
|
||||||
export HOME=$(mktemp -d)
|
export HOME=$(mktemp -d)
|
||||||
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
|
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user