[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Packaging (simple) tools in Golang
From: |
Jelle Licht |
Subject: |
Re: Packaging (simple) tools in Golang |
Date: |
Fri, 29 Jan 2021 21:51:15 +0100 |
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---