git.iko.soy/typeable/nixpkgs
on master help sign in
fish: 2.2.0 -> 2.3.0
commit17ec9368cd9716e91689744bb6fedc97a02b6ef3 authorrnhmjoj <micheleguerinirocco@me.com> dateThu 26 May 2016, 00:09 (11 years ago) parentc6b3aca
5 files changed+68−287
nixos/modules/programs/fish.nix+6−6 pkgs/shells/fish/builtin_status.patch−216 pkgs/shells/fish/command-not-found.patch−13 pkgs/shells/fish/default.nix+56−41 pkgs/shells/fish/etc_config.patch+6−11
nixos/modules/programs/fish.nix+6−6
@@ -84,19 +84,19 @@ in
8484
8585 set fish_function_path $fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
8686
87− fenv source ${config.system.build.setEnvironment} 1> /dev/null
88− fenv source /etc/fish/foreign-env/shellInit 1> /dev/null
87+ fenv source ${config.system.build.setEnvironment} > /dev/null ^&1
88+ fenv source /etc/fish/foreign-env/shellInit > /dev/null
8989
9090 ${cfg.shellInit}
9191
92− if builtin status --is-login
93− fenv source /etc/fish/foreign-env/loginShellInit 1> /dev/null
92+ if status --is-login
93+ fenv source /etc/fish/foreign-env/loginShellInit > /dev/null
9494 ${cfg.loginShellInit}
9595 end
9696
97− if builtin status --is-interactive
97+ if status --is-interactive
9898 ${fishAliases}
99− fenv source /etc/fish/foreign-env/interactiveShellInit 1> /dev/null
99+ fenv source /etc/fish/foreign-env/interactiveShellInit > /dev/null
100100 ${cfg.interactiveShellInit}
101101 end
102102 '';
pkgs/shells/fish/builtin_status.patchdeleted−216
@@ -1,216 +0,0 @@
1−commit 5145ca56b0ac1e5e284ab6dfa6fdecc5e86e59b8
2−Author: Jakob Gillich <jakob@gillich.me>
3−Date: Sat Dec 26 04:57:06 2015 +0100
4−
5− prefix status command with builtin
6−
7−diff --git a/etc/config.fish b/etc/config.fish
8−index 0683f40..9297a85 100644
9−--- a/etc/config.fish
10−+++ b/etc/config.fish
11−@@ -6,7 +6,7 @@
12− # Some things should only be done for login terminals
13− #
14−
15−-if status --is-login
16−+if builtin status --is-login
17−
18− #
19− # Set some value for LANG if nothing was set before, and this is a
20−diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
21−index 9b27fb9..d1c704b 100644
22−--- a/share/functions/__fish_config_interactive.fish
23−+++ b/share/functions/__fish_config_interactive.fish
24−@@ -101,7 +101,7 @@ function __fish_config_interactive -d "Initializations that should be performed
25− eval "$__fish_bin_dir/fish -c 'fish_update_completions > /dev/null ^/dev/null' &"
26− end
27−
28−- if status -i
29−+ if builtin status -i
30− #
31− # Print a greeting
32− #
33−@@ -128,14 +128,14 @@ function __fish_config_interactive -d "Initializations that should be performed
34− #
35−
36− function __fish_repaint --on-variable fish_color_cwd --description "Event handler, repaints the prompt when fish_color_cwd changes"
37−- if status --is-interactive
38−+ if builtin status --is-interactive
39− set -e __fish_prompt_cwd
40− commandline -f repaint ^/dev/null
41− end
42− end
43−
44− function __fish_repaint_root --on-variable fish_color_cwd_root --description "Event handler, repaints the prompt when fish_color_cwd_root changes"
45−- if status --is-interactive
46−+ if builtin status --is-interactive
47− set -e __fish_prompt_cwd
48− commandline -f repaint ^/dev/null
49− end
50−@@ -191,7 +191,7 @@ function __fish_config_interactive -d "Initializations that should be performed
51− # Notify vte-based terminals when $PWD changes (issue #906)
52− if test "$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
53− function __update_vte_cwd --on-variable PWD --description 'Notify VTE of change to $PWD'
54−- status --is-command-substitution; and return
55−+ builtin status --is-command-substitution; and return
56− printf '\033]7;file://%s%s\a' (hostname) (pwd | __fish_urlencode)
57− end
58− end
59−diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish
60−index 0117894..4e4b60f 100644
61−--- a/share/functions/__fish_git_prompt.fish
62−+++ b/share/functions/__fish_git_prompt.fish
63−@@ -728,7 +728,7 @@ for var in repaint describe_style show_informative_status showdirtystate showsta
64− set varargs $varargs --on-variable __fish_git_prompt_$var
65− end
66− function __fish_git_prompt_repaint $varargs --description "Event handler, repaints prompt when functionality changes"
67−- if status --is-interactive
68−+ if builtin status --is-interactive
69− if test $argv[3] = __fish_git_prompt_show_informative_status
70− # Clear characters that have different defaults with/without informative status
71− for name in cleanstate dirtystate invalidstate stagedstate stateseparator untrackedfiles upstream_ahead upstream_behind
72−@@ -746,7 +746,7 @@ for var in '' _prefix _suffix _bare _merging _cleanstate _invalidstate _upstream
73− end
74− set varargs $varargs --on-variable __fish_git_prompt_showcolorhints
75− function __fish_git_prompt_repaint_color $varargs --description "Event handler, repaints prompt when any color changes"
76−- if status --is-interactive
77−+ if builtin status --is-interactive
78− set -l var $argv[3]
79− set -e _$var
80− set -e _{$var}_done
81−@@ -766,7 +766,7 @@ for var in cleanstate dirtystate invalidstate stagedstate stashstate statesepara
82− set varargs $varargs --on-variable __fish_git_prompt_char_$var
83− end
84− function __fish_git_prompt_repaint_char $varargs --description "Event handler, repaints prompt when any char changes"
85−- if status --is-interactive
86−+ if builtin status --is-interactive
87− set -e _$argv[3]
88− commandline -f repaint ^/dev/null
89− end
90−diff --git a/share/functions/cd.fish b/share/functions/cd.fish
91−index 8faa469..10168d7 100644
92−--- a/share/functions/cd.fish
93−+++ b/share/functions/cd.fish
94−@@ -5,7 +5,7 @@
95− function cd --description "Change directory"
96−
97− # Skip history in subshells
98−- if status --is-command-substitution
99−+ if builtin status --is-command-substitution
100− builtin cd $argv
101− return $status
102− end
103−@@ -33,4 +33,3 @@ function cd --description "Change directory"
104−
105− return $cd_status
106− end
107−-
108−diff --git a/share/functions/eval.fish b/share/functions/eval.fish
109−index 052d417..5eeb12a 100644
110−--- a/share/functions/eval.fish
111−+++ b/share/functions/eval.fish
112−@@ -23,17 +23,17 @@ function eval -S -d "Evaluate parameters as a command"
113− # used interactively, like less, wont work using eval.
114−
115− set -l mode
116−- if status --is-interactive-job-control
117−+ if builtin status --is-interactive-job-control
118− set mode interactive
119− else
120−- if status --is-full-job-control
121−+ if builtin status --is-full-job-control
122− set mode full
123− else
124− set mode none
125− end
126− end
127−- if status --is-interactive
128−- status --job-control full
129−+ if builtin status --is-interactive
130−+ builtin status --job-control full
131− end
132− __fish_restore_status $status_copy
133−
134−@@ -60,6 +60,6 @@ function eval -S -d "Evaluate parameters as a command"
135− echo "begin; $argv "\n" ;end <&3 3<&-" | source 3<&0
136− set -l res $status
137−
138−- status --job-control $mode
139−+ builtin status --job-control $mode
140− return $res
141− end
142−diff --git a/share/functions/history.fish b/share/functions/history.fish
143−index fd2b91f..12d28d7 100644
144−--- a/share/functions/history.fish
145−+++ b/share/functions/history.fish
146−@@ -38,7 +38,7 @@ function history --description "Deletes an item from history"
147− end
148− else
149− #Execute history builtin without any argument
150−- if status --is-interactive
151−+ if builtin status --is-interactive
152− builtin history | eval $pager
153− else
154− builtin history
155−diff --git a/share/functions/psub.fish b/share/functions/psub.fish
156−index 67863ad..dd0e08b 100644
157−--- a/share/functions/psub.fish
158−+++ b/share/functions/psub.fish
159−@@ -40,7 +40,7 @@ function psub --description "Read from stdin into a file and output the filename
160−
161− end
162−
163−- if not status --is-command-substitution
164−+ if not builtin status --is-command-substitution
165− echo psub: Not inside of command substitution >&2
166− return 1
167− end
168−diff --git a/share/tools/web_config/sample_prompts/classic_git.fish b/share/tools/web_config/sample_prompts/classic_git.fish
169−index 39f3ab8..601fa19 100644
170−--- a/share/tools/web_config/sample_prompts/classic_git.fish
171−+++ b/share/tools/web_config/sample_prompts/classic_git.fish
172−@@ -17,25 +17,25 @@ function fish_prompt --description 'Write out the prompt'
173− set -g __fish_classic_git_functions_defined
174−
175− function __fish_repaint_user --on-variable fish_color_user --description "Event handler, repaint when fish_color_user changes"
176−- if status --is-interactive
177−+ if builtin status --is-interactive
178− commandline -f repaint ^/dev/null
179− end
180− end
181−-
182−+
183− function __fish_repaint_host --on-variable fish_color_host --description "Event handler, repaint when fish_color_host changes"
184−- if status --is-interactive
185−+ if builtin status --is-interactive
186− commandline -f repaint ^/dev/null
187− end
188− end
189−-
190−+
191− function __fish_repaint_status --on-variable fish_color_status --description "Event handler; repaint when fish_color_status changes"
192−- if status --is-interactive
193−+ if builtin status --is-interactive
194− commandline -f repaint ^/dev/null
195− end
196− end
197−
198− function __fish_repaint_bind_mode --on-variable fish_key_bindings --description "Event handler; repaint when fish_key_bindings changes"
199−- if status --is-interactive
200−+ if builtin status --is-interactive
201− commandline -f repaint ^/dev/null
202− end
203− end
204−diff --git a/tests/test_util.fish b/tests/test_util.fish
205−index 22744b3..576dbc4 100644
206−--- a/tests/test_util.fish
207−+++ b/tests/test_util.fish
208−@@ -4,7 +4,7 @@
209− if test "$argv[1]" = (status -f)
210− echo 'test_util.fish requires sourcing script as argument to `source`' >&2
211− echo 'use `source test_util.fish (status -f); or exit`' >&2
212−- status --print-stack-trace >&2
213−+ builtin status --print-stack-trace >&2
214− exit 1
215− end
216−
pkgs/shells/fish/command-not-found.patchdeleted−13
@@ -1,13 +0,0 @@
1−diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
2−index c3864a8..a12ac4d 100644
3−--- a/share/functions/__fish_config_interactive.fish
4−+++ b/share/functions/__fish_config_interactive.fish
5−@@ -230,7 +230,7 @@ function __fish_config_interactive -d "Initializations that should be performed
6− # Check for NixOS handler
7− else if test -f /run/current-system/sw/bin/command-not-found
8− function __fish_command_not_found_handler --on-event fish_command_not_found
9−- /run/current-system/sw/bin/command-not-found $argv[1]
10−+ /run/current-system/sw/bin/command-not-found $argv
11− end
12− # Ubuntu Feisty places this command in the regular path instead
13− else if type -q -p command-not-found
pkgs/shells/fish/default.nix+56−41
@@ -1,68 +1,83 @@
1−{ stdenv, fetchurl, ncurses, nettools, python, which, groff, gettext, man-db,
2− bc, libiconv, coreutils, gnused, kbd, utillinux, glibc }:
1+{ stdenv, fetchurl, coreutils, utillinux,
2+ nettools, kbd, bc, which, gnused, gnugrep,
3+ groff, man-db, glibc, libiconv, pcre2,
4+ gettext, ncurses, python
5+}:
6+
7+with stdenv.lib;
38
49stdenv.mkDerivation rec {
510 name = "fish-${version}";
6− version = "2.2.0";
11+ version = "2.3.0";
712
8− patches = [ ./etc_config.patch ./builtin_status.patch ./command-not-found.patch ];
13+ patches = [ ./etc_config.patch ];
914
1015 src = fetchurl {
1116 url = "http://fishshell.com/files/${version}/${name}.tar.gz";
12− sha256 = "0ympqz7llmf0hafxwglykplw6j5cz82yhlrw50lw4bnf2kykjqx7";
17+ sha256 = "1ralmp7lavdl0plc09ppm232aqsn0crxx6m3hgaa06ibam3sqawi";
1318 };
1419
15− buildInputs = [ ncurses libiconv ];
20+ buildInputs = [ ncurses libiconv pcre2 ];
21+ configureFlags = [ "--without-included-pcre2" ];
1622
1723 # Required binaries during execution
1824 # Python: Autocompletion generated from manpages and config editing
19− propagatedBuildInputs = [ python which groff gettext ]
20− ++ stdenv.lib.optional (!stdenv.isDarwin) man-db
21− ++ [ bc coreutils ];
25+ propagatedBuildInputs = [
26+ coreutils gnugrep gnused bc
27+ python which groff gettext
28+ ] ++ optional (!stdenv.isDarwin) man-db;
2229
2330 postInstall = ''
24− sed -e "s|expr|${coreutils}/bin/expr|" \
25− '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
26− -e "s|if which unicode_start|if true|" \
27− '' + stdenv.lib.optionalString stdenv.isLinux ''
28− -e "s|unicode_start|${kbd}/bin/unicode_start|" \
29− '' + ''
30− -i "$out/etc/fish/config.fish"
31− sed -e "s|bc|${bc}/bin/bc|" \
32− -e "s|/usr/bin/seq|${coreutils}/bin/seq|" \
33− -i "$out/share/fish/functions/seq.fish" \
31+ sed -r "s|command grep|command ${gnugrep}/bin/grep|" \
32+ -i "$out/share/fish/functions/grep.fish"
33+ sed -e "s|bc|${bc}/bin/bc|" \
34+ -e "s|/usr/bin/seq|${coreutils}/bin/seq|" \
35+ -i "$out/share/fish/functions/seq.fish" \
3436 "$out/share/fish/functions/math.fish"
35− sed -i "s|which |${which}/bin/which |" "$out/share/fish/functions/type.fish"
36− sed -e "s|\|cut|\|${coreutils}/bin/cut|" -i "$out/share/fish/functions/fish_prompt.fish"
37− sed -i "s|nroff |${groff}/bin/nroff |" "$out/share/fish/functions/__fish_print_help.fish"
38− sed -e "s|gettext |${gettext}/bin/gettext |" \
39− -e "s|which |${which}/bin/which |" \
37+ sed -i "s|which |${which}/bin/which |" \
38+ "$out/share/fish/functions/type.fish"
39+ sed -e "s|\|cut|\|${coreutils}/bin/cut|" \
40+ -i "$out/share/fish/functions/fish_prompt.fish"
41+ sed -e "s|gettext |${gettext}/bin/gettext |" \
42+ -e "s|which |${which}/bin/which |" \
4043 -i "$out/share/fish/functions/_.fish"
41− sed -e "s|uname|${coreutils}/bin/uname|" \
42− -i "$out/share/fish/functions/__fish_pwd.fish" \
44+ sed -e "s|uname|${coreutils}/bin/uname|" \
45+ -i "$out/share/fish/functions/__fish_pwd.fish" \
4346 "$out/share/fish/functions/prompt_pwd.fish"
44− sed -e "s|sed |${gnused}/bin/sed |" \
45− -i "$out/share/fish/functions/alias.fish" \
47+ sed -e "s|sed |${gnused}/bin/sed |" \
48+ -i "$out/share/fish/functions/alias.fish" \
4649 "$out/share/fish/functions/prompt_pwd.fish"
47− substituteInPlace "$out/share/fish/functions/fish_default_key_bindings.fish" \
48− --replace "clear;" "${ncurses.out}/bin/clear;"
49− '' + stdenv.lib.optionalString stdenv.isLinux ''
50− substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \
51− --replace "| ul" "| ${utillinux}/bin/ul"
50+ sed -i "s|nroff |${groff}/bin/nroff |" \
51+ "$out/share/fish/functions/__fish_print_help.fish"
52+ sed -i "s|/sbin /usr/sbin||" \
53+ "$out/share/fish/functions/__fish_complete_subcommand_root.fish"
54+ sed -e "s|clear;|${ncurses.out}/bin/clear;|" \
55+ -i "$out/share/fish/functions/fish_default_key_bindings.fish" \
5256
57+ '' + optionalString stdenv.isLinux ''
58+ sed -e "s| ul| ${utillinux}/bin/ul|" \
59+ -i "$out/share/fish/functions/__fish_print_help.fish"
5360 for cur in $out/share/fish/functions/*.fish; do
54− substituteInPlace "$cur" --replace "/usr/bin/getent" "${glibc.bin}/bin/getent"
61+ sed -e "s|/usr/bin/getent|${glibc.bin}/bin/getent|" \
62+ -i "$cur"
5563 done
56− '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
57− sed -i "s|(hostname\||(${nettools}/bin/hostname\||" "$out/share/fish/functions/fish_prompt.fish"
58− sed -i "s|Popen(\['manpath'|Popen(\['${man-db}/bin/manpath'|" "$out/share/fish/tools/create_manpage_completions.py"
59− sed -i "s|command manpath|command ${man-db}/bin/manpath|" "$out/share/fish/functions/man.fish"
64+
65+ '' + optionalString (!stdenv.isDarwin) ''
66+ sed -i "s|(hostname\||(${nettools}/bin/hostname\||" \
67+ "$out/share/fish/functions/fish_prompt.fish"
68+ sed -i "s|Popen(\['manpath'|Popen(\['${man-db}/bin/manpath'|" \
69+ "$out/share/fish/tools/create_manpage_completions.py"
70+ sed -i "s|command manpath|command ${man-db}/bin/manpath|" \
71+ "$out/share/fish/functions/man.fish"
6072 '' + ''
61− sed -i "s|/sbin /usr/sbin||" \
62− "$out/share/fish/functions/__fish_complete_subcommand_root.fish"
73+ tee -a $out/share/fish/config.fish << EOF
6374
6475 # make fish pick up completions from nix profile
65− echo "set fish_complete_path (echo \$NIX_PROFILES | tr ' ' '\n')\"/share/fish/vendor_completions.d\" \$fish_complete_path" >> $out/share/fish/config.fish
76+ if status --is-interactive
77+ set -l profiles (echo $NIX_PROFILES | ${coreutils}/bin/tr ' ' '\n')
78+ set fish_complete_path $profiles"/share/fish/vendor_completions.d" $fish_complete_path
79+ end
80+ EOF
6681 '';
6782
6883 meta = with stdenv.lib; {
pkgs/shells/fish/etc_config.patch+6−11
@@ -1,17 +1,12 @@
1−commit 0ec07a7018bd69513b0bca6e2f22dbf8575a5b5e
2−Author: Jakob Gillich <jakob@gillich.me>
3−Date: Fri Dec 25 01:59:29 2015 +0100
4−
5− load /etc/fish/config.fish if it exists
6−
71diff --git a/etc/config.fish b/etc/config.fish
8−index 0683f40..33f4da7 100644
2+index 9be6f07..61c9ae2 100644
93--- a/etc/config.fish
104+++ b/etc/config.fish
11−@@ -37,3 +37,6 @@ if status --is-login
12− end
13− end
14−
5+@@ -12,3 +12,7 @@
6+ # if status --is-interactiv
7+ # ...
8+ # end
9++
1510+if test -f /etc/fish/config.fish
1611+ source /etc/fish/config.fish
1712+end