unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: jean franco osvarcha <talkme@osvarcha.website>
To: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: How to create a package written in Go
Date: Tue, 24 Oct 2023 13:26:12 -0500 (PET)	[thread overview]
Message-ID: <1012919286.243533.1698171972070@privateemail.com> (raw)

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

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.

(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+))

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.

Sorry for my english I'm using a translator DeepL

             reply	other threads:[~2023-10-26 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 18:26 jean franco osvarcha [this message]
2023-11-05 19:28 ` How to create a package written in Go Csepp

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=1012919286.243533.1698171972070@privateemail.com \
    --to=talkme@osvarcha.website \
    --cc=help-guix@gnu.org \
    /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).