about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-03-01 21:09:17 +0000
committerRobin Gloster <mail@glob.in>2016-03-01 21:09:17 +0000
commitd47857c3d900c559dfb5134645311bd78b41a34e (patch)
tree2c0a02d76ce72b5210ea0f0cc97b7343d1bef5fb /pkgs/shells
parent1bbb2f0cf3f1303abd40e7bc801e7582b74f3c62 (diff)
parent02891a0de97d965be5b792c60d8287794d3c2e5f (diff)
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/fish/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix
index 11eeb18661c0a..521212940672b 100644
--- a/pkgs/shells/fish/default.nix
+++ b/pkgs/shells/fish/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, ncurses, nettools, python, which, groff, gettext, man_db,
-  bc, libiconv, coreutils, gnused, kbd }:
+  bc, libiconv, coreutils, gnused, kbd, utillinux, glibc }:
 
 stdenv.mkDerivation rec {
   name = "fish-${version}";
@@ -22,8 +22,10 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     sed -e "s|expr|${coreutils}/bin/expr|" \
+  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
         -e "s|if which unicode_start|if true|" \
         -e "s|unicode_start|${kbd}/bin/unicode_start|" \
+  '' + ''
         -i "$out/etc/fish/config.fish"
     sed -e "s|bc|${bc}/bin/bc|" \
         -e "s|/usr/bin/seq|${coreutils}/bin/seq|" \
@@ -43,6 +45,13 @@ stdenv.mkDerivation rec {
            "$out/share/fish/functions/prompt_pwd.fish"
     substituteInPlace "$out/share/fish/functions/fish_default_key_bindings.fish" \
       --replace "clear;" "${ncurses}/bin/clear;"
+  '' + stdenv.lib.optionalString stdenv.isLinux ''
+    substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \
+      --replace "| ul" "| ${utillinux}/bin/ul" 
+
+    for cur in $out/share/fish/functions/*.fish; do
+      substituteInPlace "$cur" --replace "/usr/bin/getent" "${glibc}/bin/getent" 
+    done
   '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
     sed -i "s|(hostname\||(${nettools}/bin/hostname\||" "$out/share/fish/functions/fish_prompt.fish"
     sed -i "s|Popen(\['manpath'|Popen(\['${man_db}/bin/manpath'|" "$out/share/fish/tools/create_manpage_completions.py"