Subject: Re: [bug#58408] [PATCH] gnu: Add doctl.

From: "(" <[email-masked]>
Date: Mon, 10 Oct 2022 12:01:58 +0100

Hey Matthew,

On Mon Oct 10, 2022 at 10:54 AM BST, Matthew James Kraai wrote:
> * gnu/packages/doctl.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

You sure there's no better place to put it than a new file? Maybe
``gnu/packages/admin.scm''?

> +  #:use-module (guix download)

Since you're using git-fetch, you shouldn't need this module, right?

> +    (arguments
> +     `(#:build-flags '(,(string-append "-ldflags=-X github.com/digitalocean/doctl.Label=release"
> +                                       " -X github.com/digitalocean/doctl.Major="
> +                                       (first (string-split version #\.))
> +                                       " -X github.com/digitalocean/doctl.Minor="
> +                                       (second (string-split version #\.))
> +                                       " -X github.com/digitalocean/doctl.Patch="
> +                                       (third (string-split version #\.))))

So, this whole thing would be better formatted with "new style" arguments
(using ``list'' and gexps). Like this:

 (arguments
  (list #:build-flags
        #~(list (string-append ...))
        #| et cetera |#))

This would also allow you to remove the unquote in ``,go-1.19''. Note that only
``#:build-flags'' needs the gexp ``#~'' in this arguments list.

> +       #:go ,go-1.19

Might be best to put this above build-flags.

> +       #:import-path "github.com/digitalocean/doctl/cmd/doctl"

The import-path is usually at the top of the arguments list.

> +       #:unpack-path "github.com/digitalocean/doctl"))

And the unpack-path is usually directly after the import-path.

> +    (description
> +     "doctl provides a unified command line interface to the DigitalOcean API.")

Change ``doctl'' to ``@code{doctl}''.

    -- (