rustup: nixpkgs-fmt

This commit is contained in:
happysalada 2021-05-21 09:39:20 +09:00 committed by Raphael Megzari
parent f38ba786c1
commit 97335842d1

View file

@ -1,6 +1,16 @@
{ stdenv, lib, runCommand, patchelf { stdenv
, fetchFromGitHub, rustPlatform, makeWrapper , lib
, pkg-config, curl, zlib, Security, CoreServices }: , runCommand
, patchelf
, fetchFromGitHub
, rustPlatform
, makeWrapper
, pkg-config
, curl
, zlib
, Security
, CoreServices
}:
let let
libPath = lib.makeLibraryPath [ libPath = lib.makeLibraryPath [
@ -24,18 +34,19 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ makeWrapper pkg-config ]; nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [ buildInputs = [
curl zlib curl
zlib
] ++ lib.optionals stdenv.isDarwin [ CoreServices Security ]; ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
cargoBuildFlags = [ "--features no-self-update" ]; cargoBuildFlags = [ "--features no-self-update" ];
patches = lib.optionals stdenv.isLinux [ patches = lib.optionals stdenv.isLinux [
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } '' (runCommand "0001-dynamically-patchelf-binaries.patch" { CC = stdenv.cc; patchelf = patchelf; libPath = "$ORIGIN/../lib:${libPath}"; } ''
export dynamicLinker=$(cat $CC/nix-support/dynamic-linker) export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
substitute ${./0001-dynamically-patchelf-binaries.patch} $out \ substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
--subst-var patchelf \ --subst-var patchelf \
--subst-var dynamicLinker \ --subst-var dynamicLinker \
--subst-var libPath --subst-var libPath
'') '')
]; ];