* guix/build-system/trivial.scm (trivial-build): When SOURCE is true,
add it to INPUTS.
(trivial-cross-build): Likewise.
* tests/packages.scm ("trivial with source"): New test.
* 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.
* tests/packages.scm ("package-field-location"): Check the result of
`read-at' against both VALUE and (FIELD VALUE).
Reported by Matthew Lien - 練喆明" <bluet@bluet.org>.
* 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/build-system/trivial.scm (guile-for-build): New procedure.
(trivial-build): Use it.
(trivial-cross-build): New procedure.
(trivial-build-system): Use it.
* 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/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 (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.
* tests/builders.scm (network-reachable?): New variable.
("url-fetch", "gnu-build"): Skip unless NETWORK-REACHABLE?.
* tests/derivations.scm (%coreutils): Check for network access.
("build-expression->derivation with one input"): Skip when %COREUTILS
is #f.
* tests/guix-package.sh: Skip installation of GNU Make when the network
is unreachable.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/union.scm ("union-build"): Likewise.
* guix/derivations.scm (derivation)[inputs]: Fix typo in call to
`add-to-store'.
* tests/derivations.scm ("derivation with local file as input"): New test.
* tests/packages.scm ("trivial with local file as input"): New test.
* distro.scm (fold-packages): New procedure.
(find-packages-by-name): Use it instead of hand-written traversal;
remove `package?' checks from `right-package?'.
* tests/packages.scm ("fold-packages"): New test.
* tests/builders.scm (%bootstrap-inputs): Use %BOOT0-INPUTS from the distro.
* tests/packages.scm (%bootstrap-inputs): Likewise.
* tests/derivations.scm (%coreutils): Alias for %BOOTSTRAP-COREUTILS&CO.
* 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.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-guile): New
variables.
("gnu-build"): Use them, by setting `#:implicit-inputs? #f' and `#:guile'.
* tests/packages.scm (%bootstrap-inputs, %bootstrap-guile): New
variables.
("trivial"): Pass `#:guile %bootstrap-guile'.
("GNU Hello"): Use `package-with-explicit-inputs' to use
%BOOTSTRAP-GUILE and %BOOTSTRAP-INPUTS.
* 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 (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 (<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'.