See <https://lists.gnu.org/archive/html/guix-devel/2013-09/msg00137.html>
for the rationale.
* guix/packages.scm (<origin>)[patches, patch-flags, patch-inputs,
patch-guile]: New fields.
(%standard-patch-inputs, default-guile, patch-and-repack): New
procedures.
(package-source-derivation): When 'patches' is non-empty, call
'patch-and-repack'.
* guix/utils.scm (file-sans-extension): New procedure.
* guix/derivations.scm (derivation->output-path,
derivation->output-paths): New procedures.
(derivation-path->output-path): Use 'derivation->output-path'.
(derivation-path->output-paths): Use 'derivation->output-paths'.
(derivation): Accept 'derivation?' objects as inputs. Return a single
value.
(build-derivations): New procedure.
(compiled-modules): Use 'derivation->output-paths'.
(build-expression->derivation)[source-path]: Add case for when the
input matches 'derivation?'.
[prologue]: Accept 'derivation?' objects in INPUTS.
[mod-dir, go-dir]: Use 'derivation->output-path'.
* guix/download.scm (url-fetch): Adjust to the single-value return.
* guix/packages.scm (package-output): Use 'derivation->output-path'.
* guix/scripts/build.scm (guix-build): When the argument is
'derivation-path?', pass it through 'read-derivation'.
Use 'derivation-file-name' to print out the .drv file names, and to
register them. Use 'derivation->output-path' instead of
'derivation-path->output-path'.
* guix/scripts/package.scm (roll-back): Adjust to the single-value
return.
(guix-package): Use 'derivation->output-path'.
* guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?'
objects instead of .drv file names.
* gnu/system/grub.scm (grub-configuration-file): Use
'derivation->output-path' instead of 'derivation-path->output-path'.
* gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise.
* tests/builders.scm, tests/derivations.scm, tests/packages.scm,
tests/store.scm, tests/union.scm: Adjust to the new calling
convention.
* doc/guix.texi (Defining Packages, The Store, Derivations): Adjust
accordingly.
* guix/packages.scm (package-source-derivation): Add cases for SOURCE as
a store path or user file.
* tests/packages.scm ("package-source-derivation, file",
"package-source-derivation, store path"): New tests.
* guix/packages.scm (&package-cross-build-system-error): New condition type.
(package-cross-derivation): Raise &package-cross-build-system-error
when the build system doesn't support cross builds.
* guix/ui.scm (call-with-error-handling): Add
package-cross-build-system-error? case.
* tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
* guix/packages.scm (expand-input): New procedure, moved out of...
(package-derivation): ... here. Adjust accordingly.
(package-cross-derivation): Add `cross-system' and `system'
parameters.
* guix/packages.scm (package-field-location): Rewrite using `read' and
source properties. Change to return #f upon failure.
* tests/packages.scm ("package-field-location"): Check for #f upon failure.
* build-aux/sync-synopses.scm: Adjust accordingly.
* guix/packages.scm (package-field-location): New procedure.
* build-aux/sync-synopses.scm: Use it instead of `package-location'.
* tests/packages.scm ("package-field-location"): New test.
* guix/store.scm (add-to-store): Remove the `fixed?' parameter from the
public interface.
* gnu/packages/bootstrap.scm, guix-download.in, guix/derivations.scm,
guix/packages.scm, tests/derivations.scm: Update all callers
accordingly.
* guix/packages.scm (<package>)[inputs]: Mark as thunked.
(package-derivation)[expand-input]: Remove case where the input is a
procedure.
* tests/packages.scm ("trivial with system-dependent input"): Remove
`lambda', and use (%current-system).
* gnu/packages/bootstrap.scm (package-from-tarball): Likewise for `inputs'.
(%bootstrap-glibc, %bootstrap-gcc): Likewise.
* gnu/packages/scheme.scm (mit-scheme): Likewise.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
* guix/packages.scm (cache): Change the `drv' argument to `thunk'.
Memoize all the return values of THUNK.
(cached-derivation): Remove.
(cached): New macro.
(package-derivation): Use `cached' instead of `(or (cached-derivation) …)'.
* doc/guix.texi (Defining Packages): Update accordingly.
* guix/packages.scm (package-source-derivation): Add `system'
parameter. Pass it to METHOD.
(package-derivation)[expand-input]: Pass SYSTEM to
`package-derivation' and `package-source-derivation'.
* distro/packages/base.scm (package-with-bootstrap-guile)[boot]: Pass
SYSTEM to FETCH.
* guix/packages.scm (package-derivation)[intern]: New procedure. Pass
#t as the `recursive?' argument, instead of #f.
[expand-input]: New procedure, with code formerly in the body.
Support inputs where the input is a procedure returning a file name or
an <origin>.
Use `expand-input' in the body.
* tests/packages.scm ("trivial with system-dependent input"): New test.
* guix/packages.scm (%derivation-cache): Pass an initial size of 100.
(cache): Use `hashq-set!', and use a SYSTEM/DRV pair as the value.
(cached-derivation): Update accordingly.
* guix/build-system/trivial.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/packages.scm ("trivial"): New test.
* guix/packages.scm (package-derivation): Allow SOURCE to be #f.
* guix/packages.scm (transitive-inputs): New procedure.
(package-transitive-inputs): Rewrite in terms of `transitive-inputs'.
(package-transitive-propagated-inputs): New procedure.
* guix/packages.scm (&package-error, &package-input-error): New
condition types.
(package-derivation): Raise a `&package-input-error' when no match is
made.
* guix/packages.scm (package-transitive-inputs): New procedure.
(package-derivation): Use it to compute INPUTS.
* tests/packages.scm (dummy-package): New macro.
("package-transitive-inputs"): New test.
* guix/packages.scm (<package-source>): Rename to...
(<origin>): ... this. Update users.
* distro/base.scm (libsigsegv, gawk, hello): Adjust to renaming; refer
to VERSION to build the URL.
* guix/packages.scm (package-derivation): When ARGS is a procedure, call
(ARGS SYSTEM).
* distro/base.scm (gawk)[arguments]: Turn into a procedure, to disable
tests on Cygwin.
* guix/packages.scm (<package>)[arguments]: Default to '().
* distro/base.scm (libsigsegv, gawk): New packages.
(hello): Use GAWK instead of (nixpkgs-derivation "gawk").
* guix/packages.scm (<location>): New record type.
(location, source-properties->location): New procedures.
(<package>)[location]: New field.
* tests/packages.scm ("GNU Hello"): Test `package-location'.
* Makefile.am (MODULES): Add `guix/packages.scm' and `distro/base.scm'.
(TESTS): Add `tests/packages.scm'.
(EXTRA_DIST): New variable.
* guix/packages.scm, distro/base.scm, tests/packages.scm: New files.
* guix/http.scm (http-fetch): Make `name' an optional argument, to match
the expectations of `package-source-derivation'.