summaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
AgeCommit message (Collapse)Author
2015-03-04tests: Remove dependency on 'glibc-utf8-locales' for profile tests.Ludovic Courtès
This fixes a regression introduced in commit 536c3ee. * guix/profiles.scm (ca-certificate-bundle): When MANIFEST is empty, make a trivial derivation. * guix/scripts/package.scm (guix-package)[process-actions]: Pass #:ca-certificate-bundle? to 'profile-generation'. * tests/packages.scm ("--search-paths with pattern"): Likewise. * tests/profiles.scm ("profile-derivation"): Likewise.
2015-02-26ui: Factorize command-line + env. var. option parsing.Ludovic Courtès
* guix/ui.scm (%default-argument-handler, parse-command-line): New procedures. (environment-build-options): Make private. * guix/scripts/archive.scm (guix-archive)[parse-options, parse-options-from]: Remove. Use 'parse-command-line' instead. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * tests/ui.scm (with-environment-variable): New macro. ("parse-command-line"): New test.
2015-02-06guix package: Make custom profiles actual indirect roots.Ludovic Courtès
Before that, any profile generation built when '-p' is used would effectively become a permanent GC root because the symlink in /var/guix/gcroots/auto would point directly to /gnu/store/...-profile. * guix/scripts/package.scm (maybe-register-gc-root): Rename to... (register-gc-root): ... this. Remove conditional, and replace call to 'canonicalize-path' with (string-append (getcwd) "/" ...). (guix-package): Call 'register-gc-root' only if PROFILE is different from %CURRENT-PROFILE. * tests/guix-package.sh: Add test case.
2015-01-20guix package: Avoid spurious warnings from 'find-files'.Ludovic Courtès
Reported by Andreas Enge <andreas@enge.fr>. * guix/scripts/package.scm (with-null-error-port): New macro. (search-path-environment-variables): Wrap 'search-path-as-list' call in 'with-null-error-port'.
2015-01-03guix package: Follow symlinks for pattern search paths.Ludovic Courtès
* guix/scripts/package.scm (search-path-environment-variables): Add local 'files' variable. * tests/packages.scm ("--search-paths with pattern"): New test.
2014-12-27guix package: Use 'search-path-as-list' instead of custom code.Ludovic Courtès
This will handle the new 'file-type' and 'file-pattern' fields correctly. * guix/scripts/package.scm (search-path-environment-variables)[search-path-definition]: Rewrite in terms of 'search-path-as-list'.
2014-12-06guix: scripts: Parse $GUIX_BUILD_OPTIONS separately.nebuli
Appending to "raw" args broke optional parameters in 'guix package -I' and 'guix package -A', and possibly other places. Therefore, switch to parsing each set of options on its own and append resulting alists together afterwards. * guix/scripts/archive.scm (parse-options-from): Rename from (parse-options) and add explicit argument. New form of (parse-options) using its old algorithm via -from function. * guix/scripts/build.scm: Ditto. * guix/scripts/environment.scm: Ditto. * guix/scripts/package.scm: Ditto. * guix/scripts/system.scm: Ditto. * tests/guix-package.sh: Add test. * doc/guix.texi (Invoking guix build): Make it clear that the options are parsed independently. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-11-30guix: scripts: Add GUIX_BUILD_OPTIONS environment handling.nebuli
* doc/guix.texi (Invoking guix build): Mention 'GUIX_BUILD_OPTIONS'. * guix/scripts/archive.scm: (append args (environment-build-options)). * guix/scripts/build.scm: Ditto. * guix/scripts/environment.scm: Ditto. * guix/scripts/package.scm: Ditto. * guix/scripts/system.scm: Ditto. * guix/ui.scm (environment-build-options): New function. * guix/utils.scm (arguments-from-environment-variable): New function. * tests/guix-build.sh: Add tests. * test-env.in: Unset GUIX_BUILD_OPTIONS. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-10-12guix package: Add '--switch-generation' option.Alex Kost
* guix/scripts/package.scm (switch-to-generation): New procedure. (switch-to-previous-generation): Use it. (guix-package): Adjust for '--switch-generation' option. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Document it.
2014-10-12profiles: Add condition types for profiles and generations.Alex Kost
Suggested by Ludovic Courtès. * guix/profiles.scm (&profile-error, &profile-not-found-error, &missing-generation-error): New condition types. * guix/ui.scm (call-with-error-handling): Handle new types. * guix/scripts/package.scm (roll-back, guix-package): Raise '&profile-not-found-error' where needed.
2014-10-10ui: Move 'show-manifest-transaction' from (guix profiles).Alex Kost
* guix/profiles.scm: Do not use (guix ui) module. (right-arrow, manifest-show-transaction): Move and rename to... * guix/ui.scm (right-arrow, show-manifest-transaction): ... here. * tests/profiles.scm ("manifest-show-transaction"): Move to... * tests/ui.scm ("show-manifest-transaction"): ... here. (guile-1.8.8, guile-2.0.9): New variables. * emacs/guix-main.scm (process-package-actions): Rename 'manifest-show-transaction' to 'show-manifest-transaction'. * guix/scripts/package.scm (guix-package): Likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-05guix package: Export generation procedures.Alex Kost
* guix/scripts/package.scm: Export 'roll-back', 'delete-generation', 'delete-generations'. (link-to-empty-profile, roll-back): Add 'store' argument. (delete-generations): New procedure. (guix-package): Adjust accordingly. [delete-generation]: Move to the top level. Add 'store' and 'profile' arguments. [display-and-delete]: Move to 'delete-generation'.
2014-09-22guix package: Use 'profile-generations'.Alex Kost
* guix/scripts/package.scm (guix-package)[process-actions]: Use 'profile-generations' instead of the equivalent code.
2014-08-31guix package: Fix search path lookup when an obsolete version is installed.Ludovic Courtès
Before that, 'guix package --search-paths' would not work if, say, 'foo-0.2' is installed but the distro provides 'foo-0.3'. * guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Handle the case where 'find-best-packages-by-name' returns '().
2014-08-28gnu: Split (gnu packages base), adding (gnu packages commencement).Ludovic Courtès
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0, findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet, binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0, texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash, cross-gcc-wrapper, static-bash-for-glibc, glibc-final, gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++, gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs, guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final, %boot5-inputs, %final-inputs, canonical-package, gcc-toolchain, gcc-toolchain-4.8, gcc-toolchain-4.9): Move to... * gnu/packages/commencement.scm: ... here. New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * build-aux/check-final-inputs-self-contained.scm: Adjust accordingly. * gnu/packages/cross-base.scm: Likewise. * gnu/packages/make-bootstrap.scm: Likewise. * guix/build-system/cmake.scm (cmake-build): Likewise. * guix/build-system/gnu.scm (standard-packages, gnu-build, gnu-cross-build): Likewise. * guix/build-system/perl.scm (perl-build): Likewise. * guix/build-system/python.scm (python-build): Likewise. * guix/build-system/trivial.scm (guile-for-build): Likewise. * guix/download.scm (url-fetch): Likewise. * guix/gexp.scm (default-guile): Likewise. * guix/git-download.scm (git-fetch): Likewise. * guix/monads.scm (run-with-store): Likewise. * guix/packages.scm (default-guile): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/refresh.scm: Likewise. * guix/svn-download.scm (svn-fetch): Likewise. * tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths): Likewise. * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/guix-package.sh: Likewise. * gnu/services/base.scm: Use 'canonical-package' instead of xxx-final. * gnu/services/xorg.scm: Likewise. * gnu/system/vm.scm: Likewise. * guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-23profiles: Produce a top-level Info 'dir' file.Ludovic Courtès
Fixes <http://bugs.gnu.org/18305>. Reported by Brandon Invergo <brandon@gnu.org>. * guix/profiles.scm (manifest-inputs, info-dir-file): New procedures. (profile-derivation): Use them. Add #:info-dir? parameter and honor it. * guix/scripts/package.scm (guix-package): Call 'profile-derivation' with #:info-dir? #f when the 'bootstrap? option is set. * tests/profiles.scm ("profile-derivation"): Pass #:info-dir? #f.
2014-08-20Move 'check-package-freshness' from 'guix package' to 'packages'.Alex Kost
* guix/scripts/package.scm (%sigint-prompt, call-with-sigint-handler) (waiting, ftp-open*, check-package-freshness): Move to... * gnu/packages.scm: ... here. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-19guix package: Use 'manifest-transaction'.Alex Kost
* guix/scripts/package.scm (guix-package)[process-actions]: Use 'manifest-transaction' instead of the equivalent code. (show-what-to-remove/install): Remove. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-12guix package: Remove leftover internal procedure.Ludovic Courtès
Reported by Alex Kost <alezost@gmail.com>. * guix/scripts/package.scm (guix-package)[process-actions]: Remove 'same-package?'.
2014-08-12guix package: Use 'manifest-add'.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions]: Use 'manifest-add' instead of the equivalent code.
2014-08-11guix package: Remove dead code and unused variables.Ludovic Courtès
Suggested by Alex Kost <alezost@gmail.com>. * guix/scripts/package.scm (options->installable)[deduplicate]: Remove. [packages-to-upgrade]: Remove unused variable 'newest'. (roll-back): Remove unused variable 'manifest'. (guix-package): Remove unused variables 'guile-missing?', 'verbose?', and 'packages'.
2014-07-26profiles: Add 'package->manifest-entry'.Ludovic Courtès
Suggested by Alex Kost <alezost@gmail.com>. * guix/scripts/package.scm (options->installable)[package->manifest-entry]: Move to (guix profiles). [package->manifest-entry*]: New procedure. Use it. * guix/profiles.scm (package->manifest-entry): New procedure. * tests/profiles.scm (guile-for-build): New variable. Call '%guile-for-build'. ("profile-derivation"): New test.
2014-07-26profiles: Get rid of the 'inputs' field of 'manifest-entry'.Ludovic Courtès
* guix/profiles.scm (<manifest-entry>)[inputs]: Remove. (profile-derivation): Rely on 'item' and 'deps' instead of 'inputs'. Adjust 'builder' accordingly. * guix/scripts/package.scm (options->installable)[package->manifest-entry]: Remove 'inputs' field. Change 'dependencies' field to contain packages.
2014-07-26profiles: Switch to gexps.Ludovic Courtès
* guix/profiles.scm (<manifest-entry>)[path]: Rename to... [item]: ... this. Update users. (manifest->sexp): Rename to... (manifest->gexp): ... this. Return a gexp. (lower-input): Remove. (profile-derivation): Remove 'store' parameter, and turn into a monadic procedure. [inputs]: New variable. [builder]: Turn into a gexp. Replace call to 'build-expression->derivation' with call to 'gexp->derivation'. * guix/scripts/package.scm (link-to-empty-profile): Adjust call to 'profile-derivation', and wrap it in 'run-with-store'. (show-what-to-remove/install): Rename 'path' to 'item'. Check whether ITEM is a package, and return its output path if it is. (input->name+path): Remove. (options->installable): Set 'item' to P. (guix-package): Adjust call to 'profile-derivation'. * tests/profiles.scm (guile-2.0.9): Change 'path' to 'item'.
2014-07-26profiles: Do away with 'manifest=?'.Ludovic Courtès
* guix/profiles.scm (manifest=?): Remove. * guix/scripts/package.scm (readlink*): New procedure. (guix-package)[process-actions]: Use 'readlink*' and compare the profile to be built, PROF, with PROFILE to determine whether there's nothing to be done.
2014-07-21guix package: add a "show" option.Cyril Roelandt
* doc/guix.texi: Update the documentation. * guix/scripts/package.scm: Add a "show" option. * tests/guix-package.sh: Add a test for the "show" option.
2014-07-05guix package: Try $LOGNAME in addition to $USER.Taylan Ulrich Bayirli/Kammer
Fixes <http://bugs.gnu.org/17946>. Notoriously, cron jobs may set LOGNAME only and not USER. See e.g. crontab(5) under Debian 7 (wheezy). * guix/scripts/package.scm (%profile-directory) (guix-package): Also try LOGNAME if USER is unset. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-07-05guix package: Do the right thing for '-p ~/.guix-profile'.Ludovic Courtès
Fixes <http://bugs.gnu.org/17939>. Reported by Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>. * guix/scripts/package.scm (canonicalize-profile): New procedure. (%options): Use it for --profile. * tests/guix-package.sh: Add test.
2014-06-13Separate package description translations from string translations.Ludovic Courtès
* po/packages/LINGUAS, po/packages/Makevars, po/packages/POTFILES.in: New files. * po/guix/Makevars (DOMAIN): Change to "guix". (XGETTEXT_OPTIONS): Remove "--keyword=synopsis --keyword=description". * po/guix/POTFILES.in: Remove gnu/packages/*.scm. * configure.ac: Change to gettext 0.18.3. Produce po/packages/Makefile.in. * Makefile.am (SUBDIRS): Add po/packages. * guix/ui.scm (%package-text-domain): New variable. (P_): New procedure. (package->recutils): Use 'P_' instead of '_'. * guix/scripts/package.scm (find-packages-by-description): Use 'P_' instead of 'gettext'.
2014-04-05guix package: Fix indentation of packages to remove.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Add space when showing packages to remove.
2014-04-02guix package: 'search-path-environment-variables' traverses module tree once.Ludovic Courtès
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Use 'find-best-packages-by-name' instead of 'find-packages-by-name'. On a profile with 140 packages, this reduces execution time of this procedure from 5.8 seconds to 2.9 seconds (50% improvement.)
2014-04-02guix package: Register non-default profiles as GC roots.Ludovic Courtès
* guix/scripts/package.scm (maybe-register-gc-root): New procedure. * tests/guix-package.sh (profile): Grep the output of "guix gc --list-live" in a couple of places.
2014-03-01guix package: Use the common build options from (guix scripts build).Ludovic Courtès
* guix/scripts/build.scm (%standard-build-options): Change option handlers to support multiple seeds. * guix/scripts/package.scm (show-help): Remove --dry-run, --fallback, --no-substitutes, and --max-silent-time. (%options): Likewise, and add %STANDARD-BUILD-OPTIONS. (%default-options): Add 'verbosity'. (guix-package): Call 'set-build-options-from-command-line' instead of 'set-build-options'.
2014-01-13guix package: Gracefully handle EPIPE on '--search'.Ludovic Courtès
* guix/scripts/package.scm (guix-package): Wrap body of 'search' in 'leave-on-EPIPE'.
2014-01-08config: '%state-directory' always honors $NIX_STATE_DIR.Ludovic Courtès
* guix/config.scm.in (%state-directory): Honor $NIX_STATE_DIR. * guix/scripts/package.scm (%profile-directory): Use %state-directory directly. * guix/store.scm (%default-socket-path, log-file): Likewise.
2014-01-04guix package: Gracefully deal with EPIPE on stdout for --list-*.Ludovic Courtès
* guix/scripts/package.scm (leave-on-EPIPE): New macro. (guix-package): Use it for 'list-installed', 'list-available', and '--list-generations'. * tests/guix-package.sh: Add test.
2013-12-22Add 'guix archive'.Ludovic Courtès
* guix/scripts/archive.scm, tests/guix-archive.sh: New files. * Makefile.am (MODULES): Add 'archive.scm'. (SH_TESTS): Add 'guix-archive.sh'. * doc/guix.texi (Invoking guix archive): New section. * guix/scripts/build.scm: Export 'derivation-from-expression'. * guix/scripts/package.scm: Export 'specification->package+output'.
2013-12-21Factorize package search between 'guix package' and 'guix build'.Ludovic Courtès
* guix/scripts/package.scm (newest-available-packages): Remove. (find-best-packages-by-name): Move to... * gnu/packages.scm (find-best-packages-by-name): ... here. (find-newest-available-packages): Memoize. * guix/scripts/build.scm (specification->package): New procedure, formerly called 'find-package' within 'guix-build'. (guix-build): Adjust accordingly.
2013-12-14guix package: allow multiple arguments after -i, -r, and -u.Mark H Weaver
* guix/scripts/package.scm (%options): Adapt option processors to accept and return a second seed value: 'arg-handler', which handles bare arguments (if not false). The install, remove, and upgrade option processors return an arg-handler that repeat the same operation. All other option processors return #f as the arg-handler. Make the arguments to install and remove optional. The upgrade option processor deletes (upgrade . #f) from the alist before adding a new entry. (guix-package): Procedures passed to 'args-fold*' accept the new seed value 'arg-handler'. The 'operand-proc' uses 'arg-handler' (if not false). * doc/guix.texi (Invoking guix package): Update docs. * tests/guix-package.sh: Add test.
2013-11-24guix package: Honor the current output when upgrading.Ludovic Courtès
* guix/scripts/package.scm (specification->package+output): Pass OUTPUT to 'package-specification->name+version+output'.
2013-11-01guix package: Show the output name of what's being removed.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Show the output name of packages being removed.
2013-11-01guix package: Fix indentation of "will be removed" messages.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Remove extra indentation from the removal sentences.
2013-11-01guix package: Allow removal of a specific package output.Ludovic Courtès
Fixes <http://bugs.gnu.org/15756>. * guix/profiles.scm (<manifest-pattern>): New record type. (remove-manifest-entry): Remove. (entry-predicate, manifest-matching-entries): New procedures. (manifest-remove): Accept a list of <manifest-pattern>. (manifest-installed?): Replace 'name' parameter by 'pattern', a <manifest-pattern>. * guix/scripts/package.scm (options->removable): Return a list of <manifest-pattern>. (guix-package)[process-action]: Use 'manifest-matching-entries' to compute the list of packages to remove. * tests/profiles.scm: New file. * Makefile.am (SCM_TESTS): Add it.
2013-11-01guix package: Separate '--remove' option processing.Ludovic Courtès
* guix/scripts/package.scm (options->removable): New procedure. (guix-package)[process-actions]: Use it. Rename 'remove*' to 'remove' and 'install*' to 'install'.
2013-11-01ui: Factorize package specification parsing.Ludovic Courtès
* guix/ui.scm (package-specification->name+version+output): New procedure. * guix/scripts/package.scm (specification->package+output): Use it. * tests/ui.scm ("package-specification->name+version+output"): New test.
2013-11-01Add (guix profiles).Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): New procedure, moved from... (guix-package): ... here. (<manifest>, make-manifest, <manifest-entry>, profile-manifest, manifest->sexp, sexp->manifest, read-manifest, write-manifest, remove-manifest-entry, manifest-remove, manifest-installed?, manifest=?, profile-regexp, generation-numbers, previous-generation-number, profile-derivation, generation-number, generation-file-name, generation-time, lower-input): Move to... * guix/profiles.scm: ... here. New file. * Makefile.am (MODULES): Add it.
2013-10-30guix package: Factorize generation file name computation.Ludovic Courtès
* guix/scripts/package.scm (generation-file-name): New procedure. Change all occurrences of (format #f "~a-~a-link" profile number) to use it.
2013-10-30guix package: Specify inputs for each manifest entry.Ludovic Courtès
* guix/scripts/package.scm (<manifest-entry>): Add 'inputs' field. (manifest=?, lower-input): New procedure. (profile-derivation)[builder]: Add #:log-port argument to 'union-build'. [ensure-valid-input]: Remove. Add each entry's inputs to the input list. (options->installable): Return just the list of entries. [package->manifest-entry]: Set 'inputs' field. [canonicalize-deps]: Rename to... [deduplicate]: ... this. Remove input fiddling. (guix-package)[process-actions]: Use 'manifest=?' to compare the new and old manifests. Pass directly PROF-DRV to 'show-what-to-build'. Pass #:print-build-trace #f to 'set-build-options'.
2013-10-30guix package: Always use the term "profile", not "user environment".Ludovic Courtès
* guix/scripts/package.scm (%user-environment-directory): Rename to... (%user-profile-directory): ... this. Update users accordingly. (profile-derivation): Use the term "profile" instead of "user environment", and use "profile" as the derivation name.
2013-10-30guix package: Introduce <manifest> and <manifest-entry> types.Ludovic Courtès
* guix/scripts/package.scm (<manifest>, <manifest-entry>): New record types. (make-manifest, read-manifest, manifest->sexp, sexp->manifest, read-manifest, write-manifest, remove-manifest-entry, manifest-remove, manifest-installed?): New procedures. (profile-derivation): Take a manifest as the second parameter. Use 'manifest->sexp'. Expect <manifest-entry> objects instead of "tuples". Adjust callers accordingly. (search-path-environment-variables): Changes 'packages' parameter to 'entries'. Rename 'package-in-manifest->package' to 'manifest-entry->package'; expect <manifest-entry> objects. (display-search-paths): Rename 'packages' to 'entries'. (options->installable): Change 'installed' to 'manifest'. Have 'canonicalize-deps' return name/path tuples instead of raw packages. Rename 'package->tuple' to 'package->manifest-entry'. Use <manifest-entry> objects instead of tuples. (guix-package)[process-actions]: Likewise. Rename 'packages' to 'entries'. [process-query]: Use 'manifest-entries' instead of 'manifest-packages'.