summary refs log tree commit diff
path: root/pkgs/tools/misc/broot
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-02-22 08:33:50 +0800
committerGitHub <noreply@github.com>2023-02-22 08:33:50 +0800
commit39d650478d56e3cda1892fab5b9afdea9d38fb09 (patch)
treea8d41d86d1cf6fd0664dc30752a3e8a7ce3874fb /pkgs/tools/misc/broot
parent5969cb3337c63c6cc87680387dd2833191d6a8fe (diff)
parent2ce66cf3798da56506b00ce23e1304cf289826be (diff)
downloadnixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar.gz
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar.bz2
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar.lz
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar.xz
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.tar.zst
nixpkgs-39d650478d56e3cda1892fab5b9afdea9d38fb09.zip
Merge pull request #216613 from amjoseph-nixpkgs/pr/broot/fix-cross
broot: fix cross compilation
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 c2c60414e98..f21c6d779e6 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;