diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-11-07 22:41:21 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-11-07 22:57:30 +0100 |
commit | f9cc897105850dbbf5e12df63e800cb28b0f293f (patch) | |
tree | 975b6dabbd0d6c213993cf51da66f2afa8b3487b /doc | |
parent | 18f2887bffeda697bf5ba227c75e303aad04898a (diff) | |
download | gnu-guix-f9cc897105850dbbf5e12df63e800cb28b0f293f.tar gnu-guix-f9cc897105850dbbf5e12df63e800cb28b0f293f.tar.gz |
packages: Add a 'snippet' field to <origin>.
* guix/packages.scm (<origin>): Add 'snippet', 'modules', and
'imported-modules' fields.
(patch-and-repack): Make 'inputs' a keyword parameter. Add 'snippet',
'modules', and 'imported-modules' parameters. Accept SOURCE as a raw
file name. Insert SNIPPET in BUILDER. Pass IMPORTED-MODULES to
'build-expression->derivation'.
(package-source-derivation): Pass the extra arguments to
'patch-and-repack'.
* tests/packages.scm ("package-source-derivation, snippet"): New test.
* doc/guix.texi (Defining Packages): Mention the 'patches' and 'snippet'
fields.
(Invoking guix build): Tell that --source has patches and snippets
applied.
(Software Freedom): Mention packages that contain non-free code.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix.texi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 43e7935b4c..4fb14063d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -985,6 +985,11 @@ base32 representation of the hash. You can obtain this information with @code{guix download} (@pxref{Invoking guix download}) and @code{guix hash} (@pxref{Invoking guix hash}). +@cindex patches +When needed, the @code{origin} form can also have a @code{patches} field +listing patches to be applied, and a @code{snippet} field giving a +Scheme expression to modify the source code. + @item @cindex GNU Build System The @code{build-system} field is set to @var{gnu-build-system}. The @@ -1479,6 +1484,10 @@ themselves. For instance, @code{guix build -S gcc} returns something like @file{/nix/store/@dots{}-gcc-4.7.2.tar.bz2}, which is GCC's source tarball. +The returned source tarball is the result of applying any patches and +code snippets specified in the package's @code{origin} (@pxref{Defining +Packages}). + @item --system=@var{system} @itemx -s @var{system} Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of @@ -1878,6 +1887,14 @@ software distribution guidelines}. Among other things, these guidelines reject non-free firmware, recommendations of non-free software, and discuss ways to deal with trademarks and patents. +Some packages contain a small and optional subset that violates the +above guidelines, for instance because this subset is itself non-free +code. When that happens, the offending items are removed with +appropriate patches or code snippets in the package definition's +@code{origin} form (@pxref{Defining Packages}). That way, @code{guix +build --source} returns the ``freed'' source rather than the unmodified +upstream source. + @node Package Naming @subsection Package Naming |