Merge pull request #82982 from cole-h/rust-cleanup

improve robustness of various Rust packages
This commit is contained in:
Maximilian Bosch 2020-04-30 02:07:57 +02:00 committed by GitHub
commit ee58c7a363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 17 deletions

View file

@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
installPhase = '' installPhase = ''
mkdir -p $out/lib mkdir -p $out/lib
cp target/release/librustzcash.a $out/lib/ cp $releaseDir/librustzcash.a $out/lib/
mkdir -p $out/include mkdir -p $out/include
cp librustzcash/include/librustzcash.h $out/include/ cp librustzcash/include/librustzcash.h $out/include/
''; '';

View file

@ -95,7 +95,7 @@ rustPlatform.buildRustPackage rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -D target/release/alacritty $out/bin/alacritty install -D $releaseDir/alacritty $out/bin/alacritty
'' + ( '' + (
if stdenv.isDarwin then '' if stdenv.isDarwin then ''

View file

@ -19,7 +19,7 @@ buildRustPackage rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp -p target/release/cfdyndns $out/bin/ cp -p $releaseDir/cfdyndns $out/bin/
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl, darwin }: { stdenv, fetchFromGitHub, installShellFiles, rustPlatform, pkgconfig, openssl, darwin }:
with rustPlatform; with rustPlatform;
@ -15,7 +15,7 @@ buildRustPackage rec {
cargoSha256 = "0vcg2pl0s329fr8p23pwdx2jy7qahbr7n337ib61f69aaxi1xmq0"; cargoSha256 = "0vcg2pl0s329fr8p23pwdx2jy7qahbr7n337ib61f69aaxi1xmq0";
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig installShellFiles ];
buildInputs = [ openssl ] buildInputs = [ openssl ]
++ stdenv.lib.optionals stdenv.isDarwin [ ++ stdenv.lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.Security
@ -23,8 +23,7 @@ buildRustPackage rec {
outputs = [ "out" "man" ]; outputs = [ "out" "man" ];
preFixup = '' preFixup = ''
mkdir -p "$man/man/man1" installManPage $releaseDir/build/git-ignore-*/out/git-ignore.1
cp target/release/build/git-ignore-*/out/git-ignore.1 "$man/man/man1/"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp -p target/release/racerd $out/bin/ cp -p $releaseDir/racerd $out/bin/
wrapProgram $out/bin/racerd --set-default RUST_SRC_PATH "$RUST_SRC_PATH" wrapProgram $out/bin/racerd --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
''; '';

View file

@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
postInstall = '' postInstall = ''
# install shell completion files # install shell completion files
OUT_DIR=target/release/build/broot-*/out OUT_DIR=$releaseDir/build/broot-*/out
installShellCompletion --bash $OUT_DIR/{br,broot}.bash installShellCompletion --bash $OUT_DIR/{br,broot}.bash
installShellCompletion --fish $OUT_DIR/{br,broot}.fish installShellCompletion --fish $OUT_DIR/{br,broot}.fish

View file

@ -18,9 +18,8 @@ rustPlatform.buildRustPackage rec {
preFixup = '' preFixup = ''
installManPage "$src/doc/fd.1" installManPage "$src/doc/fd.1"
(cd target/release/build/fd-find-*/out installShellCompletion $releaseDir/build/fd-find-*/out/fd.{bash,fish}
installShellCompletion fd.{bash,fish} installShellCompletion --zsh $releaseDir/build/fd-find-*/out/_fd
installShellCompletion --zsh _fd)
''; '';
meta = with lib; { meta = with lib; {

View file

@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = '' postInstall = ''
installShellCompletion target/release/build/lsd-*/out/{_lsd,lsd.{bash,fish}} installShellCompletion $releaseDir/build/lsd-*/out/{_lsd,lsd.{bash,fish}}
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -24,7 +24,7 @@ buildRustPackage rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -D target/release/tox-node $out/bin/tox-node install -D $releaseDir/tox-node $out/bin/tox-node
runHook postInstall runHook postInstall
''; '';

View file

@ -30,9 +30,9 @@ rustPlatform.buildRustPackage rec {
++ (stdenv.lib.optional stdenv.isDarwin Security); ++ (stdenv.lib.optional stdenv.isDarwin Security);
preFixup = '' preFixup = ''
(cd target/release/build/ripgrep-*/out installManPage $releaseDir/build/ripgrep-*/out/rg.1
installManPage rg.1
installShellCompletion rg.{bash,fish}) installShellCompletion $releaseDir/build/ripgrep-*/out/rg.{bash,fish}
installShellCompletion --zsh "$src/complete/_rg" installShellCompletion --zsh "$src/complete/_rg"
''; '';