fd: use installShellFiles

This commit is contained in:
zowoq 2020-03-19 11:43:22 +10:00 committed by Jon
parent b4cf1c96fa
commit 0e886b69ab

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, rustPlatform }: { lib, fetchFromGitHub, rustPlatform, installShellFiles }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "fd"; pname = "fd";
@ -13,18 +13,17 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "1nhlarrl0m6as3j2547yf1xxjm88qy3v8jgvhd47z3f5s63bb6w5"; cargoSha256 = "1nhlarrl0m6as3j2547yf1xxjm88qy3v8jgvhd47z3f5s63bb6w5";
preFixup = '' nativeBuildInputs = [ installShellFiles ];
install -Dm644 "$src/doc/fd.1" "$out/man/man1/fd.1"
install -Dm644 target/release/build/fd-find-*/out/fd.bash \ preFixup = ''
"$out/share/bash-completion/completions/fd.bash" installManPage "$src/doc/fd.1"
install -Dm644 target/release/build/fd-find-*/out/fd.fish \
"$out/share/fish/vendor_completions.d/fd.fish" (cd target/release/build/fd-find-*/out
install -Dm644 target/release/build/fd-find-*/out/_fd \ installShellCompletion fd.{bash,fish}
"$out/share/zsh/site-functions/_fd" installShellCompletion --zsh _fd)
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "A simple, fast and user-friendly alternative to find"; description = "A simple, fast and user-friendly alternative to find";
longDescription = '' longDescription = ''
`fd` is a simple, fast and user-friendly alternative to `find`. `fd` is a simple, fast and user-friendly alternative to `find`.