Commit Graph

577 Commits

Author SHA1 Message Date
Ludovic Courtès cc4ecc2d88 Add (guix profiles).
* 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-11-01 23:21:00 +01:00
Ludovic Courtès cdbca518ca union: Do not warn when identical files collide.
* guix/build/union.scm (file=?): New procedure.
  (union-build)[resolve-collision]: Do not warn when identical files
  collide.
2013-10-31 23:38:58 +01:00
Ludovic Courtès 477d30d0d8 guix package: Factorize generation file name computation.
* 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-30 22:09:33 +01:00
Ludovic Courtès 1fcc3ba309 guix package: Specify inputs for each manifest entry.
* 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-30 22:09:33 +01:00
Ludovic Courtès c065c443a0 union: Make the log port a parameter.
* guix/build/union.scm (union-build): Add 'log-port' keyword parameter;
  use it.
2013-10-30 22:09:32 +01:00
Ludovic Courtès d0dc4907d6 derivations: 'derivation-path->output-path' honors the 'output' parameter.
* guix/derivations.scm (derivation-path->output-path): Pass OUTPUT.
* tests/derivations.scm ("multiple-output derivation,
  derivation-path->output-path"): New test.
2013-10-30 22:09:32 +01:00
Ludovic Courtès d595e456c1 guix package: Always use the term "profile", not "user environment".
* 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-30 22:09:32 +01:00
Ludovic Courtès f067fc3e77 guix package: Introduce <manifest> and <manifest-entry> types.
* 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'.
2013-10-30 22:09:32 +01:00
Ludovic Courtès edac884624 guix package: Better separate option processing.
* guix/scripts/package.scm (find-package): Rename to...
  (specification->package+output): ... this.  Rename 'name' parmameter
  to 'spec'.  Return a package and output name instead of a tuple.
  (options->installable): New procedure
  (guix-package)[process-actions]: Use it, and remove corresponding
  code.
2013-10-30 22:09:32 +01:00
Ludovic Courtès d46d8794a1 guix package: Declutter the entry point.
* guix/scripts/package.scm (newest-available-packages,
  find-best-packages-by-name, find-package, upgradeable?): New
  procedures, moved from...
  (guix-package): ... here.
2013-10-29 22:03:02 +01:00
Ludovic Courtès 7587041028 build-system/{cmake,perl}: Don't use (guix build gnu-build-system).
Previously references to '%standard-phases' in builder-side code would
refer to the wrong one.

* guix/build-system/cmake.scm (cmake-build): Remove (guix build
  gnu-build-system) from the default MODULES value.
* guix/build-system/perl.scm (perl-build): Likewise.
2013-10-29 00:08:44 +01:00
Ludovic Courtès 59fbeb8cae records: define-record-type*: Field bindings are bound with 'let*'.
* guix/records.scm (define-record-type*): Wrap field bindings in a
  'let*', not in a 'letrec*', which turned out to be pointlessly
  inconvenient.
* tests/records.scm: Adjust test names accordingly.
2013-10-15 23:31:22 +02:00
Ludovic Courtès b2ba65c897 guix package: '--search' matches against package names.
* guix/scripts/package.scm (find-packages-by-description): Return
  packages whose name matches RX.
2013-10-15 22:59:50 +02:00
Ludovic Courtès 178f77b2d2 pull: Compile modules correctly regardless of the compilation order.
* guix/scripts/pull.scm (unpack)[builder]: Work around
  <http://bugs.gnu.org/15602>.
2013-10-13 22:50:11 +02:00
Andreas Enge e78fd4ca63 guix: Make cmake build system aware of usual paths.
*  guix/build/cmake-build-system.scm (configure): Set CMAKE_LIBRARY_PATH to
     LIBRARY_PATH and CMAKE_INCLUDE_PATH to CPATH.
2013-10-13 18:02:49 +02:00
Ludovic Courtès 52af657aee pull: Simplify the builder.
* guix/scripts/pull.scm (unpack)[builder]: Use 'copy-recursively' and
  'copy-file' instead of 'file-system-fold'.
2013-10-13 01:14:21 +02:00
Ludovic Courtès b421cebd6a build-system/perl: Lazily resolve (gnu packages perl).
* guix/build-system/perl.scm (default-perl): New procedure.
  (perl-build): Use it.
2013-10-12 22:29:32 +02:00
Ludovic Courtès 0ad7da1e90 pull: Add '--url' option.
* guix/scripts/pull.scm (%default-options): Add 'tarball-url' pair.
  (%options, show-help): Add '--url'.
  (guix-pull): Honor it.
2013-10-12 22:29:32 +02:00
Ludovic Courtès d8907ac43f download: Support 'file://' URLs.
* guix/download.scm (download-to-store): When URL has a 'file' scheme or
  no scheme, use 'add-to-store' directly.
2013-10-12 22:29:31 +02:00
Ludovic Courtès 39e9f95d05 guix: Add missing call to 'bindtextdomain'.
* scripts/guix.in (config-lookup): Add "localedir" entry.
  (run-guix-main): Add call to 'bindtextdomain'.
* guix/ui.scm (initialize-guix): Use %GETTEXT-DOMAIN instead of a
  literal.
2013-10-12 22:29:31 +02:00
Ludovic Courtès 1a75f8d939 gnu-maintenance: Adjust URL of package description file.
* guix/gnu-maintenance.scm (%package-description-url): Adjust to the
  new URL.
2013-10-11 22:18:47 +02:00
Ludovic Courtès 4e45e35266 snix: Prefer descriptions from the Womb rather than from Nixpkgs.
* guix/snix.scm (snix-derivation->guix-package): Use
  'gnu-package-doc-description' as the description for GNU packages.
2013-10-09 16:18:23 +02:00
Ludovic Courtès 129f9e1173 gnu-maintenance: Get descriptions from 'gnumaint/pkgdescr.txt'.
* guix/gnu-maintenance.scm (%gnumaint-base-url): New variable.
  (%package-list-url): Use it.
  (%gsrc-package-list-url): Remove.
  (%package-description-url): New variable.
  (official-gnu-packages): Change to use %PACKAGE-DESCRIPTION-URL
  instead of %GSRC-PACKAGE-LIST-URL.  Adjust recutils field names
  accordingly.
2013-10-09 13:00:00 +02:00
Ludovic Courtès ac10e0e17e packages: Add 'patches' and related fields to <origin>.
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.
2013-10-09 00:11:34 +02:00
Ludovic Courtès e0029b745a download: Add Debian mirrors.
* guix/download.scm (%mirrors)[debian]: New set of mirrors.
2013-10-05 16:45:39 +02:00
Ludovic Courtès aeb7ec5c9a monads: Allow resolution of a monad's bind/return at expansion time.
* guix/monads.scm (<monad>): Turn in a raw SRFI-9 record type.
  (define-monad): New macro.
  (with-monad): Add a case for when MONAD is a macro.
  (identity-return, identity-bind, store-return, store-bind): Inline.
  (%identity-monad, %store-monad): Use 'define-monad'.
* tests/monads.scm ("monad?"): New test.
2013-10-03 23:12:20 +02:00
Ludovic Courtès b860f38244 Add (guix monads).
* guix/monads.scm: New file.
* tests/monads.scm: New file.
* Makefile.am (MODULES): Add guix/monads.scm.
  (SCM_TESTS): Add tests/monads.scm.
* doc/guix.texi (The Store Monad): New node.
  (The Store): Reference it.
2013-10-03 23:12:20 +02:00
Ludovic Courtès 2442257f2d Merge branch 'core-updates' 2013-09-27 01:30:57 +02:00
Ludovic Courtès d7ddb257c9 guix package: '--delete-generations' deletes generations older than specified.
* guix/scripts/package.scm (matching-generations): Add
  'duration-relation' keyword parameter.
  (guix-package)[process-action](delete-generations): Pass
  #:duration-relation >.
* tests/guix-package.sh: Add test.
* doc/guix.texi (Invoking guix package): Clarify the meaning of
  durations for '--list-durations' and '--delete-durations'.
2013-09-27 01:23:59 +02:00
Ludovic Courtès 03761a4465 build-system/trivial: Take the 'source' field into account.
* 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.
2013-09-27 00:46:17 +02:00
Nikita Karetnikov b7884ca3ca guix package: Add '--delete-generations'.
* guix/scripts/package.scm (switch-to-previous-generation): New function.
  (roll-back): Use the new function instead of 'switch-link'.
  (show-help): Add '--delete-generations'.
  (%options): Likewise.
  (guix-package)[process-actions]: Add 'current-generation-number',
  'display-and-delete', and 'delete-generation'.  Add support for
  '--delete-generations', and reindent the code.
* tests/guix-package.sh: Test '--delete-generations'.
* doc/guix.texi (Invoking guix-package): Document '--delete-generations'.
2013-09-26 15:41:43 +00:00
Nikita Karetnikov 64d2e973fb guix package: Add 'link-to-empty-profile'.
* guix/scripts/package.scm (link-to-empty-profile): New function.
  (roll-back): Use it.
2013-09-26 15:41:43 +00:00
Nikita Karetnikov 4658b2c47b guix package: Exit with 0 when there is nothing to list.
* guix/scripts/package.scm (guix-package)[process-query]: Exit with 0
  when there are no generations containing packages or no profiles.
2013-09-26 15:41:43 +00:00
Ludovic Courtès 7facbf2b58 Merge branch 'master' into core-updates 2013-09-26 00:20:11 +02:00
Ludovic Courtès de8bcdaeb5 packages: Make the 'output' parameter of 'package-output' optional.
* guix/packages.scm (package-output): Make the 'output' parameter
  optional.
2013-09-25 23:26:42 +02:00
Nikita Karetnikov 9ac9360d6e guix package: Show which generation is the current one.
* guix/scripts/package.scm (guix-package)[process-query]: Show that a
  generation is the current one if the profile points to it.
* tests/guix-package.sh: Test it.
2013-09-25 16:10:40 +00:00
Nikita Karetnikov 4b2bc804d8 guix package: Do not list the zeroth generation.
* guix/scripts/package.scm (guix-package)[process-query]: Change
  'list-generation' to not list the zeroth generation.
* tests/guix-package.sh: Test it.
* doc/guix.texi (Invoking guix package): Document it, and use the
  right term when talking about generations.
2013-09-25 16:08:39 +00:00
Nikita Karetnikov 0ab212b946 guix package: Exit with 1 when a generation cannot be listed.
* guix/scripts/package.scm (guix-package)[process-query]: Exit with 1
  when a generation does not exist or the profile points to the zeroth
  generation.
* tests/guix-package.sh: Test the former case.
2013-09-25 16:07:50 +00:00
Ludovic Courtès 5608847c6f Merge branch 'master' into core-updates 2013-09-23 00:35:17 +02:00
Ludovic Courtès 48e488eb2c nar: Fix file descriptor leak when writing a Nar.
* guix/nar.scm (write-contents)[call-with-binary-input-file]: Always
  close PORT.
2013-09-23 00:33:50 +02:00
Ludovic Courtès bd9bde1cba guix package: Show most recently installed packages last.
Suggested by Andreas Enge <andreas@enge.fr>.

* guix/scripts/package.scm (guix-package)[list-generations,
  list-installed]: Reverse the result of 'manifest-packages'.
* doc/guix.texi (Invoking guix package): Document the order of packages
  for '--list-generations' and '--list-installed'.
2013-09-23 00:33:50 +02:00
Ludovic Courtès 99882c613c guix package: Sort the list of generation numbers in '--list-generations'.
* guix/scripts/package.scm (generation-numbers): Sort the result.
2013-09-21 22:35:14 +02:00
Ludovic Courtès 4d497632ce guix package: Internationalize "Generation" string.
* guix/scripts/package.scm (guix-package): Internationalize generation
  listing.
2013-09-21 22:32:20 +02:00
Ludovic Courtès 3b627eac48 pull: Adjust to 'derivation' API change.
Fixes <http://bugs.gnu.org/15428>.
Reported by Cyrill Schenkel <cyrill.schenkel@gmail.com>.

* guix/scripts/pull.scm (guix-pull): 'unpack' returns a single value.
2013-09-21 22:16:26 +02:00
Nikita Karetnikov 2cd09108c9 guix package: Add '--list-generations'.
* guix/scripts/package.scm: Import (srfi srfi-19).
  (generation-time, matching-generations): New functions.
  (show-help): Add '--list-generations'.
  (%options): Likewise.
  (guix-package)[process-query]: Add support for '--list-generations'.
* guix/ui.scm: Import (srfi srfi-19) and (ice-9 regex).
  (string->generations, string->duration): New functions.
* tests/guix-package.sh: Test '--list-generations'.
* tests/ui.scm: Import (srfi srfi-19).
  Test 'string->generations' and 'string->duration'.
* doc/guix.texi (Invoking guix-package): Document '--list-generations'.
2013-09-19 11:22:31 +00:00
Ludovic Courtès 59688fc4b5 derivations: 'derivation' and related procedures return a single value.
* 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.
2013-09-18 18:49:53 +02:00
Ludovic Courtès 07c86312ca derivations: Add a nicer printer.
* guix/derivations.scm (<derivation>): Add a printer.
2013-09-18 11:10:02 +02:00
Ludovic Courtès 6a446d5680 derivations: Keep the .drv file name in <derivation> objects.
* guix/derivations.scm (<derivation>): Add 'file-name' field.
  (%read-derivation): Use (port-filename DRV-PORT) as the file name for
  the result.
  (derivation): Set the 'file-name' field in the result.
* tests/derivations.scm ("build derivation with 1 source"): Assert that
  'derivation-file-name' returns the right thing.
2013-09-17 23:02:13 +02:00
Ludovic Courtès 66018f1c33 utils: 'find-files' returns a sorted list.
* guix/build/utils.scm (find-files): Sort the result lexicographically.
* guix/scripts/pull.scm (unpack): Don't sort the result of 'find-files'.
2013-09-15 23:21:30 +02:00
Andreas Enge aae4ead814 Merge branch 'python' 2013-09-14 10:45:01 +02:00