Archived
1
0
Fork 0

gnu: fish: Upgrade to 3.1.0.

* gnu/packages/shells (fish):[version] Update to 3.1.0. [arguments] Enable
  tests, patch test files, and avoid patches that no longer apply. [inputs]
  Make groff a native-input.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
John Soo 2020-04-12 14:18:30 -07:00 committed by Ludovic Courtès
parent dd0804c67e
commit 1d66e7ace5
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -40,6 +40,7 @@
#:use-module (gnu packages guile) #:use-module (gnu packages guile)
#:use-module (gnu packages libbsd) #:use-module (gnu packages libbsd)
#:use-module (gnu packages libedit) #:use-module (gnu packages libedit)
#:use-module (gnu packages linux)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)
#:use-module (gnu packages pcre) #:use-module (gnu packages pcre)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
@ -48,13 +49,15 @@
#:use-module (gnu packages python-xyz) #:use-module (gnu packages python-xyz)
#:use-module (gnu packages readline) #:use-module (gnu packages readline)
#:use-module (gnu packages scheme) #:use-module (gnu packages scheme)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix licenses) #:use-module (guix licenses)
#:use-module (guix packages)) #:use-module (guix packages)
#:use-module (guix utils))
(define-public dash (define-public dash
(package (package
@ -95,7 +98,7 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
(define-public fish (define-public fish
(package (package
(name "fish") (name "fish")
(version "3.0.2") (version "3.1.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -103,38 +106,53 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
"releases/download/" version "/" "releases/download/" version "/"
"fish-" version ".tar.gz")) "fish-" version ".tar.gz"))
(sha256 (sha256
(base32 "03j3jl9jzlnhq4p86zj8wqsh5sx45j1d1fvfa80ks1cfdg68qwhl")))) (base32 "0s2356mlx7fp9kgqgw91lm5ds2i9iq9hq071fbqmcp3875l1xnz5"))))
(build-system gnu-build-system) (build-system cmake-build-system)
(inputs (inputs
`(("fish-foreign-env" ,fish-foreign-env) `(("fish-foreign-env" ,fish-foreign-env)
("groff" ,groff) ; for 'fish --help'
("ncurses" ,ncurses) ("ncurses" ,ncurses)
("pcre2" ,pcre2) ; don't use the bundled PCRE2 ("pcre2" ,pcre2) ; don't use the bundled PCRE2
("python" ,python))) ; for fish_config and manpage completions ("python" ,python))) ; for fish_config and manpage completions
(native-inputs (native-inputs
`(("doxygen" ,doxygen))) `(("doxygen" ,doxygen)
; for 'fish --help'
("groff" ,groff)))
(arguments (arguments
'(#:tests? #f ; no check target '(#:phases
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'patch-source (add-after 'unpack 'patch-tests
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(substitute* '("build_tools/build_commands_hdr.sh" (let ((coreutils (assoc-ref inputs "coreutils"))
"build_tools/build_user_doc.sh") (bash (assoc-ref inputs "bash")))
(("/usr/bin/env") "env")) ;; These try to open a terminal
#t)) (delete-file "tests/checks/interactive.fish")
;; Embed absolute paths. (delete-file "tests/checks/login-interactive.fish")
(add-before 'install 'embed-absolute-paths ;; These contain absolute path references
(lambda _ (substitute* "src/fish_tests.cpp"
(substitute* '("share/functions/__fish_config_interactive.fish" (("/bin/echo" echo) (string-append coreutils echo))
"share/functions/fish_config.fish" (("/bin/ca" ca) (string-append coreutils ca))
"share/functions/fish_update_completions.fish") (("\"(/bin/c)\"" _ c) (string-append "\"" coreutils c "\""))
(("python3") (which "python3"))) (("/bin/ls_not_a_path" ls-not-a-path)
(substitute* "share/functions/__fish_print_help.fish" (string-append coreutils ls-not-a-path))
(("nroff") (which "nroff"))) (("/bin/ls" ls) (string-append coreutils ls))
#t)) (("(/bin/)\"" _ bin) (string-append coreutils bin "\""))
(("/bin -" bin) (string-append coreutils bin))
(((string-append
"do_test\\(is_potential_path\\("
"L\"/usr\", wds, vars, PATH_REQUIRE_DIR\\)\\);"))
""))
(substitute*
(append (find-files "tests" ".*\\.(in|out|err)$")
(find-files "tests/checks" ".*\\.fish"))
(("/bin/pwd" pwd) (string-append coreutils pwd))
(("/bin/echo" echo) (string-append coreutils echo))
(("/bin/sh" sh) (string-append bash sh))
(("/bin/ls" ls) (string-append coreutils ls)))
(substitute* (find-files "tests" ".*\\.(in|out|err)$")
(("/usr/bin") (string-append coreutils "/bin")))
#t)))
;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish. ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.fish.
(add-before 'install 'patch-fish-config (add-after 'patch-tests 'patch-fish-config
(lambda _ (lambda _
(let ((port (open-file "etc/config.fish" "a"))) (let ((port (open-file "etc/config.fish" "a")))
(display (string-append (display (string-append
@ -147,6 +165,12 @@ direct descendant of NetBSD's Almquist Shell (@command{ash}).")
port) port)
(close-port port)) (close-port port))
#t)) #t))
;; Embed absolute paths.
(add-before 'install 'embed-absolute-paths
(lambda _
(substitute* "share/functions/__fish_print_help.fish"
(("nroff") (which "nroff")))
#t))
;; Enable completions, functions and configurations in user's and ;; Enable completions, functions and configurations in user's and
;; system's guix profiles by adding them to __extra_* variables. ;; system's guix profiles by adding them to __extra_* variables.
(add-before 'install 'patch-fish-extra-paths (add-before 'install 'patch-fish-extra-paths