From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 21 03:20:10 2019 Received: (at submit) by debbugs.gnu.org; 21 Jan 2019 08:20:10 +0000 Received: from localhost ([127.0.0.1]:39385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glUoH-00046o-K9 for submit@debbugs.gnu.org; Mon, 21 Jan 2019 03:20:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glUoC-00046Y-GH for submit@debbugs.gnu.org; Mon, 21 Jan 2019 03:19:56 -0500 Received: from lists.gnu.org ([209.51.188.17]:58264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glUo7-0001kM-1n for submit@debbugs.gnu.org; Mon, 21 Jan 2019 03:19:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glUo5-00012R-11 for guix-patches@gnu.org; Mon, 21 Jan 2019 03:19:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glUo3-0001iV-8W for guix-patches@gnu.org; Mon, 21 Jan 2019 03:19:45 -0500 Received: from knopi.disroot.org ([178.21.23.139]:41754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glUo2-0001g8-CC for guix-patches@gnu.org; Mon, 21 Jan 2019 03:19:43 -0500 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id ECD1723F75 for ; Mon, 21 Jan 2019 09:19:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZBuQEU_pZJih for ; Mon, 21 Jan 2019 09:19:37 +0100 (CET) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 7b8cb7e4 for ; Mon, 21 Jan 2019 08:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1548058777; bh=L/Dnpa68zShxSgxQK1O7N/mHorIDA5EwKe6b87i1TWo=; h=From:To:Subject:Date; b=Pf/WOL0h4xjr2DrLt0htxyzNNGEPSBy2kApmg16tlz/pk3W7Oxhv4PIGVKJgwG5NA LT35/zlfr/vxAkptrMlGaLFQg5zh3rVoKiMPcujdo5of/TVplocnaDKTv1X3umKKEp LHQh979nZftqpgRqozF94glsotdEB/drK8JH2WYGgocn9Slh6MyYfkeLno8qp53Lls 7PvRS/QK5O+3FuQs0/kjU4VvBLsXAIZfoGsad0OvgSJx0YRLI69PdhvJNOjjBrqUzS I6xrzibEYRAMvIX8cAm2XXKWkV6GGDe1J78KyHmuqupadsKKSEFNwDhiLZptzE8EBF chCvuLjnGe5bg== User-agent: mu4e 1.0; emacs 26.1 From: Meiyo Peng To: guix-patches@gnu.org Subject: [PATCH] Update fish to 3.0.0. Date: Mon, 21 Jan 2019 16:19:29 +0800 Message-ID: <8736pm2zji.fsf@disroot.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.21.23.139 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Hi, This patch series updates fish shell to 3.0.0 and enable fish to source /etc/profile using fish-foreign-env. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-fish-Update-to-3.0.0.patch Content-Transfer-Encoding: quoted-printable From 8d20b9d62d0d6c6c9c572b5871d0063c8b4fdf07 Mon Sep 17 00:00:00 2001 From: Meiyo Peng 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. --- gnu/packages/shells.scm | 110 ++++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index edf747de4..e92b2fcc6 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -9,6 +9,7 @@ ;;; Copyright =C2=A9 2017, 2018 Nils Gillmann ;;; Copyright =C2=A9 2017, 2018 Leo Famulari ;;; Copyright =C2=A9 2017 Arun Isaac +;;; Copyright =C2=A9 2019 Meiyo Peng ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,7 +28,6 @@ =20 (define-module (gnu packages shells) #:use-module (gnu packages) - #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bison) @@ -89,51 +89,85 @@ direct descendant of NetBSD's Almquist Shell (@command{= ash}).") (define-public fish (package (name "fish") - (version "2.7.1") - (source (origin - (method url-fetch) - (uri - (list - (string-append "https://fishshell.com/files/" - version "/fish-" version ".tar.gz") - (string-append "https://github.com/fish-shell/fish-shell/" - "releases/download/" version "/" - 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)))) + (version "3.0.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/fish-shell/fish-shell/" + "releases/download/" version "/" + name "-" version ".tar.gz")) + (sha256 + (base32 "1kzjd0n0sfslkd36lzrvvvgy3qwkd9y466bkrqlnhd5h9dhx77ga")))) (build-system gnu-build-system) - (native-inputs - `(("doxygen" ,doxygen))) (inputs - `(("bc" ,bc) + `(("groff" ,groff) ; for 'fish --help' ("ncurses" ,ncurses) - ("groff" ,groff) ;for 'fish --help' - ("pcre2" ,pcre2) ;don't use the bundled PCRE2 - ("python" ,python-wrapper))) ;for fish_config and manpage complet= ions + ("pcre2" ,pcre2) ; don't use the bundled PCRE2 + ("python" ,python))) ; for fish_config and manpage completions + (native-inputs + `(("doxygen" ,doxygen))) (arguments - '(#:tests? #f ; no check target - #:configure-flags '("--sysconfdir=3D/etc") + '(#:tests? #f ; no check target #:phases (modify-phases %standard-phases - ;; Embed absolute paths to store items. - (add-after 'unpack 'embed-store-paths - (lambda* (#:key inputs outputs #:allow-other-keys) - (substitute* '("share/functions/math.fish" - "share/functions/seq.fish") - (("\\| bc") - (string-append "| " (assoc-ref %build-inputs "bc") - "/bin/bc"))) - (substitute* "share/functions/fish_update_completions.fish" - (("python") (which "python"))) + (add-after 'unpack 'patch-source + (lambda _ + (substitute* '("build_tools/build_commands_hdr.sh" + "build_tools/build_user_doc.sh") + (("/usr/bin/env") "env")) + #t)) + ;; Embed absolute paths. + (add-before 'install 'embed-absolute-paths + (lambda _ + (substitute* '("share/functions/__fish_config_interactive.fis= h" + "share/functions/fish_config.fish" + "share/functions/fish_update_completions.fish") + (("python3") (which "python3"))) (substitute* "share/functions/__fish_print_help.fish" (("nroff") (which "nroff"))) + #t)) + ;; Source /etc/fish/config.fish from $__fish_sysconf_dir/config.f= ish. + (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 us= er'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))))) (synopsis "The friendly interactive shell") (description --=20 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-Add-fish-foreign-env.patch From da8487fe9b9a0a0308f7b929f9e95e8e8297de26 Mon Sep 17 00:00:00 2001 From: Meiyo Peng 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. --- gnu/packages/shells.scm | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index e92b2fcc6..8e2ca2a9a 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages documentation) #:use-module (gnu packages groff) @@ -45,6 +46,7 @@ #:use-module (gnu packages scheme) #:use-module (guix build-system gnu) #:use-module (guix build-system python) + #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix licenses) @@ -182,6 +184,54 @@ and syntax highlighting.") (home-page "https://fishshell.com/") (license gpl2))) +(define-public fish-foreign-env + (package + (name "fish-foreign-env") + (version "0.20190116") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/oh-my-fish/plugin-foreign-env.git") + (commit "dddd9213272a0ab848d474d0cbde12ad034e65bc"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs")))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (func-path (string-append out "/share/fish/functions"))) + (mkdir-p func-path) + (copy-recursively (string-append source "/functions") + func-path) + + ;; Embed absolute paths. + (substitute* `(,(string-append func-path "/fenv.fish") + ,(string-append func-path "/fenv.apply.fish") + ,(string-append func-path "/fenv.main.fish")) + (("bash") + (string-append (assoc-ref %build-inputs "bash") "/bin/bash")) + (("sed") + (string-append (assoc-ref %build-inputs "sed") "/bin/sed")) + ((" tr ") + (string-append " " (assoc-ref %build-inputs "coreutils") + "/bin/tr "))))))) + (inputs + `(("bash" ,bash) + ("coreutils" ,coreutils) + ("sed" ,sed))) + (home-page "https://github.com/oh-my-fish/plugin-foreign-env") + (synopsis "Foreign environment interface for fish shell") + (description "@code{fish-foreign-env} wraps bash script execution in a way +that environment variables that are exported or modified get imported back +into fish.") + (license expat))) + (define-public rc (package (name "rc") -- 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-fish-Use-fish-foreign-env-to-source-etc-profile.patch From aadeb9dea8aff0db8a339cc11d006abff4736fdb Mon Sep 17 00:00:00 2001 From: Meiyo Peng 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 --=-=-= Content-Type: text/plain -- Meiyo Peng https://www.pengmeiyu.com/ --=-=-=--