guix-devel
[Top][All Lists]
Advanced

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

Re: Want help with writing package recipe


From: Nikita Karetnikov
Subject: Re: Want help with writing package recipe
Date: Fri, 07 Mar 2014 13:41:27 +0400

>     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: pgptqpwPwWI7K.pgp
Description: PGP signature


reply via email to

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