Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broot: fix cross compilation #216613

Merged
merged 1 commit into from Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions pkgs/tools/misc/broot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
, Security
, xorg
, zlib
, buildPackages
}:

rustPlatform.buildRustPackage rec {
Expand Down Expand Up @@ -47,24 +48,20 @@ rustPlatform.buildRustPackage rec {
--replace "#version" "${version}"
'';

postInstall = ''
# Do not nag users about installing shell integration, since
# it is impure.
wrapProgram $out/bin/broot \
--set BR_INSTALL no

postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
# Install shell function for bash.
$out/bin/broot --print-shell-function bash > br.bash
${stdenv.hostPlatform.emulator buildPackages} $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
${stdenv.hostPlatform.emulator buildPackages} $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
${stdenv.hostPlatform.emulator buildPackages} $out/bin/broot --print-shell-function fish > br.fish
install -Dm0444 -t $out/share/fish/vendor_functions.d br.fish

'' + ''
# install shell completion files
OUT_DIR=$releaseDir/build/broot-*/out

Expand All @@ -73,6 +70,11 @@ rustPlatform.buildRustPackage rec {
installShellCompletion --zsh $OUT_DIR/{_br,_broot}

installManPage man/broot.1

# Do not nag users about installing shell integration, since
# it is impure.
wrapProgram $out/bin/broot \
--set BR_INSTALL no
'';

doInstallCheck = true;
Expand Down