summary refs log tree commit diff
path: root/pkgs/tools/misc/broot
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-02-16 00:21:29 -0800
committerArtturin <Artturin@artturin.com>2023-02-21 20:52:49 +0200
commit2ce66cf3798da56506b00ce23e1304cf289826be (patch)
tree5434fe2d5501e2c7b2f746c152b974e810543a19 /pkgs/tools/misc/broot
parent4987c7aacdeeed0b08fcd12ab1c5813b683be7d6 (diff)
downloadnixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar.gz
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar.bz2
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar.lz
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar.xz
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.tar.zst
nixpkgs-2ce66cf3798da56506b00ce23e1304cf289826be.zip
broot: fix cross compilation
Co-authored-by: Artturin <Artturin@artturin.com>
Diffstat (limited to 'pkgs/tools/misc/broot')
-rw-r--r--pkgs/tools/misc/broot/default.nix20
1 files changed, 11 insertions, 9 deletions
diff --git a/pkgs/tools/misc/broot/default.nix b/pkgs/tools/misc/broot/default.nix
index 4daab1ef99c..1c805452ca1 100644
--- a/pkgs/tools/misc/broot/default.nix
+++ b/pkgs/tools/misc/broot/default.nix
@@ -11,6 +11,7 @@
 , Security
 , xorg
 , zlib
+, buildPackages
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -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
 
@@ -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;