1{ 2 lib, 3 rustPlatform, 4 fetchFromGitHub, 5 stdenv, 6 patchelf, 7 zlib, 8 pkg-config, 9 openssl, 10 xz, 11 replaceVars, 12}: 13 14rustPlatform.buildRustPackage (finalAttrs: { 15 pname = "rustup-toolchain-install-master"; 16 version = "1.9.0"; 17 18 src = fetchFromGitHub { 19 owner = "kennytm"; 20 repo = "rustup-toolchain-install-master"; 21 tag = "v${finalAttrs.version}"; 22 hash = "sha256-0ayc4rzlZ9sLKzRhVr1fpRD7bmwQL69rkQ2jXBAdUPI="; 23 }; 24 25 cargoHash = "sha256-VxrtkZbi9BprQOQFxOIAYEoAtg0kqyL3C4ih/5RobZI="; 26 27 patches = lib.optional stdenv.hostPlatform.isLinux ( 28 replaceVars ./0001-dynamically-patchelf-binaries.patch { 29 inherit patchelf; 30 dynamicLinker = "${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2"; 31 libPath = lib.makeLibraryPath [ 32 zlib 33 (placeholder "out" + "/lib") 34 ]; 35 } 36 ); 37 38 nativeBuildInputs = [ pkg-config ]; 39 buildInputs = [ 40 openssl 41 xz 42 ]; 43 44 meta = with lib; { 45 description = "Install a rustc master toolchain usable from rustup"; 46 mainProgram = "rustup-toolchain-install-master"; 47 homepage = "https://github.com/kennytm/rustup-toolchain-install-master"; 48 license = licenses.mit; 49 maintainers = [ ]; 50 }; 51})