From patchwork Sat Sep 10 21:47:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Rohleder X-Patchwork-Id: 42457 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 63CF127BBEA; Sat, 10 Sep 2022 22:49:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 141FB27BBE9 for ; Sat, 10 Sep 2022 22:49:22 +0100 (BST) Received: from localhost ([::1]:54616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oX8Lp-0003Sz-80 for patchwork@mira.cbaines.net; Sat, 10 Sep 2022 17:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX8LW-0003RY-L7 for guix-patches@gnu.org; Sat, 10 Sep 2022 17:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oX8LW-0007fQ-9X for guix-patches@gnu.org; Sat, 10 Sep 2022 17:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oX8LW-00062S-1E for guix-patches@gnu.org; Sat, 10 Sep 2022 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57722] [PATCH] gnu: ipfs: Install bash completion. Resent-From: Michael Rohleder Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 10 Sep 2022 21:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57722 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57722@debbugs.gnu.org Cc: Michael Rohleder X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166284651023171 (code B ref -1); Sat, 10 Sep 2022 21:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Sep 2022 21:48:30 +0000 Received: from localhost ([127.0.0.1]:40479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX8L0-00061e-Ad for submit@debbugs.gnu.org; Sat, 10 Sep 2022 17:48:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:32820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oX8Ky-00061W-7v for submit@debbugs.gnu.org; Sat, 10 Sep 2022 17:48:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX8Ky-0002u1-3D for guix-patches@gnu.org; Sat, 10 Sep 2022 17:48:28 -0400 Received: from wp224.webpack.hosteurope.de ([2a01:488:42:1000:50ed:84e7::]:40568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX8Kw-0007aw-6w for guix-patches@gnu.org; Sat, 10 Sep 2022 17:48:27 -0400 Received: from www.rohleder.de ([37.61.204.227]); authenticated by wp224.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1oX8Kq-0000G9-EE; Sat, 10 Sep 2022 23:48:20 +0200 Received: from [192.168.1.3] (helo=micha.rohleder.de) by www.rohleder.de with esmtp (Exim 4.95) (envelope-from ) id 1oX8Jh-000eqs-UP; Sat, 10 Sep 2022 23:48:20 +0200 From: Michael Rohleder Date: Sat, 10 Sep 2022 23:47:21 +0200 Message-Id: <20220910214721.9993-1-mike@rohleder.de> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de;mike@rohleder.de;1662846506;de92319b; X-HE-SMSGID: 1oX8Kq-0000G9-EE Received-SPF: permerror client-ip=2a01:488:42:1000:50ed:84e7::; envelope-from=mike@rohleder.de; helo=wp224.webpack.hosteurope.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/ipfs.scm (ipfs)[arguments]: Add 'install-bashcompletion phase to install bash completion. --- gnu/packages/ipfs.scm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gnu/packages/ipfs.scm b/gnu/packages/ipfs.scm index ccc36007b4..faa209bf2a 100644 --- a/gnu/packages/ipfs.scm +++ b/gnu/packages/ipfs.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2018 Pierre Neidhardt ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2019, 2020 Martin Becze -;;; Copyright © 2020, 2021 Michael Rohleder +;;; Copyright © 2020, 2021, 2022 Michael Rohleder ;;; ;;; This file is part of GNU Guix. ;;; @@ -230,7 +230,26 @@ (define-public go-ipfs (build-system go-build-system) (arguments `(#:unpack-path "github.com/ipfs/go-ipfs" - #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs")) + #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs" + #:modules ((guix build utils) + (guix build go-build-system) + (ice-9 popen) + (ice-9 textual-ports)) + #:phases + (modify-phases %standard-phases + ;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md + (add-after 'install 'install-bashcompletion + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (completiondir (string-append out "/etc/bash_completion.d"))) + (mkdir-p completiondir) + (call-with-output-file (string-append completiondir "/ipfs") + (lambda (port) + (let ((input-pipe (open-pipe* OPEN_READ + (string-append out "/bin/ipfs") + "commands" "completion" "bash"))) + (display (get-string-all input-pipe) port) + (close-pipe input-pipe)))))))))) (native-inputs (list python-minimal-wrapper zsh)) (home-page "https://ipfs.io")