summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-11-04 19:45:40 +0100
committerLudovic Courtès <ludo@gnu.org>2012-11-04 19:45:40 +0100
commit59b775cca97813a24e529171606e967b61e80877 (patch)
tree21515de5bfcd8b3ac2be90eb8b339e387f24231b /HACKING
parent10226c05b1c6f15858f906ce0593d4ec066f9418 (diff)
downloadpatches-59b775cca97813a24e529171606e967b61e80877.tar
patches-59b775cca97813a24e529171606e967b61e80877.tar.gz
doc: Add "Adding new packages" in `HACKING'.
* HACKING (Adding new packages): New section.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING44
1 files changed, 44 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 500d2e3bf0..836ad51a32 100644
--- a/HACKING
+++ b/HACKING
@@ -9,6 +9,50 @@ Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
notice and this notice are preserved.
+* Adding new packages
+
+Package recipes in Guix look like this:
+
+#+BEGIN_SRC scheme
+ (package
+ (name "nettle")
+ (version "2.5")
+ (source
+ (origin
+ (method http-fetch)
+ (uri (string-append "http://ftp.gnu.org/gnu/nettle/nettle-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0wicr7amx01l03rm0pzgr1qvw3f9blaw17vjsy1301dh13ll58aa"))))
+ (build-system gnu-build-system)
+ (inputs `(("gnum4" ,gnum4)))
+ (propagated-inputs `(("gmp" ,gmp)))
+ (home-page
+ "http://www.lysator.liu.se/~nisse/nettle/")
+ (synopsis "GNU Nettle, a cryptographic library")
+ (description
+ "Nettle is a cryptographic library...")
+ (license "GPLv2+"))
+#+END_SRC
+
+Such a recipe can be written by hand, and then tested by running
+‘./pre-inst-env guix-build nettle’.
+
+When writing the recipe, the base32-encoded SHA256 hash of the source
+code tarball, which can be seen in the example above, can be obtained by
+running:
+
+ guix-download http://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
+
+Alternatively, it is possible to semi-automatically import recipes from
+the [[http://nixos.org/nixpkgs/][Nixpkgs]] software distribution using this command:
+
+ guix-import /path/to/nixpkgs/checkout nettle
+
+The command automatically fetches and converts to Guix the “Nix
+expression” of Nettle.
+
* Porting the Guix distro on a new platform
** Introduction