GNU bug report logs -
#58408
[PATCH] gnu: Add doctl.
Previous Next
Reported by: Matthew James Kraai <kraai <at> ftbfs.org>
Date: Mon, 10 Oct 2022 09:56:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
Here's an updated patch that installs autocompletion scripts for Bash, fish, and Zsh.
--
Matt
From 4e856170fce977faea180f432d705772eb3ed368 Mon Sep 17 00:00:00 2001
From: Matthew James Kraai <kraai <at> ftbfs.org>
Date: Sun, 9 Oct 2022 05:07:23 -0700
Subject: [PATCH] gnu: Add doctl.
* gnu/packages/admin.scm (doctl): New variable.
---
gnu/packages/admin.scm | 51 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 13d582403b..b92c03b567 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -54,6 +54,7 @@
;;; Copyright © 2022 Petr Hodina <phodina <at> protonmail.com>
;;; Copyright © 2022 Andreas Rammhold <andreas <at> rammhold.de>
;;; Copyright © 2022 ( <paren <at> disroot.org>
+;;; Copyright © 2022 Matthew James Kraai <kraai <at> ftbfs.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5596,3 +5597,53 @@ (define-public rex
several hosts in succession or in parallel. It can also be used to copy a
file or files to several hosts.")
(license license:gpl3+)))
+
+(define-public doctl
+ (package
+ (name "doctl")
+ (version "1.83.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/digitalocean/doctl")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1narjmj3npd39gxi42k3h4zjyiaq5lvjv31vaxw8slf9h9sjhjh9"))))
+ (build-system go-build-system)
+ (arguments
+ (list #:import-path "github.com/digitalocean/doctl/cmd/doctl"
+ #:unpack-path "github.com/digitalocean/doctl"
+ #:go go-1.19
+ #:build-flags
+ #~(list (string-append "-ldflags=-X github.com/digitalocean/doctl.Label=release"
+ " -X github.com/digitalocean/doctl.Major="
+ (car (string-split #$version #\.))
+ " -X github.com/digitalocean/doctl.Minor="
+ (cadr (string-split #$version #\.))
+ " -X github.com/digitalocean/doctl.Patch="
+ (caddr (string-split #$version #\.))))
+ #:install-source? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-completions
+ (lambda _
+ (let ((install-completion
+ (lambda (shell file)
+ (let ((file (string-append #$output file)))
+ (mkdir-p (dirname file))
+ (with-output-to-file file
+ (lambda _
+ (invoke (string-append #$output "/bin/doctl")
+ "completion" shell)))))))
+ (install-completion "bash" "/etc/bash_completion.d/doctl")
+ (install-completion "fish"
+ "/etc/fish/completions/doctl.fish")
+ (install-completion "zsh"
+ "/etc/zsh/site-functions/_doctl")))))))
+ (home-page "https://github.com/digitalocean/doctl")
+ (synopsis "Command line client for DigitalOcean")
+ (description
+ "@code{doctl} provides a unified command line interface to the DigitalOcean API.")
+ (license license:asl2.0)))
--
2.38.0
This bug report was last modified 2 years and 207 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.