From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iFULJu/wR2WZAwEAauVa8A:P1 (envelope-from ) for ; Sun, 05 Nov 2023 20:45:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iFULJu/wR2WZAwEAauVa8A (envelope-from ) for ; Sun, 05 Nov 2023 20:45:51 +0100 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 7C9C91793E for ; Sun, 5 Nov 2023 20:45:51 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=lJ7WKYcr; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=riseup.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699213551; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3gDB2xwjA4Fk8E9gCyOIK18Jp+4WoQwBHc5HF+AlgOc=; b=gMNbMRf2ETLudgtsIQbIp00caWlifYLleuJakDeEoi++x2f7zB7ObO66/qAAYCG1S16X15 2XjqsOzlLtsUSIMNs2M18ByMJkdeROaDsCWS6v9JJN1qCgBbjWjZDVC+on1sGwXqeKh3re HgArsBm+AFTtE6CkdUO+d90SpdMRtcmx1vdw1GdS54+xWIrfJ1jqGKpW3nq5PsILbEu+Uy oQCZqUcFj2DsXKy6yC6ZA3DezuXCcQJLFYBuiopHqNoMgEhqq3AE6p1aXabrMR1+fbtFCe YbRJnFhT34xaYXqQDjH3maE4cHHZYoonS/T7Rj1DUdnDOREzawNkCyWzpkuu2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=riseup.net header.s=squak header.b=lJ7WKYcr; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=riseup.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699213551; a=rsa-sha256; cv=none; b=gB+dRBCwAcoaEjqldLUlx7rKyoLCdu7GqirQ0VCwB8JwrO/YJfWZErYJQVFR3Z8wzxR51k iMenZujssop0vHQ7QivBDuAgK6BNT+OW2zPJYNyb2MdaG9KmWB0/oEhZwUmQztGCu7fy5b gu+idmdx6YEejm0IKCmYTDBqO3nTO+2i4xQuXRxH9P5/dt5ynCErKSc6/76gmv4rFvAaz2 3jUMve/lzOY9kGW0DzRSkXFDUwbzd4H+qT6Y3gN+IucmETIqatMKUzqigiYdtvgsWOtMt8 p08dcE9zCXIlnMMXiXNDkmjdmHxz7bxSy/jQ5NozSGowyFChcZJzfTMrxoTeGg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzj3Y-0004zS-OV; Sun, 05 Nov 2023 14:45:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzj3X-0004z5-3N for help-guix@gnu.org; Sun, 05 Nov 2023 14:45:11 -0500 Received: from mx0.riseup.net ([198.252.153.6]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzj3S-0005aQ-Vx for help-guix@gnu.org; Sun, 05 Nov 2023 14:45:10 -0500 Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx0.riseup.net (Postfix) with ESMTPS id 4SNlLc5HnTz9sbH; Sun, 5 Nov 2023 19:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1699213496; bh=SmScLmOwDsp2zaQDMCL23PR9fKIkA8DhwDtWCztZKE8=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=lJ7WKYcr6bVpwTFqgCmvfvudcsk1Kn63eCgX0sEHLmMD6iKhbHSc4nbINQtM5s5ks MCT4eHM3m9UY03zQwfnYR1Mu8j5zJZKzi+GpnM3izugtGB91RHjvXrcnm7a/k2jPz/ c2Nv9QwIHmxQ7/MIUg6eHiFQ95SGSIrQn7wNLPJ4= X-Riseup-User-ID: 63C4FFD3D4DAF013144CCC10E286465BEFECBB6DADB0A71C80D87827C2250188 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4SNlLc0DvrzFpsV; Sun, 5 Nov 2023 19:44:55 +0000 (UTC) References: <1012919286.243533.1698171972070@privateemail.com> From: Csepp To: jean franco osvarcha Cc: help-guix@gnu.org Subject: Re: How to create a package written in Go Date: Sun, 05 Nov 2023 20:28:00 +0100 In-reply-to: <1012919286.243533.1698171972070@privateemail.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=198.252.153.6; envelope-from=raingloom@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -10.60 X-Spam-Score: -10.60 X-Migadu-Queue-Id: 7C9C91793E X-Migadu-Scanner: mx13.migadu.com X-TUID: 7MrItimaTdz9 jean franco osvarcha writes: > Hello guix users. > > I wanted to package the program nwg-look to edit my theme icons and > others through a graphical interface because I am currently using > Tiling Window Manager. > nwg-look is written in GO and its repository is at > [[https://github.com/nwg-piotr/nwg-look]], theoretically its > compilation is simple because you only have to do one: > > -make build > -sudo make install Yggdrasil is similar, I suggest using that as a template. Sadly the Go importer doesn't handle Go module files on the CLI interface, but you can: a) use sed/grep/etc to get the package names from the go.mod files and feed them into guix import go -r (xargs can help) b) look into how the importer is implemented, it might have a go.mod parser in there that you could use. > and reading the Makefile I can also do this manually: > > build: > go build -v -o bin/nwg-look . > > install > mkdir -p $(DESTDIR)/usr/share/nwg-look > mkdir -p $(DESTDIR)/usr/share/nwg-look/langs > mkdir -p $(DESTDIR)/usr/bin > mkdir -p $(DESTDIR)/usr/share/applications > mkdir -p $(DESTDIR)/usr/share/pixmaps > cp stuff/main.glade $(DESTDIR)/usr/share/nwg-look/ > cp langs/* $(DESTDIR)/usr/share/nwg-look/langs/ > cp stuff/nwg-look.desktop $(DESTDIR)/usr/share/applications/ > cp stuff/nwgg-look.svg $(DESTDIR)/usr/share/pixmaps/ > cp bin/nwg-look $(DESTDIR)/usr/bin > > Which you could do this manually but it is not suitable in SDGuix. > Reading the documentation in the Manual and the Cookbook I could only > rely on small sample examples to which I could come up with this > ~nwg-look-osv.scm~ file. Just call make DESTDIR=$output install, you don't need to replicate the install steps. Sudo is not necessary. > (use-modules (guix licenses) > (guix utils) > (guix packages) > (guix download) > (guix build-system go) > (gnu packages golang) > (gnu packages xorg) > (gnu packages gtk) > (gnu packages pkg-config)) > > (package > (name "nwg-look-osv") > (version "0.2.4") > (source (origin > (method url-fetch) > (uri (string-append "https://github.com/nwg-piotr/nwg-look/releases/download/" "v" version "/nwg-look-v" version "_x86_64" > ".tar.gz")) > (sha256 > (base32 > "1iphamazdsvl1cp59y8sxa3iswradna6z6rmm25nmpy3nxxbkapc")))) > (build-system go-build-system) > (synopsis "This application is a part of the nwg-shell project") > (description > "GTK3 settings editor adapted to work in the wlroots environment") > (home-page "https://github.com/nwg-piotr/nwg-look/") > (arguments > '(#:import-path "https://github.com/nwg-piotr/nwg-look/")) > (inputs > (list go > gtk+ > xcur2png > pkg-config)) > (license gpl3+)) You need to put all the Go dependencies into the propagated-inputs field. Or just putting them in inputs might also be fine. Remember, Guix packages don't have access to the network during builds, so Go can't automatically download dependencies. > But I can't get it to compile and install, if I do it manually in a > ~guix shell go gtk+ xcur2png pkg-config~ and compile it on my own it > does but I don't know how to install it and create the manifest. > I don't have much notion in Go and packaging in Guix, but I guide from > all the examples of others packages, I tried to do it with > trivial-build-system but it was messing me up, if anyone has a help or > comment I'm happy to answer. Yes, it works in guix shell because you have network access and Go circumvents the distro packages. > Sorry for my english I'm using a translator DeepL It's quite alright, although I can't make any guarantees about how well my message will get translated.