summary refs log tree commit diff
path: root/pkgs/shells/fish
diff options
context:
space:
mode:
authorrnhmjoj <micheleguerinirocco@me.com>2016-05-26 00:09:16 +0200
committerrnhmjoj <micheleguerinirocco@me.com>2016-05-26 00:10:22 +0200
commit17ec9368cd9716e91689744bb6fedc97a02b6ef3 (patch)
tree425649f3edbf7c4ed6c5801efaa6c72dc0f706b8 /pkgs/shells/fish
parentc6b3aca4e277c7ab6d1cdd3f07038a22ac27b06a (diff)
downloadnixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar.gz
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar.bz2
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar.lz
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar.xz
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.tar.zst
nixpkgs-17ec9368cd9716e91689744bb6fedc97a02b6ef3.zip
fish: 2.2.0 -> 2.3.0
Diffstat (limited to 'pkgs/shells/fish')
-rw-r--r--pkgs/shells/fish/builtin_status.patch216
-rw-r--r--pkgs/shells/fish/command-not-found.patch13
-rw-r--r--pkgs/shells/fish/default.nix97
-rw-r--r--pkgs/shells/fish/etc_config.patch17
4 files changed, 62 insertions, 281 deletions
diff --git a/pkgs/shells/fish/builtin_status.patch b/pkgs/shells/fish/builtin_status.patch
deleted file mode 100644
index dd6d79713b4..00000000000
--- a/pkgs/shells/fish/builtin_status.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-commit 5145ca56b0ac1e5e284ab6dfa6fdecc5e86e59b8
-Author: Jakob Gillich <jakob@gillich.me>
-Date:   Sat Dec 26 04:57:06 2015 +0100
-
-    prefix status command with builtin
-
-diff --git a/etc/config.fish b/etc/config.fish
-index 0683f40..9297a85 100644
---- a/etc/config.fish
-+++ b/etc/config.fish
-@@ -6,7 +6,7 @@
- # Some things should only be done for login terminals
- #
- 
--if status --is-login
-+if builtin status --is-login
- 
- 	#
- 	# Set some value for LANG if nothing was set before, and this is a
-diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
-index 9b27fb9..d1c704b 100644
---- a/share/functions/__fish_config_interactive.fish
-+++ b/share/functions/__fish_config_interactive.fish
-@@ -101,7 +101,7 @@ function __fish_config_interactive -d "Initializations that should be performed
-         eval "$__fish_bin_dir/fish -c 'fish_update_completions > /dev/null ^/dev/null' &"
-     end
- 
--	if status -i
-+	if builtin status -i
- 		#
- 		# Print a greeting
- 		#
-@@ -128,14 +128,14 @@ function __fish_config_interactive -d "Initializations that should be performed
- 	#
- 
- 	function __fish_repaint --on-variable fish_color_cwd --description "Event handler, repaints the prompt when fish_color_cwd changes"
--		if status --is-interactive
-+		if builtin status --is-interactive
- 			set -e __fish_prompt_cwd
- 			commandline -f repaint ^/dev/null
- 		end
- 	end
- 
- 	function __fish_repaint_root --on-variable fish_color_cwd_root --description "Event handler, repaints the prompt when fish_color_cwd_root changes"
--		if status --is-interactive
-+		if builtin  status --is-interactive
- 			set -e __fish_prompt_cwd
- 			commandline -f repaint ^/dev/null
- 		end
-@@ -191,7 +191,7 @@ function __fish_config_interactive -d "Initializations that should be performed
- 	# Notify vte-based terminals when $PWD changes (issue #906)
- 	if test "$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
- 		function __update_vte_cwd --on-variable PWD --description 'Notify VTE of change to $PWD'
--			status --is-command-substitution; and return
-+			builtin status --is-command-substitution; and return
- 			printf '\033]7;file://%s%s\a' (hostname) (pwd | __fish_urlencode)
- 		end
- 	end
-diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish
-index 0117894..4e4b60f 100644
---- a/share/functions/__fish_git_prompt.fish
-+++ b/share/functions/__fish_git_prompt.fish
-@@ -728,7 +728,7 @@ for var in repaint describe_style show_informative_status showdirtystate showsta
- 	set varargs $varargs --on-variable __fish_git_prompt_$var
- end
- function __fish_git_prompt_repaint $varargs --description "Event handler, repaints prompt when functionality changes"
--	if status --is-interactive
-+	if builtin status --is-interactive
- 		if test $argv[3] = __fish_git_prompt_show_informative_status
- 			# Clear characters that have different defaults with/without informative status
- 			for name in cleanstate dirtystate invalidstate stagedstate stateseparator untrackedfiles upstream_ahead upstream_behind
-@@ -746,7 +746,7 @@ for var in '' _prefix _suffix _bare _merging _cleanstate _invalidstate _upstream
- end
- set varargs $varargs --on-variable __fish_git_prompt_showcolorhints
- function __fish_git_prompt_repaint_color $varargs --description "Event handler, repaints prompt when any color changes"
--	if status --is-interactive
-+	if builtin status --is-interactive
- 		set -l var $argv[3]
- 		set -e _$var
- 		set -e _{$var}_done
-@@ -766,7 +766,7 @@ for var in cleanstate dirtystate invalidstate stagedstate stashstate statesepara
- 	set varargs $varargs --on-variable __fish_git_prompt_char_$var
- end
- function __fish_git_prompt_repaint_char $varargs --description "Event handler, repaints prompt when any char changes"
--	if status --is-interactive
-+	if builtin status --is-interactive
- 		set -e _$argv[3]
- 		commandline -f repaint ^/dev/null
- 	end
-diff --git a/share/functions/cd.fish b/share/functions/cd.fish
-index 8faa469..10168d7 100644
---- a/share/functions/cd.fish
-+++ b/share/functions/cd.fish
-@@ -5,7 +5,7 @@
- function cd --description "Change directory"
- 
- 	# Skip history in subshells
--	if status --is-command-substitution
-+	if builtin status --is-command-substitution
- 		builtin cd $argv
- 		return $status
- 	end
-@@ -33,4 +33,3 @@ function cd --description "Change directory"
- 
- 	return $cd_status
- end
--
-diff --git a/share/functions/eval.fish b/share/functions/eval.fish
-index 052d417..5eeb12a 100644
---- a/share/functions/eval.fish
-+++ b/share/functions/eval.fish
-@@ -23,17 +23,17 @@ function eval -S -d "Evaluate parameters as a command"
- 	# used interactively, like less, wont work using eval.
- 
- 	set -l mode
--	if status --is-interactive-job-control
-+	if builtin status --is-interactive-job-control
- 		set mode interactive
- 	else
--		if status --is-full-job-control
-+		if builtin status --is-full-job-control
- 			set mode full
- 		else
- 			set mode none
- 		end
- 	end
--	if status --is-interactive
--		status --job-control full
-+	if builtin status --is-interactive
-+		builtin status --job-control full
- 	end
- 	__fish_restore_status $status_copy
- 
-@@ -60,6 +60,6 @@ function eval -S -d "Evaluate parameters as a command"
- 	echo "begin; $argv "\n" ;end <&3 3<&-" | source 3<&0
- 	set -l res $status
- 
--	status --job-control $mode
-+	builtin status --job-control $mode
- 	return $res
- end
-diff --git a/share/functions/history.fish b/share/functions/history.fish
-index fd2b91f..12d28d7 100644
---- a/share/functions/history.fish
-+++ b/share/functions/history.fish
-@@ -38,7 +38,7 @@ function history --description "Deletes an item from history"
-         end
-     else
-         #Execute history builtin without any argument
--        if status --is-interactive
-+        if builtin status --is-interactive
-             builtin history | eval $pager
-         else
-             builtin history
-diff --git a/share/functions/psub.fish b/share/functions/psub.fish
-index 67863ad..dd0e08b 100644
---- a/share/functions/psub.fish
-+++ b/share/functions/psub.fish
-@@ -40,7 +40,7 @@ function psub --description "Read from stdin into a file and output the filename
- 
- 	end
- 
--	if not status --is-command-substitution
-+	if not builtin status --is-command-substitution
- 		echo psub: Not inside of command substitution >&2
- 		return 1
- 	end
-diff --git a/share/tools/web_config/sample_prompts/classic_git.fish b/share/tools/web_config/sample_prompts/classic_git.fish
-index 39f3ab8..601fa19 100644
---- a/share/tools/web_config/sample_prompts/classic_git.fish
-+++ b/share/tools/web_config/sample_prompts/classic_git.fish
-@@ -17,25 +17,25 @@ function fish_prompt --description 'Write out the prompt'
- 		set -g __fish_classic_git_functions_defined
- 
- 		function __fish_repaint_user --on-variable fish_color_user --description "Event handler, repaint when fish_color_user changes"
--			if status --is-interactive
-+			if builtin status --is-interactive
- 				commandline -f repaint ^/dev/null
- 			end
- 		end
--		
-+
- 		function __fish_repaint_host --on-variable fish_color_host --description "Event handler, repaint when fish_color_host changes"
--			if status --is-interactive
-+			if builtin status --is-interactive
- 				commandline -f repaint ^/dev/null
- 			end
- 		end
--		
-+
- 		function __fish_repaint_status --on-variable fish_color_status --description "Event handler; repaint when fish_color_status changes"
--			if status --is-interactive
-+			if builtin status --is-interactive
- 				commandline -f repaint ^/dev/null
- 			end
- 		end
- 
- 		function __fish_repaint_bind_mode --on-variable fish_key_bindings --description "Event handler; repaint when fish_key_bindings changes"
--			if status --is-interactive
-+			if builtin status --is-interactive
- 				commandline -f repaint ^/dev/null
- 			end
- 		end
-diff --git a/tests/test_util.fish b/tests/test_util.fish
-index 22744b3..576dbc4 100644
---- a/tests/test_util.fish
-+++ b/tests/test_util.fish
-@@ -4,7 +4,7 @@
- if test "$argv[1]" = (status -f)
-     echo 'test_util.fish requires sourcing script as argument to `source`' >&2
-     echo 'use `source test_util.fish (status -f); or exit`' >&2
--    status --print-stack-trace >&2
-+    builtin status --print-stack-trace >&2
-     exit 1
- end
- 
diff --git a/pkgs/shells/fish/command-not-found.patch b/pkgs/shells/fish/command-not-found.patch
deleted file mode 100644
index aaca001dcb6..00000000000
--- a/pkgs/shells/fish/command-not-found.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
-index c3864a8..a12ac4d 100644
---- a/share/functions/__fish_config_interactive.fish
-+++ b/share/functions/__fish_config_interactive.fish
-@@ -230,7 +230,7 @@ function __fish_config_interactive -d "Initializations that should be performed
- 		# Check for NixOS handler
- 		else if test -f /run/current-system/sw/bin/command-not-found
- 			function __fish_command_not_found_handler --on-event fish_command_not_found
--				/run/current-system/sw/bin/command-not-found $argv[1]
-+				/run/current-system/sw/bin/command-not-found $argv
- 			end
- 		# Ubuntu Feisty places this command in the regular path instead
- 		else if type -q -p command-not-found
diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix
index 6de8aa7f18b..6dd8d5290a4 100644
--- a/pkgs/shells/fish/default.nix
+++ b/pkgs/shells/fish/default.nix
@@ -1,68 +1,83 @@
-{ stdenv, fetchurl, ncurses, nettools, python, which, groff, gettext, man-db,
-  bc, libiconv, coreutils, gnused, kbd, utillinux, glibc }:
+{ stdenv, fetchurl, coreutils, utillinux,
+  nettools, kbd, bc, which, gnused, gnugrep,
+  groff, man-db, glibc, libiconv, pcre2,
+  gettext, ncurses, python
+}:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "fish-${version}";
-  version = "2.2.0";
+  version = "2.3.0";
 
-  patches = [ ./etc_config.patch ./builtin_status.patch ./command-not-found.patch ];
+  patches = [ ./etc_config.patch ];
 
   src = fetchurl {
     url = "http://fishshell.com/files/${version}/${name}.tar.gz";
-    sha256 = "0ympqz7llmf0hafxwglykplw6j5cz82yhlrw50lw4bnf2kykjqx7";
+    sha256 = "1ralmp7lavdl0plc09ppm232aqsn0crxx6m3hgaa06ibam3sqawi";
   };
 
-  buildInputs = [ ncurses libiconv ];
+  buildInputs = [ ncurses libiconv pcre2 ];
+  configureFlags = [ "--without-included-pcre2" ];
 
   # Required binaries during execution
   # Python: Autocompletion generated from manpages and config editing
-  propagatedBuildInputs = [ python which groff gettext ]
-                          ++ stdenv.lib.optional (!stdenv.isDarwin) man-db
-                          ++ [ bc coreutils ];
+  propagatedBuildInputs = [
+    coreutils gnugrep gnused bc
+    python which groff gettext
+  ] ++ optional (!stdenv.isDarwin) man-db;
 
   postInstall = ''
-    sed -e "s|expr|${coreutils}/bin/expr|" \
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-        -e "s|if which unicode_start|if true|" \
-    '' + stdenv.lib.optionalString stdenv.isLinux ''
-        -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|" \
-        -i "$out/share/fish/functions/seq.fish" \
+    sed -r "s|command grep|command ${gnugrep}/bin/grep|" \
+        -i "$out/share/fish/functions/grep.fish"
+    sed -e "s|bc|${bc}/bin/bc|"                          \
+        -e "s|/usr/bin/seq|${coreutils}/bin/seq|"        \
+        -i "$out/share/fish/functions/seq.fish"          \
            "$out/share/fish/functions/math.fish"
-    sed -i "s|which |${which}/bin/which |" "$out/share/fish/functions/type.fish"
-    sed -e "s|\|cut|\|${coreutils}/bin/cut|" -i "$out/share/fish/functions/fish_prompt.fish"
-    sed -i "s|nroff |${groff}/bin/nroff |" "$out/share/fish/functions/__fish_print_help.fish"
-    sed -e "s|gettext |${gettext}/bin/gettext |" \
-        -e "s|which |${which}/bin/which |" \
+    sed -i "s|which |${which}/bin/which |"               \
+            "$out/share/fish/functions/type.fish"
+    sed -e "s|\|cut|\|${coreutils}/bin/cut|"             \
+        -i "$out/share/fish/functions/fish_prompt.fish"
+    sed -e "s|gettext |${gettext}/bin/gettext |"         \
+        -e "s|which |${which}/bin/which |"               \
         -i "$out/share/fish/functions/_.fish"
-    sed -e "s|uname|${coreutils}/bin/uname|" \
-        -i "$out/share/fish/functions/__fish_pwd.fish" \
+    sed -e "s|uname|${coreutils}/bin/uname|"             \
+        -i "$out/share/fish/functions/__fish_pwd.fish"   \
            "$out/share/fish/functions/prompt_pwd.fish"
-    sed -e "s|sed |${gnused}/bin/sed |" \
-        -i "$out/share/fish/functions/alias.fish" \
+    sed -e "s|sed |${gnused}/bin/sed |"                  \
+        -i "$out/share/fish/functions/alias.fish"        \
            "$out/share/fish/functions/prompt_pwd.fish"
-    substituteInPlace "$out/share/fish/functions/fish_default_key_bindings.fish" \
-      --replace "clear;" "${ncurses.out}/bin/clear;"
-  '' + stdenv.lib.optionalString stdenv.isLinux ''
-    substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \
-      --replace "| ul" "| ${utillinux}/bin/ul" 
+    sed -i "s|nroff |${groff}/bin/nroff |"               \
+           "$out/share/fish/functions/__fish_print_help.fish"
+    sed -i "s|/sbin /usr/sbin||" \
+           "$out/share/fish/functions/__fish_complete_subcommand_root.fish"
+    sed -e "s|clear;|${ncurses.out}/bin/clear;|" \
+        -i "$out/share/fish/functions/fish_default_key_bindings.fish" \
 
+  '' + optionalString stdenv.isLinux ''
+    sed -e "s| ul| ${utillinux}/bin/ul|" \
+        -i "$out/share/fish/functions/__fish_print_help.fish"
     for cur in $out/share/fish/functions/*.fish; do
-      substituteInPlace "$cur" --replace "/usr/bin/getent" "${glibc.bin}/bin/getent"
+      sed -e "s|/usr/bin/getent|${glibc.bin}/bin/getent|" \
+          -i "$cur"
     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"
-    sed -i "s|command manpath|command ${man-db}/bin/manpath|" "$out/share/fish/functions/man.fish"
+
+  '' + 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"
+    sed -i "s|command manpath|command ${man-db}/bin/manpath|"     \
+            "$out/share/fish/functions/man.fish"
   '' + ''
-    sed -i "s|/sbin /usr/sbin||" \
-           "$out/share/fish/functions/__fish_complete_subcommand_root.fish"
+    tee -a $out/share/fish/config.fish << EOF
 
     # make fish pick up completions from nix profile
-    echo "set fish_complete_path (echo \$NIX_PROFILES | tr ' ' '\n')\"/share/fish/vendor_completions.d\" \$fish_complete_path" >> $out/share/fish/config.fish
+    if status --is-interactive
+      set -l profiles (echo $NIX_PROFILES | ${coreutils}/bin/tr ' ' '\n')
+      set fish_complete_path $profiles"/share/fish/vendor_completions.d" $fish_complete_path
+    end
+    EOF
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/shells/fish/etc_config.patch b/pkgs/shells/fish/etc_config.patch
index c48e734cc90..c0098c05812 100644
--- a/pkgs/shells/fish/etc_config.patch
+++ b/pkgs/shells/fish/etc_config.patch
@@ -1,17 +1,12 @@
-commit 0ec07a7018bd69513b0bca6e2f22dbf8575a5b5e
-Author: Jakob Gillich <jakob@gillich.me>
-Date:   Fri Dec 25 01:59:29 2015 +0100
-
-    load /etc/fish/config.fish if it exists
-
 diff --git a/etc/config.fish b/etc/config.fish
-index 0683f40..33f4da7 100644
+index 9be6f07..61c9ae2 100644
 --- a/etc/config.fish
 +++ b/etc/config.fish
-@@ -37,3 +37,6 @@ if status --is-login
-        end
- end
-
+@@ -12,3 +12,7 @@
+ # if status --is-interactiv
+ #   ...
+ # end
++
 +if test -f /etc/fish/config.fish
 +  source /etc/fish/config.fish
 +end