[bug#34153] Update fish to 3.0.0.

Message ID 8736pm2zji.fsf@disroot.org
State Accepted
Headers show
Series [bug#34153] Update fish to 3.0.0. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Meiyo Peng Jan. 21, 2019, 8:19 a.m. UTC
Hi,

This patch series updates fish shell to 3.0.0 and enable fish to source
/etc/profile using fish-foreign-env.
--
Meiyo Peng
https://www.pengmeiyu.com/

Comments

Ludovic Courtès Jan. 28, 2019, 10:13 p.m. UTC | #1
Hello Meiyo,

Meiyo Peng <meiyo@disroot.org> skribis:

> This patch series updates fish shell to 3.0.0 and enable fish to source
> /etc/profile using fish-foreign-env.

I don’t use Fish so I don’t really have an opinion but it looks
reasonable to me.  If it breaks, users will yell at you anyway.  ;-)

>>From 8d20b9d62d0d6c6c9c572b5871d0063c8b4fdf07 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Sun, 6 Jan 2019 22:11:36 +0800
> Subject: [PATCH 1/3] 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.

[...]

>>From da8487fe9b9a0a0308f7b929f9e95e8e8297de26 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Sun, 20 Jan 2019 21:41:21 +0800
> Subject: [PATCH 2/3] gnu: Add fish-foreign-env.
>
> * gnu/packages/shells.scm (fish-foreign-env): New variable.

[...]

>>From aadeb9dea8aff0db8a339cc11d006abff4736fdb Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Sun, 20 Jan 2019 21:42:15 +0800
> Subject: [PATCH 3/3] gnu: fish: Use fish-foreign-env to source /etc/profile.
>
> * gnu/packages/shells.scm (fish): Use fish-foreign-env to source /etc/profile
>   when user logs in.

Applied all three patches.  Thanks for working on it!

Ludo’.
Meiyo Peng Jan. 29, 2019, 12:45 a.m. UTC | #2
Hi Ludovic,

Ludovic Courtès writes:

>> This patch series updates fish shell to 3.0.0 and enable fish to source
>> /etc/profile using fish-foreign-env.
>
> I don’t use Fish so I don’t really have an opinion but it looks
> reasonable to me.  If it breaks, users will yell at you anyway.  ;-)

Yells are welcome. ;-)


--
Meiyo Peng
https://www.pengmeiyu.com/

Patch

From aadeb9dea8aff0db8a339cc11d006abff4736fdb Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Sun, 20 Jan 2019 21:42:15 +0800
Subject: [PATCH 3/3] gnu: fish: Use fish-foreign-env to source /etc/profile.

* gnu/packages/shells.scm (fish): Use fish-foreign-env to source /etc/profile
  when user logs in.
---
 gnu/packages/shells.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm
index 8e2ca2a9a..d0561559e 100644
--- a/gnu/packages/shells.scm
+++ b/gnu/packages/shells.scm
@@ -102,7 +102,8 @@  direct descendant of NetBSD's Almquist Shell (@command{ash}).")
         (base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga"))))
     (build-system gnu-build-system)
     (inputs
-     `(("groff" ,groff)                 ; for 'fish --help'
+     `(("fish-foreign-env" ,fish-foreign-env)
+       ("groff" ,groff)                 ; for 'fish --help'
        ("ncurses" ,ncurses)
        ("pcre2" ,pcre2)      ; don't use the bundled PCRE2
        ("python" ,python)))  ; for fish_config and manpage completions
@@ -170,6 +171,25 @@  direct descendant of NetBSD's Almquist Shell (@command{ash}).")
                  " $__extra_confdir\n")
                 port)
                (close-port port))
+             #t))
+         ;; Use fish-foreign-env to source /etc/profile.
+         (add-before 'install 'source-etc-profile
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((port (open-file "share/__fish_build_paths.fish" "a")))
+               (display
+                (string-append
+                 "\n\n"
+                 "# Patched by Guix.\n"
+                 "# Use fish-foreign-env to source /etc/profile.\n"
+                 "if status is-login\n"
+                 "    set fish_function_path "
+                 (assoc-ref inputs "fish-foreign-env") "/share/fish/functions"
+                 " $__fish_datadir/functions\n"
+                 "    fenv source /etc/profile\n"
+                 "    set -e fish_function_path\n"
+                 "end\n")
+                port)
+               (close-port port))
              #t)))))
     (synopsis "The friendly interactive shell")
     (description
-- 
2.20.1