Merge pull request #95209 from danieldk/broot-dont-nag
broot: disable (impure) br shell function nag, install bash/zsh/fish files for the br function
This commit is contained in:
commit
e269397d5c
@ -1,4 +1,12 @@
|
|||||||
{ stdenv, rustPlatform, fetchFromGitHub, coreutils, libiconv, Security, installShellFiles }:
|
{ stdenv
|
||||||
|
, rustPlatform
|
||||||
|
, fetchFromGitHub
|
||||||
|
, installShellFiles
|
||||||
|
, makeWrapper
|
||||||
|
, coreutils
|
||||||
|
, libiconv
|
||||||
|
, Security
|
||||||
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "broot";
|
pname = "broot";
|
||||||
@ -13,7 +21,7 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
cargoSha256 = "18b4lh5x25mbhpffva8ygzm5ad00svm1c3r83vfw0l2f61m7vyjh";
|
cargoSha256 = "18b4lh5x25mbhpffva8ygzm5ad00svm1c3r83vfw0l2f61m7vyjh";
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||||
|
|
||||||
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ];
|
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ];
|
||||||
|
|
||||||
@ -27,6 +35,23 @@ rustPlatform.buildRustPackage rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
# Do not nag users about installing shell integration, since
|
||||||
|
# it is impure.
|
||||||
|
wrapProgram $out/bin/broot \
|
||||||
|
--set BR_INSTALL no
|
||||||
|
|
||||||
|
# Install shell function for bash.
|
||||||
|
$out/bin/broot --print-shell-function bash > br.bash
|
||||||
|
install -Dm0444 -t $out/etc/profile.d br.bash
|
||||||
|
|
||||||
|
# Install shell function for zsh.
|
||||||
|
$out/bin/broot --print-shell-function zsh > br.zsh
|
||||||
|
install -Dm0444 br.zsh $out/share/zsh/site-functions/br
|
||||||
|
|
||||||
|
# Install shell function for fish
|
||||||
|
$out/bin/broot --print-shell-function fish > br.fish
|
||||||
|
install -Dm0444 -t $out/share/fish/vendor_functions.d br.fish
|
||||||
|
|
||||||
# install shell completion files
|
# install shell completion files
|
||||||
OUT_DIR=$releaseDir/build/broot-*/out
|
OUT_DIR=$releaseDir/build/broot-*/out
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user