unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Packaging (simple) tools in Golang
@ 2021-01-28 13:33 Jelle Licht
  2021-01-29  0:35 ` Leo Famulari
  2021-01-29  0:35 ` Leo Famulari
  0 siblings, 2 replies; 5+ messages in thread
From: Jelle Licht @ 2021-01-28 13:33 UTC (permalink / raw)
  To: help-guix

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.

Thanks for pointers or clarifications!
 - Jelle


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging (simple) tools in Golang
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Famulari @ 2021-01-29  0:35 UTC (permalink / raw)
  To: Jelle Licht; +Cc: help-guix

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.

To clarify, when you tell it not to install the source code, it installs
the source code anyways?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging (simple) tools in Golang
  2021-01-28 13:33 Packaging (simple) tools in Golang Jelle Licht
  2021-01-29  0:35 ` Leo Famulari
@ 2021-01-29  0:35 ` Leo Famulari
  2021-01-29 20:51   ` Jelle Licht
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Famulari @ 2021-01-29  0:35 UTC (permalink / raw)
  To: Jelle Licht; +Cc: help-guix

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?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging (simple) tools in Golang
  2021-01-29  0:35 ` Leo Famulari
@ 2021-01-29 20:39   ` Jelle Licht
  0 siblings, 0 replies; 5+ messages in thread
From: Jelle Licht @ 2021-01-29 20:39 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

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.
>
> To clarify, when you tell it not to install the source code, it installs
> the source code anyways?

Yeah, I fumbled that up summarising it here; `#:install-source?' does
exactly what it says on the tin.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging (simple) tools in Golang
  2021-01-29  0:35 ` Leo Famulari
@ 2021-01-29 20:51   ` Jelle Licht
  0 siblings, 0 replies; 5+ messages in thread
From: Jelle Licht @ 2021-01-29 20:51 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

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---


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-29 20:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).