From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uD3xDmh1FGDOQgAA0tVLHw (envelope-from ) for ; Fri, 29 Jan 2021 20:51:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kMTDCmh1FGAGFwAAB5/wlQ (envelope-from ) for ; Fri, 29 Jan 2021 20:51:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6C7389402D6 for ; Fri, 29 Jan 2021 20:51:51 +0000 (UTC) Received: from localhost ([::1]:56570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5ak8-0005jQ-4W for larch@yhetil.org; Fri, 29 Jan 2021 15:51:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5ajk-0005i2-0L for help-guix@gnu.org; Fri, 29 Jan 2021 15:51:24 -0500 Received: from mail1.fsfe.org ([2001:aa8:ffed:f5f3::151]:51786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5ajf-0001Qq-LI for help-guix@gnu.org; Fri, 29 Jan 2021 15:51:23 -0500 From: Jelle Licht To: Leo Famulari Subject: Re: Packaging (simple) tools in Golang In-Reply-To: References: <86zh0tuqy3.fsf@fsfe.org> Date: Fri, 29 Jan 2021 21:51:15 +0100 Message-ID: <86r1m3v54s.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:aa8:ffed:f5f3::151; envelope-from=jlicht@fsfe.org; helo=mail1.fsfe.org X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.75 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsfe.org (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 6C7389402D6 X-Spam-Score: -0.75 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7b2tiMMQToNR Leo Famulari 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 /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---