unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nikita Karetnikov <nikita@karetnikov.org>
To: Joshua Branson <jbranso@purdue.edu>
Cc: guix-devel@gnu.org
Subject: Re: Want help with writing package recipe
Date: Fri, 07 Mar 2014 13:41:27 +0400	[thread overview]
Message-ID: <87iorqwdko.fsf@karetnikov.org> (raw)
In-Reply-To: <5318FED3.8060305@purdue.edu> (Joshua Branson's message of "Thu, 06 Mar 2014 18:03:47 -0500")

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

>     I used guix hash -f base32 to export the base32 hash, which is:
> i5q225g6twsg5egicgpt6ub7hn4m7pdzg56hwxx57jm4o4ns5fgq

You need ‘nix-base32’, which is the default format, so use ‘guix hash’.

>     I've written a recipe for gtypist located here:
> http://pastebin.com/ysLHJUWg

Please include everything in the message body.  Otherwise, some
information may get lost in the future.

> (use-modules (guix packages)
>              (guix download)
>              (guix build-system gnu)
>              (guix licenses))

You must use ‘define-module’ instead.  See the recipes under
‘gnu/packages’ in the source tree, e.g., ‘wget.scm’.

> (define gtypist

Guix can’t access the definition if it’s not public, so substitute the
above with ‘define-public’.

>   (package
>     (name "gtypist")
>     (version "2.9.4")
>     (source (origin
>              (method url-fetch)
>              (uri (string-append "mirror://gnu/gtypist-" version
>                                  ".tar.gz"))
>              (sha256
>               (base32 "i5q225g6twsg5egicgpt6ub7hn4m7pdzg56hwxx57jm4o4ns5fgq"))))

Don’t forget to recompute the hash.

>     (build-system gnu-build-system)
>     (inputs `(("perl" ,perl)))
>     (inputs `(("ncurses" ,ncurses)))

No need for two ‘input’ fields here.  See the definition of ‘coreutils’
in ‘gnu/packages/base.scm’ for an example.

>     (synopsis "GNU Typist")
>     (description "The official GNU software to help improve your typing.")
>     (home-page "http://www.gnu.org/software/gtypist/")

Make sure to run ‘make sync-descriptions’ to check the above.  Use the
proposed synopsis and description.

>     (license gpl3+)))

>     But now, I'm stuck. I'm not sure how to tell guix to run the
> recipe. Guix's documentation says that the command "guix build options
> package-or-derivation"
>     will build the package into a binary that I can run on my
> machine. I can't say "guix build gtypist", because guix does not
> currently have a recipe to build gtypist,     and I can't say "guix
> build options /path/to/gtypist.dri", because there is not a derivation
> file on my machine for gtypist.

Put the code in a file, say, ‘gnu/packages/gtypist.scm’.  Then, run
‘guix build -K gtypist’ in order to build it.  If any errors occur, try
to get some hints by running (from the root of your guix directory)

$ ./pre-inst-env guile
scheme@(guile-user)> ,use (gnu packages gtypist)

> How do I submit a patch when I get it working?

See the “Submitting Patches” section in ‘HACKING’.  Basically, you add
the needed files with ‘git add’, commit them with ‘git commit’, and
produce the patch with ‘git format-patch’.  After that you send the
patch to the list.  Your patch should look similar to this one [1].

Also, there is a packaging tutorial [2].

[1] http://git.savannah.gnu.org/cgit/guix.git/commit/?id=ece262461625e80957d904f39a6818286099d367
[2] https://gnu.org/software/guix/guix-ghm-andreas-20130823.pdf

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

      parent reply	other threads:[~2014-03-07  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.103.1394125227.23151.guix-devel@gnu.org>
2014-03-06 23:03 ` Want help with writing package recipe Joshua Branson
2014-03-07  9:26   ` Ludovic Courtès
2014-03-07  9:41   ` Nikita Karetnikov [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

  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=87iorqwdko.fsf@karetnikov.org \
    --to=nikita@karetnikov.org \
    --cc=guix-devel@gnu.org \
    --cc=jbranso@purdue.edu \
    /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 public inbox

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

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).