unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Jelle Licht <jlicht@fsfe.org>
To: Leo Famulari <leo@famulari.name>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Packaging (simple) tools in Golang
Date: Fri, 29 Jan 2021 21:51:15 +0100	[thread overview]
Message-ID: <86r1m3v54s.fsf@fsfe.org> (raw)
In-Reply-To: <YBNYR8jwpoXBPFs8@jasmine.lan>

Leo Famulari <leo@famulari.name> writes:

> On Thu, Jan 28, 2021 at 02:33:08PM +0100, Jelle Licht wrote:
>> Hello Guix!
>> 
>> How would one package a tool written in Go(lang) using guix? I am
>> looking at https://github.com/guitmz/n26, but all of my efforts using
>> the go-build-system end up having only some documentation and (if I set
>> `#:install-source?' to #f) the sources in the resultant output. Ideally,
>> I would end up with a <out>/bin/n26 in addition to the documentation I
>> get now.
>
> Can you share your package definition?

I figured it out, it was a problem with the `#:unpack-path' being
"github.com/guitmz/n26", yet the `#:import-path' needing to be
"github.com/guitmz/n26/cmd/n26". Cargo-culting saves the day yet again.

I'm not sure whether it works, as I don't have an account with this bank
to test it with, but it seems to at least build reproducibly on two of
my machines.

I'll clean it up and verify that it actually works before pushing it.
 - Jelle

--8<---------------cut here---------------start------------->8---
(define-public go-n26
  (package
    (name "go-n26")
    (version "1.5.2")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/guitmz/n26")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
		"0fdmfmg9cwycaaghgyax0qkqc6pzsghis05y2kdmddbjvkrg09fg"))))
    (build-system go-build-system)
    (arguments
     `(#:import-path "github.com/guitmz/n26/cmd/n26"
       #:unpack-path "github.com/guitmz/n26"
       #:install-source? #f))
    (native-inputs
     `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
       ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
       ("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
       ("go-golang-org-x-oauth2" ,go-golang-org-x-oauth2)
       ("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
       ("go-github-com-olekukonko-tablewriter" ,go-github-com-olekukonko-tablewriter)
       ("go-github-com-urfave-cli" ,go-github-com-urfave-cli)))
    (home-page "https://github.com/guitmz/n26")
    (synopsis "API and CLI to get information of your N26 account")
    (description "API and CLI to get information of your N26 account")
    (license license:expat)))
--8<---------------cut here---------------end--------------->8---


      reply	other threads:[~2021-01-29 20:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 13:33 Packaging (simple) tools in Golang Jelle Licht
2021-01-29  0:35 ` Leo Famulari
2021-01-29 20:39   ` Jelle Licht
2021-01-29  0:35 ` Leo Famulari
2021-01-29 20:51   ` Jelle Licht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r1m3v54s.fsf@fsfe.org \
    --to=jlicht@fsfe.org \
    --cc=help-guix@gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).