From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Contributing to Package Definitions Date: Sun, 18 Mar 2018 16:42:11 +0100 Message-ID: <87tvtdmlv0.fsf@elephly.net> References: <20180318163718.Horde.0DcEOHf4tFz1cZ9UsEQLCxn@swecha.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exaSD-0001bL-9h for help-guix@gnu.org; Sun, 18 Mar 2018 11:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exaSA-0005M5-67 for help-guix@gnu.org; Sun, 18 Mar 2018 11:42:37 -0400 Received: from sinope02.bbbm.mdc-berlin.de ([141.80.25.24]:34434) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exaS9-0005KC-NO for help-guix@gnu.org; Sun, 18 Mar 2018 11:42:34 -0400 In-Reply-To: <20180318163718.Horde.0DcEOHf4tFz1cZ9UsEQLCxn@swecha.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: sahi@swecha.net Cc: help-guix@gnu.org Hi Sahithi, I=E2=80=99ve already replied to the email you=E2=80=99ve sent me earlier,= so to avoid confusion, here=E2=80=99s the response I sent earlier: > Also imported a package definition as a test, which resulted a Scheme C= ode. 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 =E2=80=9C./bootstrap=E2=80= =9D, =E2=80=9C./configure --localstatedir=3D/var=E2=80=9D, and =E2=80=9Cmake=E2= =80=9D (do not =E2=80=9Cmake install=E2=80=9D). Then you can modify a file under =E2=80=9Cgnu/packages=E2=80=9D to add a = new package definition. Since we already have a package definition for the =E2=80=9Chello=E2=80=9D= 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 =E2=80=9Cgnu/packages/cran.scm=E2=80=9D, but also in =E2=80=9Cgnu/package= s/statistics.scm=E2=80=9D. You can use =E2=80=9Cguix import cran -r PACKAGE=E2=80=9D to recursively gene= rate package definitions for =E2=80=9CPACKAGE=E2=80=9D and its dependencies. You can browse the CRAN here: https://cran.r-project.org/web/packages/ I suggest using the =E2=80=9Ccran=E2=80=9D importer because its output is= usually high-quality and R packages are usually relatively simple. When adding the output to =E2=80=9Cgnu/packages/cran.scm=E2=80=9D please check and ad= just the license field (sometimes it only generates =E2=80=9C#f=E2=80=9D as the li= cense, i.e. a =E2=80=9Cfalse=E2=80=9D value); you will need to prefix the license with = =E2=80=9Clicense:=E2=80=9D 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 =E2=80=9Cpre-inst-env=E2=80=9D script tells Guix to use the local sou= rce code checkout instead of the version you installed. When this works run =E2=80=9Cguix lint=E2=80=9D on the package definition= to check for errors. When you=E2=80=99re satisfied, please make one commit per packag= e definition and export them as patches with =E2=80=9Cgit format-patch=E2=80= =9D (e.g. =E2=80=9Cgit format-patch -1=E2=80=9D for generating a patch for the last commit). Th= en send the patch to =E2=80=9Cguix-patches@gnu.org=E2=80=9D 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=E2=80=99m not availab= le. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net