* guix/packages.scm (package-mapping): New procedure.
(package-input-rewriting): Rewrite in terms of 'package-mapping'.
* tests/packages.scm ("package-mapping"): New test.
* doc/guix.texi (Defining Packages): Document it.
Reported by Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
at <https://lists.gnu.org/archive/html/help-guix/2017-04/msg00007.html>.
* guix/packages.scm (expand-input): Add 'guard' form around call to
'package-source-derivation'.
* tests/packages.scm (dummy): New test.
* guix/packages.scm (package-upstream-name): New procedure.
* guix/gnu-maintenance.scm (gnu-package?, ftp-server/directory)
(latest-release*, latest-gnome-release)
(latest-kde-release): Use it instead of the inline expression.
This provides a way to mark a package as superseded by another one.
Upgrades replace superseded packages with their replacement.
* guix/packages.scm (package-superseded, deprecated-package): New
procedures.
* gnu/packages.scm (%find-package): Check for 'package-superseded'.
* guix/scripts/package.scm (transaction-upgrade-entry)[supersede]: New
procedure. Call it when 'package-superseded' is true.
* tests/guix-build.sh: Add test for a superseded package.
* tests/packages.scm ("package-superseded")
("transaction-upgrade-entry, superseded package"): New tests.
Suggested-by: Ludovic Courtès <ludo@gnu.org>
* guix/packages.scm (patch-and-repack)[build]: Use
'--no-backup-if-mismatch' patch flag to avoid making *.orig files.
The two mistakes made here (confusion between 'modules' and
'imported-modules') were canceling each other.
* guix/packages.scm (patch-and-repack): Use IMPORTED-MODULES, not
MODULES, as the base of the module list passed as #:modules to
'gexp->derivation'.
(origin->derivation): Pass IMPORTED-MODULES, not MODULES, as
the #:imported-modules argument of 'patch-and-repack'.
* gnu/packages/engineering.scm (fastcap)[source]: Add 'imported-modules'
field.
* guix/packages.scm (origin->derivation): Rename 'source' parameter to
'origin'. Move cases where SOURCE is a string to...
(package-source-derivation): ... here.
This reduces the wall-clock time of
guix environment gnutls --pure -E true
by ~35%.
* guix/packages.scm (%graft-cache): New variable.
(input-graft): Use 'cached' to cache to %GRAFT-CACHE.
This reduces the wall-clock time of
guix environment gnutls --pure -E true
by ~25%.
* guix/packages.scm (%bag-cache): New variable.
(package->bag): Use 'cached' to cache things to %BAG-CACHE.
* guix/packages.scm (cache): Rename to...
(cache!): ... this. Add 'cache' parameter, and use it.
(cached): Add a rule to allow the cache to be specified.
Fixes <http://bugs.gnu.org/22139>.
* guix/grafts.scm (graft-derivation): Rename to...
(graft-derivation/shallow): ... this.
(graft-origin-file-name, item->deriver, non-self-references)
(cumulative-grafts, graft-derivation): New procedures
* tests/grafts.scm ("graft-derivation, grafted item is a direct
dependency"): Clarify title. Use 'grafted' instead of 'graft' to refer
to the grafted derivation.
("graft-derivation, grafted item is an indirect dependency")
("graft-derivation, no dependencies on grafted output"): New tests.
* guix/packages.scm (input-graft): Change to take a package instead of
an input.
(input-cross-graft): Likewise.
(fold-bag-dependencies): New procedure.
(bag-grafts): Rewrite in terms of 'fold-bag-dependencies'.
* tests/packages.scm ("package-derivation, indirect grafts"): Comment out.
* doc/guix.texi (Security Updates): Mention run-time dependencies and
recursive grafting.
* guix/packages.scm <package>: Use '@' in record printer.
* guix/import/cabal.scm <cabal-package>: Likewise
* guix/import/elpa.scm <elpa-package>: Likewise.
* tests/packages.scm: Adapt to it.
* guix/packages.scm (package-transitive-native-search-paths): New
procedure.
* tests/packages.scm ("package-transitive-native-search-paths"): New
test.
This is a followup to commit 92226a470d.
* guix/packages.scm (patch-and-repack)[build]: Determine if tar supports the
"--sort=name" option using a run-time test. If not supported, generate the
sorted file list with 'find-files' and pass it to tar using "--files-from".
There were two issues:
1. Use of 'delete-duplicates', which is quadratic, was a serious problem for
closures with lots of propagated inputs, such as that of the 'hydra'
package (several minutes for 'guix build hydra -n'!).
2. The 'delete-duplicates' call essentially had no effect since duplicate
inputs typically had a different label and were thus kept. For
instance, (bag-transitive-inputs (package->bag inkscape)) would return
216 items whereas (delete-duplicates (map cdr THAT)) contains only 67
items.
The new implementation returns 67 items in this case. For 'hydra', we're
down from 42211 items to 361, and roughly 13s for 'guix build hydra'.
* guix/packages.scm (transitive-inputs): Rewrite as a breadth-first
traversal. Remove duplicate propagated inputs.
* tests/packages.scm ("package-transitive-inputs", "package->bag, propagated
inputs"): Adjust to use simple labels for propagated inputs, without "/".
("package-transitive-inputs, no duplicates"): New test.
Discussed in <http://bugs.gnu.org/20255>.
* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
(package->manifest-entry): Initialize it.
(manifest->gexp): Match it. Wrap #$deps in (propagated-inputs ...).
Emit (search-paths ...). Increment version.
(find-package): New procedure.
(sexp->manifest)[infer-search-paths]: New procedure.
Use it to initialize the 'search-paths' field for versions 0 and 1.
Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
Remove.
Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.