all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Guix packaging tutorial with hand holding
@ 2019-05-30  5:41 白い熊
  2019-05-30  6:56 ` Ricardo Wurmus
  2019-05-30 21:37 ` Björn Höfling
  0 siblings, 2 replies; 4+ messages in thread
From: 白い熊 @ 2019-05-30  5:41 UTC (permalink / raw)
  To: help-guix


Hi Guix:

I'd like to advance step-by-step in learning how to write package definitions with the eventual goal of contributing to Guix.

For this I'd like to ask if someone could help me and other Guix-hacking-packaging beginners with some hand holding — concrete though, with examples, so I could then proceed through trial and error.

I've tried to follow the Guix packaging tutorial guide [1]. I can build and install the sample my-hello package with the from-file approach.

Next, I'd like to build and install the sample my-libgit2 package. Here, however I can't proceed:

The tutorial is old so it mentions the “GUIX_PACKAGE_PATH” approach which is deprecated and recommends using Guix channels. In the Guix manual I see the way to add a channel to your Guix, now is there a way to use a local git directory? So that I could experiment locally — without right away going through syncing the local git with an online git repository? If not I'll guess I'll have to go through Github just to play with some intro stuff.

Second, working on the Guix git checkout is recommended as the best way. What is the way of working with Guix git checkout on a GuixSD system? I.e. should I pull, build it — the git. Then what? Where to run guix pull and guix package -u — in the git, leave the SD versions un-updated?

Finally, are there some nice examples of using inheritance? I.e. I just want to add a compile option, or some dependency to some package — is there some example I can play with?

Many thanks for any help! :@)

[1] https://www.gnu.org/software/guix/blog/2018/a-packaging-tutorial-for-guix/

--
 Best regards / 宜しく御願い致します / S pozdravem / C уважением / Z poważaniem /
 Mit freundlichen Grüßen

白い熊

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

* Re: Guix packaging tutorial with hand holding
  2019-05-30  5:41 Guix packaging tutorial with hand holding 白い熊
@ 2019-05-30  6:56 ` Ricardo Wurmus
  2019-06-01 22:20   ` 白い熊
  2019-05-30 21:37 ` Björn Höfling
  1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2019-05-30  6:56 UTC (permalink / raw)
  To: 白い熊; +Cc: help-guix

Hi,

> The tutorial is old so it mentions the “GUIX_PACKAGE_PATH” approach
> which is deprecated and recommends using Guix channels.

This is not a problem.  GUIX_PACKAGE_PATH is still supported.  It works
fine for this kind of thing where you temporarily extend the number of
modules that Guix loads.  For long-term use we recommend the use of
channels instead.

> In the Guix manual I see the way to add a channel to your Guix, now is
> there a way to use a local git directory? So that I could experiment
> locally — without right away going through syncing the local git with
> an online git repository? If not I'll guess I'll have to go through
> Github just to play with some intro stuff.

You don’t need Github or any other externally hosted repository.  You
can use a local git directory just fine.

> Second, working on the Guix git checkout is recommended as the best
> way. What is the way of working with Guix git checkout on a GuixSD
> system? I.e. should I pull, build it — the git. Then what? Where to
> run guix pull and guix package -u — in the git, leave the SD versions
> un-updated?

When working with the Guix source code in a git checkout you don’t
generally use “guix pull”.  Instead you use “./pre-inst-env guix” to
have Guix act on the modified source code.  Using the git checkout is
how you can modify modules that are part of Guix, which is how you can
create patches that we can apply to Guix, so that everybody benefits
from your changes.

If you want to keep using the git checkout as your primary installation
of Guix you can do that too, but combined with “guix pull” it’s a little
inconvenient.

> Finally, are there some nice examples of using inheritance? I.e. I
> just want to add a compile option, or some dependency to some package
> — is there some example I can play with?

Yes, there are a couple of packages in Guix that are just variants of
other packages.  In gnu/packages/algebra.scm, for example, there’s the
definition of “fftw”, which is what both “fftwf” and “fftw-openmpi”
inherit from.

--
Ricardo

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

* Re: Guix packaging tutorial with hand holding
  2019-05-30  5:41 Guix packaging tutorial with hand holding 白い熊
  2019-05-30  6:56 ` Ricardo Wurmus
@ 2019-05-30 21:37 ` Björn Höfling
  1 sibling, 0 replies; 4+ messages in thread
From: Björn Höfling @ 2019-05-30 21:37 UTC (permalink / raw)
  To: 白い熊; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

Hello 白い熊,

I can also recommend the new Guix tutorial videos.

They are currently located here:

https://archive.org/details/guix-videos

(When finalized, they should move to a GNU website.)

I especially recommend the "packaging" videos, where a setup from git
is shown. It is doing things step-by-step. If you are then stuck with
any problem, you might also like to ask for help on IRC.

Björn

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: Guix packaging tutorial with hand holding
  2019-05-30  6:56 ` Ricardo Wurmus
@ 2019-06-01 22:20   ` 白い熊
  0 siblings, 0 replies; 4+ messages in thread
From: 白い熊 @ 2019-06-01 22:20 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix


Thu May 30 08:56:58 GMT+02:00 2019 Ricardo Wurmus :

> You don’t need Github or any other externally hosted repository. You
 > can use a local git directory just fine.

So in the channel definition using a local directory what would the syntax be instead of the “(url…” bit?

> > Second, working on the Guix git checkout is recommended as the best
 > > way. What is the way of working with Guix git checkout on a GuixSD
 > > system? I.e. should I pull, build it — the git. Then what? Where to
 > > run guix pull and guix package -u — in the git, leave the SD versions
 > > un-updated?
 >
 > When working with the Guix source code in a git checkout you don’t
 > generally use “guix pull”. Instead you use “./pre-inst-env guix” to
 > have Guix act on the modified source code. Using the git checkout is
 > how you can modify modules that are part of Guix, which is how you can
 > create patches that we can apply to Guix, so that everybody benefits
 > from your changes.
 >
 > If you want to keep using the git checkout as your primary installation
 > of Guix you can do that too, but combined with “guix pull” it’s a little
 > inconvenient.

So what would the recommended workflow be, with a git checkout on top of GuixSD?

— Only use “guix pull, guix package -u, and guix system reconfigure” for GuixSD for root to have the base system up-to-date?
 — Don't use “guix pull” as regular user for GuixSD, but install user packages from the git?
 — In git use “./configure --localstatedir=/var; make; make install”? Also “make install”?
 — Then to install packages use “./pre-inst-env guix install”?

--
 Best regards / 宜しく御願い致します / S pozdravem / C уважением / Z poważaniem /
 Mit freundlichen Grüßen

白い熊

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

end of thread, other threads:[~2019-06-01 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30  5:41 Guix packaging tutorial with hand holding 白い熊
2019-05-30  6:56 ` Ricardo Wurmus
2019-06-01 22:20   ` 白い熊
2019-05-30 21:37 ` Björn Höfling

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.