Commit Graph

624 Commits

Author SHA1 Message Date
Ludovic Courtès 81fa80b245 guix build: Improve procedural decomposition.
* guix/scripts/build.scm (%store): Remove.
  (derivation-from-expression): Add 'store' parameter.  Adjust caller
  accordingly.
  (register-root): New procedure, formerly within 'guix-build'.
  (options->derivations): New procedure, formerly inline within
  'guix-build'.
  (guix-build): Adjust accordingly.
2013-12-21 22:53:58 +01:00
Ludovic Courtès 3f26bfc18a Factorize package search between 'guix package' and 'guix build'.
* 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-21 22:36:32 +01:00
Ludovic Courtès 526382ff92 daemon: Implement signed archive import/export.
* guix/scripts/authenticate.scm, nix/scripts/guix-authenticate.in,
  tests/signing-key.pub, tests/signing-key.sec: New files.
* po/POTFILES.in: Add 'guix/scripts/authenticate.scm'.
* guix/store.scm (dump-port): New procedure.
  (process-stderr): Add 'user-port' optional parameter.  Handle
  the %STDERR-WRITE and %STDERR-READ cases as expected.
  (import-paths, export-path, export-paths): New procedures.
* tests/store.scm ("export/import several paths", "import corrupt
  path"): New tests.
* Makefile.am (MODULES): Add 'guix/scripts/authenticate.scm'.
  (EXTRA_DIST): Add 'tests/signing-key.{pub,sec}'.
* daemon.am (libstore_a_CPPFLAGS)[-DNIX_CONF_DIR]: Change 'NIX_CONF_DIR'
  to .../guix.  Change 'OPENSSL_PATH' to 'guix-authenticate'.
* config-daemon.ac: Instantiate 'nix/scripts/guix-authenticate'.
* nix/nix-daemon/guix-daemon.cc (main): Augment $PATH to include
  'settings.nixLibexecDir'.
* test-env.in: Export 'NIX_CONF_DIR' and 'NIX_LIBEXEC_DIR'.  Populate
  $NIX_CONF_DIR.
2013-12-20 17:17:42 +01:00
Ludovic Courtès ce507041f7 pk-crypto: Add a few sexp utility procedures.
* guix/pk-crypto.scm (gcry-sexp-car, gcry-sexp-cdr, gcry-sexp-nth,
  gcry-sexp-nth-data, dereference-size_t, latin1-string->bytevector,
  hash-data->bytevector): New procedures.
* tests/pk-crypto.scm ("gcry-sexp-car + cdr", "gcry-sexp-nth",
  "gcry-sexp-nth-data", "bytevector->hash-data->bytevector"): New tests.
2013-12-20 15:22:15 +01:00
Ludovic Courtès 3476ded934 Add (guix pk-crypto).
* guix/pk-crypto.scm, tests/pk-crypto.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
2013-12-20 00:36:26 +01:00
Ludovic Courtès 3dbeecd2ff pull: Move build code to (guix build pull).
* guix/build/pull.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/pull.scm (unpack): Use it.
2013-12-16 23:26:48 +01:00
Cyril Roelandt af949e8ee7 gnu: gtk+: enable introspection.
* gnu/packages/gtk.scm (atk, gdk-pixbuf, gtk+, pango): enable introspection
* guix/build/gnome.scm: New file.
2013-12-15 23:39:43 +01:00
Mark H Weaver 6447738c01 guix package: allow multiple arguments after -i, -r, and -u.
* 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-12-14 16:25:02 -05:00
Ludovic Courtès 52a79f1e73 pull: Compile guix/ files before gnu/ files.
* guix/scripts/pull.scm (unpack)[builder]: Build files under guix/
  before files under gnu/.
2013-12-14 16:48:38 +01:00
Ludovic Courtès ca6c4fa190 pull: Compile files in parallel.
* guix/scripts/pull.scm (unpack)[builder](compile-file*): Remove.
  (call-with-process, p-for-each): New procedures.  Use them to compile
  files in parallel.
2013-12-14 16:32:42 +01:00
Ludovic Courtès 0c2e1dd45d pull: Limit memory usage when compiling.
Reported by Arne Babenhauserheide <arne.babenhauserheide@kit.edu>.

* guix/scripts/pull.scm (unpack)[builder](compile-file*): Change to run
  'compile-file' in a child process.  This limits memory usage; before
  that memory usage was proportional to the number of files to compile.
2013-12-14 16:32:42 +01:00
Ludovic Courtès 5c0f184536 store: Optimize 'store-path-package-name' and 'store-path-hash-part'.
* guix/store.scm (store-regexp*): New procedure.
  (store-path-package-name, store-path-hash-part): Use it.
2013-12-11 00:19:27 +01:00
Ludovic Courtès 033adfe7e0 gnu: Add (gnu system).
* gnu/system/vm.scm (lower-inputs): Move to monads.scm.
  (qemu-image): Don't add GRUB-CONFIGURATION to the INPUTS-TO-COPY.
  (union, file-union, etc-directory): Move to gnu/system.scm.
  (%demo-operating-system): New variable.
  (system-qemu-image): Add 'os' parameter.  Rewrite in terms of
  'operating-system-derivation'.
* guix/monads.scm (lower-inputs): New procedure.
* gnu/system/grub.scm (grub-configuration-file): Change 'entries' to be
  a plain list instead of a list of monadic values.
* gnu/system.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
2013-12-10 00:24:02 +01:00
Ludovic Courtès 593c3fe600 monads: Fix 'anym'.
* guix/monads.scm (anym): Fix successful case.
* tests/monads.scm ("anym"): New test.
2013-12-10 00:24:01 +01:00
Andreas Enge 9200c11009 build-system/perl: Honour phases argument in perl build system.
* guix/build-system/perl.scm (perl-build): Propagate phases argument to
    builder.
2013-12-09 13:50:58 +01:00
Ludovic Courtès 14f550c31c monads: Remove erroneous comment.
* guix/monads.scm (sequence): Remove erroneous comment.
2013-12-05 23:05:13 +01:00
Ludovic Courtès f4badde3fa build-system/gnu: Fix reference to Gettext in 'dist-package'.
* guix/build-system/gnu.scm (dist-package): Change 'gettext' to
  'gnu-gettext'.
2013-12-04 21:43:55 +01:00
Ludovic Courtès dd1a5a152c derivations: Use more keyword parameters for 'build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Turn 'system' and
  'inputs' into keyword parameters.
  Adjust callers accordingly.
* gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm,
  guix/build-system/gnu.scm, guix/build-system/perl.scm,
  guix/build-system/python.scm, guix/build-system/trivial.scm,
  guix/download.scm, guix/packages.scm, guix/profiles.scm,
  guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh,
  tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of
  'build-expression->derivation' and 'derivation-expression'
  accordingly.
* doc/guix.texi (Derivations): Adjust 'build-expression->derivation'
  documentation accordingly.
  (The Store Monad): Likewise for 'derivation-expression'.
2013-12-04 16:07:53 +01:00
Ludovic Courtès 4d5f0bae3e gnu-maintenance: Ignore "redirect" blurbs.
* guix/gnu-maintenance.scm (official-gnu-packages)[official-description]:
  Return #f for blurbs that start with "redirect ".
2013-12-03 21:33:55 +01:00
Ludovic Courtès 977f03ffd3 build-system/cmake: Build out of source tree by default.
* guix/build-system/cmake.scm (cmake-build): Change 'out-of-source?' to
  default to #t.
* guix/build/cmake-build-system.scm (configure): Add 'out-of-source?'
  keyword parameter and honor it.
2013-11-28 00:15:07 +01:00
Ludovic Courtès de6792699e substitute-binary: Work around Guile 2.0.5's broken 'n-par-map'.
* guix/scripts/substitute-binary.scm (n-par-map*): New procedure.
  (guix-substitute-binary): Use it instead of 'n-par-map'.
  Reported by Nikita Karetnikov and Eric Bavier.
2013-11-26 22:20:39 +01:00
Ludovic Courtès b874f305e5 guix package: Honor the current output when upgrading.
* guix/scripts/package.scm (specification->package+output): Pass OUTPUT
  to 'package-specification->name+version+output'.
2013-11-24 15:30:06 +01:00
Ludovic Courtès edae5b3d50 Merge branch 'master' into core-updates
Conflicts:
	guix/packages.scm
2013-11-20 23:51:26 +01:00
Ludovic Courtès 5dfd5b82c2 build-system/python: Add #:test-target parameter.
* guix/build-system/python.scm (python-build): Add #:test-target
  parameter.  Reported by Eric Bavier <ericbavier@gmail.com>.
2013-11-20 19:03:26 +01:00
Ludovic Courtès 0b8749b7bd packages: 'package-field-location' returns a relative file name.
* guix/packages.scm (package-field-location): Set
  %FILE-PORT-NAME-CANONICALIZATION.
* tests/packages.scm ("package-field-location, relative file name"): New
  test.
2013-11-18 23:56:07 +01:00
Ludovic Courtès ac5de156ae guix build: '-e' can be passed a monadic thunk.
* guix/ui.scm (read/eval): New procedure.
  (read/eval-package-expression): Use it.
* guix/scripts/build.scm (derivations-from-package-expressions): Rename to...
  (derivation-from-expression): ... this.  Accept procedures, under the
  assumption that they are monadic thunk.
  (show-help): Adjust accordingly.
  (guix-build): Ditto.
* tests/guix-build.sh: Add test.
* doc/guix.texi (Invoking guix build): Augment description of '-e'.
2013-11-18 23:08:20 +01:00
Ludovic Courtès c509bf8c87 substitute-binary: Adjust timeout handling for Guile > 2.0.9.
* guix/scripts/substitute-binary.scm (with-timeout): Update comment to
  mention the fix's commit ID.
  (fetch): In the 'with-timeout' handler, close PORT only one Guile
  versions < 2.0.9.39.  Before that, on Guile >= 2.0.9.39, the HTTP
  client would end up trying to read from a closed file descriptor.
2013-11-14 01:09:07 +01:00
Ludovic Courtès a716e36de9 derivations: Allow 'map-derivations' to replace sources.
* guix/derivations.scm (map-derivation)[input->output-paths]: Allow
  non-derivation inputs.
  Allow replacements to be store files.  Replace in SOURCES too.
* tests/derivations.scm ("map-derivation, sources"): New test.
2013-11-13 11:22:07 +01:00
Ludovic Courtès f80594cc41 packages: Suitably cope with indirect store paths as package sources.
* guix/packages.scm (package-source-derivation): Don't let indirect
  store paths pass through.
* tests/packages.scm ("package-source-derivation, indirect store path"):
  New test.
2013-11-13 00:29:05 +01:00
Ludovic Courtès 9336e5b5e7 store: Make 'direct-store-path?' public.
* guix/store.scm (direct-store-path?): New procedure.
* guix/derivations.scm (derivation)[direct-store-path?]: Remove.
* tests/store.scm ("direct-store-path?"): New test.
2013-11-13 00:29:05 +01:00
Ludovic Courtès e387ab7c10 derivations: Add 'map-derivation'.
* guix/derivations.scm (map-derivation): New procedure.
* tests/derivations.scm ("map-derivation"): New test.
2013-11-13 00:29:05 +01:00
Ludovic Courtès 56b943de6e utils: Add 'string-replace-substring'.
* guix/utils.scm (string-replace-substring): New procedure.  Based on
  code by Mark H. Weaver.
* tests/utils.scm ("string-replace-substring"): New test.
2013-11-13 00:29:05 +01:00
Ludovic Courtès bf4211523b guix build: Add '--log-file'.
* guix/scripts/build.scm (show-help): Add '--log-file'.
  (%options): Likewise.
  (guix-build): Set %FILE-PORT-NAME-CANONICALIZATION.  Honor '--log-file'.
* tests/guix-build.sh: Add '--log-file' tests.
* doc/guix.texi (Invoking guix build): Document '--log-file'.
2013-11-12 01:06:45 +01:00
Ludovic Courtès eddd4077a5 store: Add 'log-file' procedure.
* guix/store.scm (log-file): New procedure.
* tests/store.scm ("log-file, derivation", "log-file, output file
  name"): New tests.
2013-11-12 01:06:45 +01:00
Ludovic Courtès 50dc48922c substitute-binary: Increase lookup concurrency to reduce latency.
* guix/scripts/substitute-binary.scm (%lookup-threads): New variable.
  (guix-substitute-binary): Use 'n-par-map' instead of 'par-map' for
  batch 'lookup-narinfo' calls.
2013-11-08 22:47:02 +01:00
Ludovic Courtès 7db9608d52 Merge branch 'master' into core-updates
Conflicts:
	guix/packages.scm
2013-11-08 21:58:09 +01:00
Ludovic Courtès f9cc897105 packages: Add a 'snippet' field to <origin>.
* guix/packages.scm (<origin>): Add 'snippet', 'modules', and
  'imported-modules' fields.
  (patch-and-repack): Make 'inputs' a keyword parameter.  Add 'snippet',
  'modules', and 'imported-modules' parameters.  Accept SOURCE as a raw
  file name.  Insert SNIPPET in BUILDER.  Pass IMPORTED-MODULES to
  'build-expression->derivation'.
  (package-source-derivation): Pass the extra arguments to
  'patch-and-repack'.
* tests/packages.scm ("package-source-derivation, snippet"): New test.
* doc/guix.texi (Defining Packages): Mention the 'patches' and 'snippet'
  fields.
  (Invoking guix build): Tell that --source has patches and snippets
  applied.
  (Software Freedom): Mention packages that contain non-free code.
2013-11-07 22:57:30 +01:00
Ludovic Courtès 64a967cc9c ui: Make '--version' output GCS-compliant.
* guix/ui.scm (show-version-and-exit): Display copyright year, license,
  and LACK OF WARRANTY.
2013-11-03 23:09:30 +01:00
Ludovic Courtès 45b418d634 guix package: Show the output name of what's being removed.
* guix/scripts/package.scm (show-what-to-remove/install): Show the
  output name of packages being removed.
2013-11-01 23:59:25 +01:00
Ludovic Courtès 1b5ba6b1e9 guix package: Fix indentation of "will be removed" messages.
* guix/scripts/package.scm (show-what-to-remove/install): Remove extra
  indentation from the removal sentences.
2013-11-01 23:21:01 +01:00
Ludovic Courtès a20787706c guix package: Allow removal of a specific package output.
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-01 23:21:01 +01:00
Ludovic Courtès 537630c5a7 guix package: Separate '--remove' option processing.
* guix/scripts/package.scm (options->removable): New procedure.
  (guix-package)[process-actions]: Use it.  Rename 'remove*' to 'remove'
  and 'install*' to 'install'.
2013-11-01 23:21:00 +01:00
Ludovic Courtès 2876b98925 ui: Factorize package specification parsing.
* 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-01 23:21:00 +01:00
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 ff8061b591 Merge branch 'master' into core-updates 2013-11-01 12:59:31 +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