all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: sahi@swecha.net
Cc: help-guix@gnu.org
Subject: Re: Contributing to Package Definitions
Date: Sun, 18 Mar 2018 16:42:11 +0100	[thread overview]
Message-ID: <87tvtdmlv0.fsf@elephly.net> (raw)
In-Reply-To: <20180318163718.Horde.0DcEOHf4tFz1cZ9UsEQLCxn@swecha.org>


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 “guix-patches@gnu.org” 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	other threads:[~2018-03-18 15:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-18 11:07 Contributing to Package Definitions sahi
2018-03-18 15:42 ` Ricardo Wurmus [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvtdmlv0.fsf@elephly.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=help-guix@gnu.org \
    --cc=sahi@swecha.net \
    /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.
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.