Commit Graph

134 Commits (81c3dc32244a17241d74eea9fa265edfcb326f6d)

Author SHA1 Message Date
Kyle Meyer 723f5b1dc9
profiles: Adjust packages->manifest pattern for inferior packages.
* guix/profiles.scm (packages->manifest): Add package? predicate to `(package
output)' pattern to avoid incorrectly matching `(inferior-package output)',
which should be handled by a later clause.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-07-03 12:03:07 +02:00
Ludovic Courtès c872b952c5
profiles: Add 'generation-profile'.
* guix/profiles.scm (%profile-generation-rx): New variable.
(generation-profile): New procedure.
2019-04-10 17:09:47 +02:00
Ludovic Courtès 487cbb0164
profiles: Raise an error for unmatched patterns.
Previously, "guix package -r something-not-installed" would silently
complete.  Now an error is raised.

* guix/profiles.scm (&unmatched-pattern-error): New condition type.
(manifest-matching-entries): Rewrite to raise an error when one of
PATTERNS is not matched.
* guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'.
* tests/guix-package.sh: Add test.
* tests/profiles.scm ("manifest-matching-entries"): Don't try to remove
unmatched pattern.
("manifest-matching-entries, no match"): New test.
("manifest-transaction-effects"): Remove 'remove' field.
2019-02-07 15:46:45 +01:00
Ludovic Courtès f6fe7da372
profiles: 'manual-database' hook reports progress.
* guix/profiles.scm (manual-database)[build](compute-entries): Write a
progress report.
2019-02-01 19:31:34 +01:00
Christopher Baines cf22e99f02
guix: Add guard to texlive-configuration profile hook.
It is possible to generate a profile where this hook will crash, as the
texmf.cnf file does not exist to be patched by substitute*. A simple example
is the profile just containing texlive-fonts-txfonts.

* guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file
exists before trying to change it.
2019-01-18 16:15:33 +00:00
Ricardo Wurmus 743497b565
guix: Add profile hook to build TeX live configuration.
* guix/profiles.scm (texlive-configuration): New procedure.
(%default-profile-hooks): Add it.
* guix/status.scm (hook-message): Handle "texlive-configuration" hook type.
2019-01-15 13:05:22 +01:00
Ludovic Courtès b334674fe5
Use 'mapm' instead of 'sequence' + 'map'.
Previously we'd use the (sequence M (map P L)) idiom just because 'mapm'
was slower (not specialized for the given monad).  This is no longer the
case since commit dcb95c1fc9.

* guix/gexp.scm (lower-inputs): Use (mapm M P L) instead of (sequence
M (map P L)).
(lower-references, gexp->sexp, imported-files): Likewise.
* guix/profiles.scm (profile-derivation): Likewise.
* guix/scripts/environment.scm (inputs->requisites): Likewise.
* guix/scripts/system.scm (copy-closure): Likewise.
2018-12-19 23:52:24 +01:00
Ricardo Wurmus 80eebee9f7
ui: Report profile hooks separately.
* guix/ui.scm (profile-hook-derivation?): New procedure.
(show-what-to-build): Distinguish among BUILD derivations that match
'profile-hook-derivation?'.  Report them separately.
* guix/status.scm (hook-message): New procedure.
(print-build-event): Display profile hooks with readable hook name.
* guix/profiles.scm (info-dir-file, ghc-package-cache-file,
ca-certificate-bundle, glib-schemas, gtk-icon-themes, gtk-im-modules,
xdg-desktop-database, xdg-mime-database, fonts-dir-file, manual-database):
Augment derivation with "type" and "hook" properties.
2018-12-19 23:46:38 +01:00
Ludovic Courtès fdc4f665dc
profiles: Fix typo in exports.
* guix/profiles.scm (&profile-collistion-error): Fix typo in export list.
2018-10-26 20:05:21 +02:00
Ludovic Courtès 1c795c4fd2
profiles: 'user-friendly-profile' now recognizes ~/.config/guix/current.
* guix/profiles.scm (%known-shorthand-profiles): New variable.
(user-friendly-profile): Use it.
2018-10-12 00:13:14 +02:00
Ludovic Courtès 50c72ecd9e
profiles: Generalize 'canonicalize-profile'.
* guix/profiles.scm (canonicalize-profile): Rewrite to work with any
profile that lives under %PROFILE-DIRECTORY.
2018-10-11 18:29:11 +02:00
Ludovic Courtès 77dcfb4c02
profiles: Add 'ensure-profile-directory'.
* guix/scripts/package.scm (ensure-default-profile): Move
/var/guix/profiles/per-user handling to...
* guix/profiles.scm (ensure-profile-directory): ... here.  New
procedure.
* po/guix/POTFILES.in: Add 'guix/profiles.scm'.
2018-10-11 18:29:11 +02:00
Ludovic Courtès 88d9eccc11
profiles: Make Geiser happy.
* guix/profiles.scm (manual-database)[config.scm]: Use ungexp/quote
trick to placate Geiser, which otherwise thinks it's in (guix config).
2018-10-09 18:54:12 +02:00
Ludovic Courtès 811b21fb15
profiles: 'packages->manifest' now accepts inferior packages.
* guix/profiles.scm (packages->manifest)[inferiors-loaded?]: New
variable.
[inferior->entry]: New procedure.
Accept inferior packages when INFERIORS-LOADED? is true.
* tests/guix-package.sh: Add test using a manifest with an inferior.
* tests/inferior.scm ("packages->manifest"): New test.
2018-09-21 17:04:37 +02:00
Ludovic Courtès 2b73d82830
guix package: Record package provenance in manifest entries.
* guix/profiles.scm (package->manifest-entry): Add #:properties and
honor it.
* guix/scripts/package.scm (package-provenance)
(package->manifest-entry*): New procedures.
(transaction-upgrade-entry, options->installable): Use
'package->manifest-entry*' instead of 'package->manifest-entry'.
2018-09-07 11:40:25 +02:00
Ludovic Courtès bc6e291ef0
guix package: Use relative symlinks to generations.
Reported by Roel Janssen <roel@gnu.org>
at <https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html>.

* guix/profiles.scm (switch-to-generation): Use (basename generation) as
the symlink target.
* guix/scripts/package.scm (build-and-use-profile): Likewise,
use (basename name) as the symlink target.
* tests/guix-package.sh: Adjust --roll-back test accordingly.  Add
explicitly test with '-p foo/prof'.
2018-07-13 17:28:39 +02:00
Ludovic Courtès 78d55b703d
profiles: Introduce 'profile-search-paths' and use it.
* guix/profiles.scm (profile-search-paths): New procedure.
* guix/scripts/environment.scm (evaluate-search-paths): Remove.
(create-environment): Replace 'paths' with 'manifest'.  Use
'profile-search-paths' instead of 'evaluate-search-paths'.
(show-search-paths): Likewise.
(launch-environment): Replace 'paths' with 'manifest'.  Make 'pure?' a
keyword parameter.
(launch-environment/fork, launch-environment/container): Likewise.
(guix-environment): Remove 'paths' variable.  Adjust callers of the
above procedures accordingly.
2018-07-11 00:52:36 +02:00
Ludovic Courtès f03df3ee75
profiles: Factorize 'manifest-search-paths'.
* guix/profiles.scm (manifest-search-paths): New procedure.
(profile-derivation)[builder]: Use it.
* guix/build/profiles.scm (build-etc/profile): Remove $PATH.
2018-07-11 00:52:36 +02:00
Ludovic Courtès 5b0c648a7c
profiles: 'info-dir-file' hook now produces 'dir.LANG' files.
Previously, entries for 'guix.fr.info' would end up in 'dir', above the
'guix.info' entries; consequently, running 'info guix' would actually
open 'guix.fr.info', which was confusing for non-French readers.

* guix/profiles.scm (info-dir-file)[glibc-utf8-locales]: New variable.
[build](info-file-language): New procedure.
(install-info): Use it, to create 'dir.LANG' files.
Set GUIX_LOCPATH.
2018-07-04 10:52:59 +02:00
Ludovic Courtès f6f2346f9b
profiles: Add 'properties' field to manifest entries.
* guix/profiles.scm (<manifest-entry>)[properties]: New field.
(manifest->gexp)[entry->gexp]: Serialize it.
(sexp->manifest)[sexp->manifest-entry]: Deserialize it.
2018-06-09 12:02:28 +02:00
Ludovic Courtès efcb4441f1
profiles: Add '%current-profile', 'user-friendly-profile', & co.
* guix/scripts/package.scm (%user-profile-directory)
(%profile-directory, %current-profile, canonicalize-profile)
(user-friendly-profile): Move to...
* guix/profiles.scm: ... here.
2018-06-09 12:02:28 +02:00
Ludovic Courtès 331ac4cc23
profiles: Use 'with-extensions'.
* guix/profiles.scm (manual-database)[build]: Use 'with-extensions'.
Remove 'add-to-load-path' call.
* guix/man-db.scm: Use (gdbm) the normal way; remove 'module-autoload!'
call.
2018-06-01 15:21:28 +02:00
Danny Milosavljevic de136f3ee7
profiles: Add hook to generate "gschemas.compiled".
* guix/profiles.scm (glib-schemas): New procedure.
(%default-profile-hooks): Add it.
2018-05-21 09:56:37 +02:00
Ludovic Courtès 3636b1c7fe
profiles: Allow lowerable objects other than packages in <manifest-entry>.
* guix/profiles.scm (manifest-lookup-package)[entry-lookup-package]: Add
case where 'manifest-entry-item' returns something that's neither a
string nor a package.
2018-05-10 14:53:57 +02:00
Ludovic Courtès e00ade3fb8
profiles: Optionally use relative file names for symlink targets.
* guix/build/union.scm (symlink-relative): New procedure.
* guix/build/profiles.scm: Re-export it.
(build-profile): Add #:symlink and pass it to 'union-build'.
* guix/profiles.scm (profile-derivation): Add #:relative-symlinks?.
Pass #:symlink to 'build-profile'.
* tests/profiles.scm ("profile-derivation relative symlinks, one entry")
("profile-derivation relative symlinks, two entries"): New tests.
2018-05-10 14:53:57 +02:00
Ludovic Courtès 435603a1d6
profiles: 'manifest-add' truly deletes duplicate entries.
Fixes <https://bugs.gnu.org/30569>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/profiles.scm (manifest-add): Don't append ENTRIES as is.
Instead, cons each element of ENTRIES as we fold over it.
Remove unneeded ellispes in 'match' patterns.
2018-03-01 14:00:21 +01:00
Marius Bakke 32cd878be0
Merge branch 'master' into core-updates 2017-12-19 01:42:40 +01:00
Ludovic Courtès b8396f96bf
profiles: Use (guix man-db) to create the manual database.
Fixes <https://bugs.gnu.org/29654>.
Reported by Ruud van Asseldonk <dev+guix@veniogames.com>.

This also speeds up database creation compared to "man-db
--create" (less than half the time, on a warm cache, for 19k pages.)

* guix/man-db.scm: New file.
* Makefile.am (MODULES_NOT_COMPILED): Add it.
* guix/profiles.scm (manual-database): Rewrite to use (guix man-db).
2017-12-17 16:19:00 +01:00
Marius Bakke 77181815ae
Merge branch 'master' into core-updates 2017-12-05 23:41:30 +01:00
Ludovic Courtès cbb76780ef
profiles: Really disable deprecation warnings for 'profile-derivation'.
This is a followup to 2815fca142.

* guix/profiles.scm (profile-derivation)[builder]: Remove
'debug-disable' call, which was ineffective.
Pass #:env-vars to 'gexp->derivation'.
2017-12-03 23:18:53 +01:00
Ludovic Courtès 2815fca142
profile: Use _IO* but disable deprecation warning.
This fixes a regression introduced in
2f60084f77, whereby the profile derivation
would fail to run on Guile 2.0 (as is the case with "guix package
--bootstrap").

Reported by Christopher Baines.

* guix/profiles.scm (profile-derivation)[builder]: Use _IO* but add
'debug-disable' call.
2017-12-03 21:50:46 +01:00
Ludovic Courtès 2f60084f77
profiles: Avoid _IO* in profile builder.
* guix/profiles.scm (profile-derivation)[builder]: Avoid the deprecated
_IO* constants.
2017-12-03 19:12:16 +01:00
Ludovic Courtès cdc938daf9
profiles: Do not import the host's srfi-{19,26}.scm files.
Previously the "manual-database" derivation would always import the
host's srfi-{19,26}.scm files in the build side.  In practice this means
that different users could get different manual-database.drv depending
on the Guile version they're using in the host.

For example, the (gnu tests install) tests would fail if the host was
running Guile 2.2.3 because the guest is running 2.2.2, and thus has
different srfi-{19,26}.scm files.  The manual-database.drv would need to
be built from source, which would fail because prerequisites were
missing.

Reported by Mathieu Othacehe <m.othacehe@gmail.com>
at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29409#96>.

* guix/profiles.scm (manual-database): Do not pass #:modules to
'gexp->derivation'.  Wrap 'build' gexp in 'with-imported-modules' form.
2017-12-03 19:12:16 +01:00
Marius Bakke c6bc8e22e9
gnu: glibc: Don't use full version string in locale path.
This is a follow-up to commit ee3ebf1a35.
Fixes <https://bugs.gnu.org/29537>.

* gnu/packages/base.scm (glibc/linux)[version]: Change to 2.26.91-gaaa2eb83b8.
[source](uri): Adjust accordingly.
[arguments]: Use VERSION-MAJOR+MINOR for locales path.
(glibc-locales, glibc-utf8-locales): Likewise.
* guix/packages.scm (patch-and-repack): Likewise.
* guix/profiles.scm (ca-certificate-bundle, profile-derivation): Likewise.
2017-12-03 16:23:43 +01:00
Ricardo Wurmus 32b7506c98
profiles: Only check file contents if the file exists.
* guix/profiles.scm (fonts-dir-file): Check that files exist before using
"empty-file?".
2017-08-09 14:46:48 +02:00
Ludovic Courtès da03649640
profiles: Remove workaround for an old Guile 'scandir' bug.
* guix/profiles.scm (generation-numbers)[scandir]: Remove.
2017-07-20 11:57:13 +02:00
宋文武 85cfbd46ce
profiles: xdg-desktop-database: Run the hook when GLib is referenced.
This will pull the latest 'desktop-file-utils' package into the profile
closure, as the 'xdg-mime-database' hook already does.

* guix/profiles.scm (xdg-desktop-database): Run the hook when 'glib' is
referenced.
2017-07-03 23:27:04 +08:00
Ludovic Courtès 6d382339de
profiles: Add 'manifest-transaction-removal-candidate?'.
* guix/profiles.scm (manifest-transaction-removal-candidate?): New
procedure.
* tests/profiles.scm ("manifest-transaction-removal-candidate?"): New
test.
2017-06-26 22:52:06 +02:00
Ludovic Courtès afd06f605b
environment: Disable profile collision checks.
Reported by Efraim Flashner.
This is a followup to a654dc4bcf.

* guix/profiles.scm (profile-derivation): Add #:allow-collisions? and
honor it.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
 #:allow-collisions? #f to 'profile-derivation'.
* tests/guix-environment.sh: Test "guix environment guix".
2017-06-21 16:53:22 +02:00
Ludovic Courtès 2e2b5ad7bb
profiles: Move 'manifest-entry-dependencies' user after definition.
Reported by Efraim Flashner.

* guix/profiles.scm (manifest-transitive-entries): Move after
<manifest-entry> definition.
2017-06-21 11:59:33 +02:00
Ludovic Courtès a654dc4bcf
profiles: Catch and report collisions in the profile.
* guix/profiles.scm (&profile-collision-error): New error condition.
(manifest-transitive-entries, manifest-entry-lookup, lower-manifest-entry)
(check-for-collisions): New procedures.
(profile-derivation): Add call to 'check-for-collisions'.
* guix/ui.scm (call-with-error-handling): Handle '&profile-collision-error'.
* tests/profiles.scm ("collision", "collision of propagated inputs")
("no collision"): New tests.
2017-06-21 11:05:53 +02:00
Ludovic Courtès b3a00885c0
profiles: Manifest entries keep a reference to their parent entry.
* guix/profiles.scm (<manifest-entry>)[parent]: New field.
(package->manifest-entry): Add #:parent parameter.  Fill out the
'parent' field of <manifest-entry>; pass #:parent in recursive calls.
* guix/profiles.scm (sexp->manifest)[sexp->manifest-entry]: New
procedure.  Use it for version 3.
* tests/profiles.scm ("manifest-entry-parent"): New procedure.
("read-manifest")[entry->sexp]: Add 'manifest-entry-parent' to the
result.
2017-06-21 11:05:52 +02:00
Ludovic Courtès 55b4715fd4
profiles: Represent propagated inputs as manifest entries.
* guix/profiles.scm (package->manifest-entry): Turn DEPS into a list of
manifest entries.
(manifest->gexp)[entry->gexp]: Call 'entry->gexp' on DEPS.
Bump version to 3.
(sexp->manifest)[infer-dependency]: New procedure.
Use it for versions 1 and 2.  Parse version 3.
(manifest-inputs)[entry->gexp]: New procedure.
Adjust to 'dependencies' being a list of <manifest-entry>.
* tests/profiles.scm ("packages->manifest, propagated inputs")
("read-manifest"): New fields.
2017-06-21 11:05:52 +02:00
Maxim Cournoyer 516bfed7a3
profiles: Add elapsed time to manual-database hook to output message.
* guix/profiles.scm (manual-database): Add elapsed time to manual-database
hook to output message.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-05-16 23:10:10 +02:00
Maxim Cournoyer a0b87ef8ec
profiles: Generate database file for man pages.
The mandb database file (index.db) is used by the "apropos" (whatis) or
"man -k" commands.  This change introduces a profile hook to generate
such database file.

* guix/profiles.scm (manual-database): New procedure.
(%default-profile-hooks): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-04-05 22:45:41 +02:00
Huang Ying 0a5ce0d1df
profiles: Create fonts.dir/scale for all fonts directories.
* guix/profiles.scm (fonts-dir-file): Create fonts.dir/scale files for all
fonts directories.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:52 +02:00
Ludovic Courtès 176febe377
profiles: Packages in a profile can be cross-compiled.
* guix/profiles.scm (profile-derivation): Add #:target parameter; pass
it to 'gexp->derivation'.
* tests/profiles.scm ("profile-derivation, cross-compilation"): New test.
2017-03-17 23:25:53 +01:00
Ying Huang 06d7d1190e
profiles: gtk-im-modules: Fix for gtk3.
Gtk+3 now have multiple outputs, so the gtk-query-immodules-3.0 should be find
in output "bin" instead of "out".

* guix/profiles.scm (gtk-im-modules): Pass the path of gtk-query-immodules-x.x
as 'query' argument to the 'build' procedure.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2017-02-08 20:12:20 +08:00
Christopher Baines 849a1b8133
profiles: Export 'ca-certificate-bundle'.
* guix/profiles.scm: Export ca-certificate-bundle, such that it can be used in
other G-expressions.  This is useful where these G-expressions run programs
that require a ca-certificate-bundle, e.g. git.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-16 11:03:42 +01:00
Ludovic Courtès a6562c7e20
profiles: Remove dependency on 'glibc-utf8-locales' for tests.
Commit 1af0860e8b added a mandatory
dependency on 'glibc-utf8-locales', which entails long rebuilds for
tests.

* guix/profiles.scm (profile-derivation): Add #:locales? parameter.
Add 'set-utf8-locale' variable.  Use it when LOCALES? is true.
(link-to-empty-profile): Pass #:locales? #f.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
  #:locales?.
* guix/scripts/package.scm (build-and-use-profile): Likewise.
* tests/packages.scm ("--search-paths with pattern"): Pass #:locales? #f.
* tests/profiles.scm ("profile-derivation")
("profile-derivation, inputs", "profile-manifest, search-paths")
("etc/profile", "etc/profile when etc/ already exists"):
("etc/profile when etc/ is a symlink"): Likewise.
2016-12-17 14:46:42 +01:00