This section summarizes all the options available in
declarations (see Defining Packages).
This is the data type representing a source code origin.
An object containing the URI of the source. The object type depends on
method (see below). For example, when using the
url-fetch method of
(guix download), the valid
values are: a URL represented as a string, or a list thereof.
A procedure that handles the URI.
download a file from the HTTP, HTTPS, or FTP URL specified in the
clone the Git version control repository, and check out the revision
specified in the
uri field as a
git-reference object; a
git-reference looks like this:
(git-reference (url "https://git.savannah.gnu.org/git/hello.git") (commit "v2.10"))
A bytevector containing the SHA-256 hash of the source. This is
equivalent to providing a
content-hash SHA256 object in the
hash field described below.
content-hash object of the source—see below for how to use
You can obtain this information using
(see Invoking guix download) or
guix hash (see Invoking guix hash).
The file name under which the source code should be saved. When this is
#f, a sensible default value will be used in most cases. In case
the source is fetched from a URL, the file name from the URL will be
used. For version control checkouts, it is recommended to provide the
file name explicitly because the default is not very descriptive.
A list of file names, origins, or file-like objects (see file-like objects) pointing to patches to be applied to the source.
This list of patches must be unconditional. In particular, it cannot
depend on the value of
A G-expression (see G-Expressions) or S-expression that will be run in the source directory. This is a convenient way to modify the source, sometimes more convenient than a patch.
A list of command-line flags that should be passed to the
Input packages or derivations to the patching process. When this is
#f, the usual set of inputs necessary for patching are provided,
such as GNU Patch.
A list of Guile modules that should be loaded during the patching
process and while running the code in the
The Guile package that should be used in the patching process. When
#f, a sensible default is used.
Construct a content hash object for the given algorithm, and with
value as its hash value. When algorithm is omitted, assume
value can be a literal string, in which case it is base32-decoded, or it can be a bytevector.
The following forms are all equivalent:
(content-hash "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj") (content-hash "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj" sha256) (content-hash (base32 "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj")) (content-hash (base64 "kkb+RPaP7uyMZmu4eXPVkM4BN8yhRd8BTHLslb6f/Rc=") sha256)
content-hash is currently implemented as a macro.
It performs sanity checks at macro-expansion time, when possible, such
as ensuring that value has the right size for algorithm.