help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contributing to Package Definitions


From: Ricardo Wurmus
Subject: Re: Contributing to Package Definitions
Date: Sun, 18 Mar 2018 16:42:11 +0100
User-agent: mu4e 1.0; emacs 25.3.1

Hi Sahithi,

I’ve already replied to the email you’ve sent me earlier, so to avoid
confusion, here’s the response I sent earlier:

> Also imported a package definition as a test, which resulted a Scheme Code.

The Scheme code is a package definition.  As you can see, package
definitions are not just plain data, but evaluate to a package object in
Scheme.  To add a package definition to Guix, you first need to fetch
the source code from git and compile it:

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

You can use Guix to get an environment for compiling Guix:

    guix environment guix

This will drop you in a sub-shell where all dependencies you need for
Guix are available, so all you need to do is run “./bootstrap”,
“./configure --localstatedir=/var”, and “make” (do not “make install”).
Then you can modify a file under “gnu/packages” to add a new package
definition.

Since we already have a package definition for the “hello” package, you
may want to package something else.  My suggestion is to package an R
package from CRAN.  We have a bunch of R packages in
“gnu/packages/cran.scm”, but also in “gnu/packages/statistics.scm”.  You
can use “guix import cran -r PACKAGE” to recursively generate package
definitions for “PACKAGE” and its dependencies.

You can browse the CRAN here:

    https://cran.r-project.org/web/packages/

I suggest using the “cran” importer because its output is usually
high-quality and R packages are usually relatively simple.  When adding
the output to “gnu/packages/cran.scm” please check and adjust the
license field (sometimes it only generates “#f” as the license, i.e. a
“false” value); you will need to prefix the license with “license:”
because we import the license values with that prefix (see the module
definition at the very top of the file).  Also make sure that the
description field contains complete sentences (the CRAN descriptions
often use sentence fragments).

After adding the package definition, try building it with

    ./pre-inst-env guix build the-package

The “pre-inst-env” script tells Guix to use the local source code
checkout instead of the version you installed.

When this works run “guix lint” on the package definition to check for
errors.  When you’re satisfied, please make one commit per package
definition and export them as patches with “git format-patch” (e.g. “git
format-patch -1” for generating a patch for the last commit).  Then send
the patch to address@hidden and please put me in Cc.

For the Outreachy contribution sending a single patch is sufficient.

Please let me know if any of these steps is unclear.  Also feel free to
ask for help on the #guix IRC channel.  People there might be more
responsive than me if you need help at times when I’m not available.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]