From patchwork Tue Sep 13 09:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Rohleder X-Patchwork-Id: 42579 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 1E09627BBEA; Tue, 13 Sep 2022 10:56:19 +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 83F8927BBE9 for ; Tue, 13 Sep 2022 10:56:18 +0100 (BST) Received: from localhost ([::1]:54880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY2eP-0001at-MX for patchwork@mira.cbaines.net; Tue, 13 Sep 2022 05:56:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY2aI-00072t-Uy for guix-patches@gnu.org; Tue, 13 Sep 2022 05:52:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY2aI-000866-LZ for guix-patches@gnu.org; Tue, 13 Sep 2022 05:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oY2aI-0006CM-2K for guix-patches@gnu.org; Tue, 13 Sep 2022 05:52: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: Tue, 13 Sep 2022 09:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57722 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 57722@debbugs.gnu.org Received: via spool by 57722-submit@debbugs.gnu.org id=B57722.166306266623761 (code B ref 57722); Tue, 13 Sep 2022 09:52:02 +0000 Received: (at 57722) by debbugs.gnu.org; 13 Sep 2022 09:51:06 +0000 Received: from localhost ([127.0.0.1]:48879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY2ZL-0006B8-C8 for submit@debbugs.gnu.org; Tue, 13 Sep 2022 05:51:06 -0400 Received: from wp224.webpack.hosteurope.de ([80.237.132.231]:39918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY2ZG-0006Ad-Nr for 57722@debbugs.gnu.org; Tue, 13 Sep 2022 05:51:02 -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 1oY2ZE-0007Nq-KZ; Tue, 13 Sep 2022 11:50:56 +0200 Received: from [192.168.1.3] (helo=micha) by www.rohleder.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oY2YE-000I1G-Lr; Tue, 13 Sep 2022 11:50:56 +0200 From: Michael Rohleder References: <20220910214721.9993-1-mike@rohleder.de> <5d80a74a-fb2f-2236-a722-62e9d20b8487@telenet.be> Date: Tue, 13 Sep 2022 11:49:57 +0200 In-Reply-To: <5d80a74a-fb2f-2236-a722-62e9d20b8487@telenet.be> (Maxime Devos's message of "Sun, 11 Sep 2022 13:47:58 +0200") Message-ID: <87k067ppru.fsf@rohleder.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de;mike@rohleder.de;1663062658;bc20d8dc; X-HE-SMSGID: 1oY2ZE-0007Nq-KZ 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 Hey Maxime, Thank you for reviewing and your helpful tips! Here is a second version, I hope it's better. I dont know how to test cross compiling, though (on a x86_64 system): ./pre-inst-env guix build --system=aarch64-linux go-ipfs [...] building /gnu/store/ssvif7gdgv7xn7jmgmcp4ws71fgmwn5x-go-ipfs-0.11.0.drv... ;;; Stat of /tmp/guix-build-go-ipfs-0.11.0.drv-0/guile failed: ;;; In procedure stat: No such file or directory: "/tmp/guix-build-go-ipfs-0.11.0.drv-0/guile" Backtrace: 0 (primitive-load "/tmp/guix-build-go-ipfs-0.11.0.drv-0/g?") ERROR: In procedure primitive-load: In procedure open-file: No such file or directory: "/tmp/guix-build-go-ipfs-0.11.0.drv-0/guile" And then I'm completely lost and confused. ;) From bbf32c53a2402f6f123d00d2e5ece9efdbf10504 Mon Sep 17 00:00:00 2001 From: Michael Rohleder Date: Tue, 13 Sep 2022 11:29:23 +0200 Subject: [PATCH] gnu: go-ipfs: Install bash completion. * gnu/packages/ipfs.scm (go-ipfs)[arguments]: Use gexp. Add 'install-bashcompletion phase to install bash completion. --- gnu/packages/ipfs.scm | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/gnu/packages/ipfs.scm b/gnu/packages/ipfs.scm index ccc36007b4..d1e04c3ae0 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. ;;; @@ -22,6 +22,7 @@ (define-module (gnu packages ipfs) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix download) #:use-module (guix build-system go) @@ -229,10 +230,28 @@ (define-public go-ipfs (file-name (string-append name "-" version "-source")))) (build-system go-build-system) (arguments - `(#:unpack-path "github.com/ipfs/go-ipfs" - #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs")) + (list + #:unpack-path "github.com/ipfs/go-ipfs" + #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs" + #:phases + #~(modify-phases %standard-phases + ;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md + (add-after 'install 'install-bashcompletion + (lambda _ + (let ((completiondir (string-append #$output + "/etc/bash_completion.d"))) + (mkdir-p completiondir) + (with-output-to-file (string-append completiondir "/ipfs") + (lambda _ + (invoke #$(if (%current-target-system) + "ipfs" + #~(string-append #$output "/bin/ipfs")) + "commands" "completion" "bash"))))))))) (native-inputs - (list python-minimal-wrapper zsh)) + (append (if (%current-target-system) + (list this-package) + '()) + (list python-minimal-wrapper zsh))) (home-page "https://ipfs.io") (synopsis "Go implementation of IPFS, a peer-to-peer hypermedia protocol") (description "IPFS is a global, versioned, peer-to-peer file system. It -- 2.37.3