gnu: fish: Update to 3.0.0.

* gnu/packages/shells.scm (fish): Update to 3.0.0.
  [source]: Remove dead URL.
  [inputs]: Remove bc.  Replace python-wrapper with python.
  [arguments]: Remove configure-flags.  Enable fish to source
  /etc/fish/config.fish.  Enable completions, functions and configurations
  in user's and system's guix profiles.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Meiyo Peng 2019-01-06 22:11:36 +08:00 committed by Ludovic Courtès
parent d1d72830f2
commit e1dba5bea0
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 72 additions and 38 deletions

View File

@ -9,6 +9,7 @@
;;; Copyright © 2017, 2018 Nils Gillmann <ng0@n0.is> ;;; Copyright © 2017, 2018 Nils Gillmann <ng0@n0.is>
;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name> ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -27,7 +28,6 @@
(define-module (gnu packages shells) (define-module (gnu packages shells)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages bison) #:use-module (gnu packages bison)
@ -89,51 +89,85 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
(define-public fish (define-public fish
(package (package
(name "fish") (name "fish")
(version "2.7.1") (version "3.0.0")
(source (origin (source
(method url-fetch) (origin
(uri (method url-fetch)
(list (uri (string-append "https://github.com/fish-shell/fish-shell/"
(string-append "https://fishshell.com/files/" "releases/download/" version "/"
version "/fish-" version ".tar.gz") name "-" version ".tar.gz"))
(string-append "https://github.com/fish-shell/fish-shell/" (sha256
"releases/download/" version "/" (base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga"))))
name "-" version ".tar.gz")))
(sha256
(base32
"0nhc3yc5lnnan7zmxqqxm07rdpwjww5ijy45ll2njdc6fnfb2az4"))
(modules '((guix build utils)))
;; Don't try to install /etc/fish/config.fish.
(snippet '(begin
(substitute* "Makefile.in"
((".*INSTALL.*sysconfdir.*fish.*") ""))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs
`(("groff" ,groff) ; for 'fish --help'
("ncurses" ,ncurses)
("pcre2" ,pcre2) ; don't use the bundled PCRE2
("python" ,python))) ; for fish_config and manpage completions
(native-inputs (native-inputs
`(("doxygen" ,doxygen))) `(("doxygen" ,doxygen)))
(inputs
`(("bc" ,bc)
("ncurses" ,ncurses)
("groff" ,groff) ;for 'fish --help'
("pcre2" ,pcre2) ;don't use the bundled PCRE2
("python" ,python-wrapper))) ;for fish_config and manpage completions
(arguments (arguments
'(#:tests? #f ; no check target '(#:tests? #f ; no check target
#:configure-flags '("--sysconfdir=/etc")
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; Embed absolute paths to store items. (add-after 'unpack 'patch-source
(add-after 'unpack 'embed-store-paths (lambda _
(lambda* (#:key inputs outputs #:allow-other-keys) (substitute* '("build_tools/build_commands_hdr.sh"
(substitute* '("share/functions/math.fish" "build_tools/build_user_doc.sh")
"share/functions/seq.fish") (("/usr/bin/env") "env"))
(("\\| bc") #t))
(string-append "| " (assoc-ref %build-inputs "bc") ;; Embed absolute paths.
"/bin/bc"))) (add-before 'install 'embed-absolute-paths
(substitute* "share/functions/fish_update_completions.fish" (lambda _
(("python") (which "python"))) (substitute* '("share/functions/__fish_config_interactive.fish"
"share/functions/fish_config.fish"
"share/functions/fish_update_completions.fish")
(("python3") (which "python3")))
(substitute* "share/functions/__fish_print_help.fish" (substitute* "share/functions/__fish_print_help.fish"
(("nroff") (which "nroff"))) (("nroff") (which "nroff")))
#t))
;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
(add-before 'install 'patch-fish-config
(lambda _
(let ((port (open-file "etc/config.fish" "a")))
(display (string-append
"\n\n"
"# Patched by Guix.\n"
"# Source /etc/fish/config.fish.\n"
"if test -f /etc/fish/config.fish\n"
" source /etc/fish/config.fish\n"
"end\n")
port)
(close-port port))
#t))
;; Enable completions, functions and configurations in user's and
;; system's guix profiles by adding them to __extra_* variables.
(add-before 'install 'patch-fish-extra-paths
(lambda _
(let ((port (open-file "share/__fish_build_paths.fish" "a")))
(display
(string-append
"\n\n"
"# Patched by Guix.\n"
"# Enable completions, functions and configurations in user's"
" and system's guix profiles by adding them to __extra_*"
" variables.\n"
"set -l __guix_profile_paths ~/.guix-profile"
" /run/current-system/profile\n"
"set __extra_completionsdir"
" $__guix_profile_paths\"/etc/fish/completions\""
" $__guix_profile_paths\"/share/fish/vendor_completions.d\""
" $__extra_completionsdir\n"
"set __extra_functionsdir"
" $__guix_profile_paths\"/etc/fish/functions\""
" $__guix_profile_paths\"/share/fish/vendor_functions.d\""
" $__extra_functionsdir\n"
"set __extra_confdir"
" $__guix_profile_paths\"/etc/fish/conf.d\""
" $__guix_profile_paths\"/share/fish/vendor_conf.d\""
" $__extra_confdir\n")
port)
(close-port port))
#t))))) #t)))))
(synopsis "The friendly interactive shell") (synopsis "The friendly interactive shell")
(description (description