Commit Graph

1343 Commits

Author SHA1 Message Date
Ludovic Courtès e9c1e22f04 ui: Add missing copyright line.
* guix/ui.scm: Add copyright line for Deck (aka. nebuli).
2015-02-26 00:04:36 +01:00
Ludovic Courtès cf6ce3e6ef ui: Honor --no-* options passed via $GUIX_BUILD_OPTIONS.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>.

* guix/ui.scm (parse-command-line)[parse-options-from]: Add 'seeds'
  parameter.
  Thread the result of the first 'parse-options-from' call to the
  second.
2015-02-26 00:04:36 +01:00
Ludovic Courtès b3f213893b ui: Factorize command-line + env. var. option parsing.
* 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-26 00:04:36 +01:00
Mark H Weaver c964a15d82 download: Cope with Guile 2.0.6 or earlier.
* guix/build/download.scm: Do not attempt to support relative URIs in
  "Location" headers if 'declare-relative-uri-header!' is not present.
  This is the case for Guile 2.0.6 or earlier.
2015-02-24 20:01:55 -05:00
Ludovic Courtès 6e1a7d17f4 guix system: Honor '--no-grub'.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00564.html>.

* guix/scripts/system.scm (%options) <no-grub>: Use 'alist-cons' instead
  of 'alist-delete'.
2015-02-24 23:43:03 +01:00
Andreas Enge 6d5e7ef3ae licenses: Add IPA Font License.
* guix/licenses.scm (ipa): New variable.
2015-02-24 16:09:30 +01:00
Ludovic Courtès b69c5c2ced tests: Skip tests that would fail due to the shebang length.
Reported by Daniel Kochmański <dkochmanski@hellsgate.pl>.
Fixes <http://bugs.gnu.org/19888>.

* guix/tests.scm (shebang-too-long?): New procedure.
* tests/builders.scm ("gnu-build"): Conditionalize on
  not (shebang-too-long?).
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh (shebang_not_too_long): New function.
  Use it to determine whether to build 'gnu-make-boot0'.
2015-02-24 00:01:34 +01:00
Ludovic Courtès 12d720fd1a tests: Factorize the network reachability test.
* guix/tests.scm (network-reachable?): New procedure.
* tests/builders.scm (network-reachable?): Remove.
  Replace references to it with calls to the new 'network-reachable?'
  procedure.
* tests/derivations.scm (%coreutils): Use 'network-reachable?' instead
  of 'getaddrinfo'.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise.
2015-02-24 00:01:34 +01:00
Mark H Weaver 431b28d9dc import: cpan: Change %corelist into a promise.
Fixes compilation failures in 'guix pull'.

* guix/import/cpan.scm (%corelist): Change it to a promise by wrapping it with
  'delay'.
  (cpan-module->sexp): Adapt uses of %corelist by wrapping with 'force'.
2015-02-20 16:28:05 -05:00
Mark H Weaver 04dec194d8 download: Handle HTTP redirects to relative URI references.
Fixes <http://bugs.gnu.org/19840>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/build/download.scm: On Guile 2.0.11 or earlier, redefine the http
  "Location" header to accept relative URIs.
  (resolve-uri-reference): New exported procedure.
  (http-fetch): Use 'resolve-uri-reference' to resolve redirections.
* guix/http-client.scm (http-fetch): Use 'resolve-uri-reference'
2015-02-19 03:32:22 -05:00
Eric Bavier e92a4ad928 import: cpan: Use cpan mirror url.
* guix/import/cpan.scm (cpan-module->sexp)[source-url]: Substitute cpan mirror
  url.
2015-02-18 23:53:46 -06:00
Eric Bavier a0c2c4b45b import: cpan: Sort inputs.
* guix/import/cpan.scm (cpan-module->sexp)[convert-inputs]: Sort returned list
  of inputs.
2015-02-18 23:53:46 -06:00
Eric Bavier 2491d58962 import: cpan: Adjust licenses.
* guix/import/cpan.scm (string->license): Add artistic2.0.  Use
  '(package-license perl) for "perl_5" as is our convention.
2015-02-18 23:53:46 -06:00
Eric Bavier 66392e475d import: cpan: Use corelist to filter dependencies.
* guix/import/cpan.scm (%corelist): New variable.
  (module->dist-name, core-module?): New procedures.
  (cpan-module->sexp)[convert-inputs]: Use them.  Include "test" dependencies
  in converted inputs.
* doc/guix.texi (Invoking guix import)[cpan]: Mention corelist filtering.
2015-02-18 23:53:46 -06:00
Eric Bavier f8e366230d guix: licenses: Add Artistic 2.0 license.
* guix/licenses.scm (artistic2.0): New variable.
2015-02-18 23:53:46 -06:00
Eric Bavier 2d2a53fc24 build-system/perl: Use Build.PL for builds if present.
* guix/build/perl-build-system.scm (configure): Use Build.PL if present.
  (build, check, install): New procedures.
  (%standard-phases): Replace build, check, and install phases.
* guix/build-system/perl (perl-build): Add make-maker? and module-build-flags
  arguments.
* doc/guix.texi (Build Systems)[perl-build-system]: Document behavior rsp.
  Build.PL and new arguments.
2015-02-18 23:53:46 -06:00
Ricardo Wurmus cb7e486797 gnu: Add R.
* gnu/packages/statistics.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it
* guix/download.scm (%mirrors): Add CRAN mirrors.
2015-02-16 16:35:41 +01:00
Andreas Enge da466f7ff6 utils: Preserve symbolic links in 'wrap-program'.
* guix/build/utils.scm (wrap-program): Preserve symbolic links instead of
    copying the contents of the link.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>

Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19743>.
2015-02-16 10:13:40 +01:00
Andreas Enge b01f89675d utils: Use $0 instead of absolute path to original program in 'wrap-program'.
* guix/build/utils.scm (wrap-program): Create scripts that use $0 (which is
    usually just the base name) instead of the absolute path to the original
    program. Alternative implementation of 2ed11b3.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>

Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19742>.
2015-02-16 10:13:39 +01:00
Ludovic Courtès ce45eb4c38 gexp: Add #:graft? parameter to 'gexp->derivation'.
* guix/gexp.scm (gexp->derivation): Add #:graft? parameter and honor it.
* tests/gexp.scm ("gexp->derivation vs. grafts"): New test.
* doc/guix.texi (G-Expressions): Update 'gexp->derivation'
  documentation.
2015-02-13 23:19:49 +01:00
Ludovic Courtès b8bedf6051 packages: Add 'set-grafting' procedure.
* guix/packages.scm (set-grafting): New procedure.
2015-02-13 23:19:49 +01:00
Ludovic Courtès 2bba832f88 tests: Add missing import.
* guix/tests.scm: Add missing import, needed by 'dummy-package'.
2015-02-13 23:19:49 +01:00
Ludovic Courtès aa72d9afdf gexp: Implement 'imported-modules' & co. using 'gexp->derivation'.
* guix/derivations.scm (imported-files): Keep private.
  (%imported-modules, %compiled-modules, build-expression->derivation):
  Mark as deprecated.
  (imported-modules, compiled-modules): Remove.
* guix/gexp.scm (%mkdir-p-definition): New variable.
  (imported-files, search-path*, imported-modules, compiled-modules):
  New procedures.
* tests/derivations.scm ("imported-files"): Remove.
* tests/gexp.scm ("imported-files", "gexp->derivation #:modules"): New
  tests.
2015-02-13 17:28:19 +01:00
Ludovic Courtès ad3729536a store: Add optional 'references' parameter to 'text-file'.
* guix/store.scm (text-file): Add optional 'references' parameter.  Pass
  it to 'add-text-to-store'.
* doc/guix.texi (The Store Monad): Adjust accordingly.
2015-02-12 23:43:18 +01:00
Ludovic Courtès 605217beaa Merge branch 'master' into core-updates 2015-02-11 22:28:21 +01:00
Ludovic Courtès c8351d9a40 gexp: Add #:allowed-references parameter to 'gexp->derivation'.
* guix/gexp.scm (lower-references): New procedure.
  (gexp->derivation): Add #:allowed-references and honor it.
* tests/gexp.scm ("gexp->derivation #:allowed-references",
  "gexp->derivation #:allowed-references, disallowed"): New tests.
* doc/guix.texi (G-Expressions): Update 'gexp->derivation' doc.
2015-02-11 22:10:14 +01:00
Ludovic Courtès fbe952c99f derivations: Make the "grafting..." message directly visible.
* guix/derivations.scm (graft-derivation)[build]: Add call to
  'force-output'.
2015-02-11 11:11:01 +01:00
Eric Bavier d5b3de6af2 utils: Strip duplicates from search path.
* guix/build/utils.scm (search-path-as-list): Delete duplicate input
  directories before searching.
2015-02-10 13:31:56 -06:00
Cyril Roelandt c9815b5deb lint: handle FTP URIs.
* guix/scripts/lint.scm (probe-uri): handle FTP URIs.
2015-02-10 00:24:30 +01:00
Ludovic Courtès 3bea13bb1f profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
Reported by Andreas Enge <andreas@enge.fr>
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>.

* guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
  instead of 'version>?'.
* tests/profiles.scm ("manifest-transaction-effects and
  pseudo-upgrades"): New test.
2015-02-09 18:18:41 +01:00
Ludovic Courtès cde1e967cf utils: Add 'version>=?'.
* guix/utils.scm (version>?): Clarify docstring.
  (version>=?): New procedure.
2015-02-09 18:18:41 +01:00
Ricardo Wurmus a677c7267b build: Add 'waf-build-system'.
* guix/build-system/waf.scm,
  guix/build/waf-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document waf-build-system.
2015-02-08 19:21:58 +01:00
Ludovic Courtès 46b23e1a43 profiles: Distinguish downgrades from upgrades.
Fixes <http://bugs.gnu.org/19764>.

* guix/profiles.scm (manifest-transaction-effects): Return downgraded
  packages as a fourth value.
* guix/ui.scm (show-manifest-transaction): Adjust accordingly.
* tests/profiles.scm ("manifest-transaction-effects and downgrades"):
  New test.
2015-02-08 19:00:39 +01:00
Ludovic Courtès b7071bc5bb ui: Properly report '&nar-error' conditions.
This is a followup to 46b8aad.

* guix/ui.scm (call-with-error-handling): Add 'nar-error?' case.
2015-02-08 19:00:39 +01:00
Ludovic Courtès 46b8aadbd6 serialization: Check for EOF and incomplete input conditions.
Fixes <http://bugs.gnu.org/19756>.
Reported by <sleep_walker@suse.cz>.

* guix/serialization.scm (currently-restored-file): New variable.
  (get-bytevector-n*): New procedure.
  (read-int, read-long-long, read-string, read-latin1-string,
  read-contents): Use it instead of 'get-bytevector-n'.
  (restore-file): Parameterize 'currently-restored-file' and set it.
* tests/nar.scm ("restore-file with incomplete input"): New test.
2015-02-07 23:16:55 +01:00
Ludovic Courtès c9323a4c69 guix package: Make custom profiles actual indirect roots.
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-02-06 17:56:22 +01:00
Ludovic Courtès 3df5acf332 pull: Always install the ~/.config/guix/latest symlink.
Before that, if two users on the same machine ran 'guix pull', the
second one would have the "Guix already up to date" message and their
~/.config/guix/latest link would be left unchanged---effectively
preventing them from updating.

* guix/scripts/pull.scm (build-and-install): Install the 'latest'
  symlink regardless of whether TO-DO? is true or false.
2015-02-06 17:39:10 +01:00
Ludovic Courtès 353e34a626 offload: Better report failure to create the GC root directory.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/scripts/offload.scm (register-gc-root)[script]: Replace
  'false-if-exception' with a finer-grain 'system-error handler.
  Provide the name of MACHINE in 'leave' error message.
2015-02-05 23:40:55 +01:00
Ludovic Courtès fc61b641c2 offload: Warn about SSH client issues.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/scripts/offload.scm (remote-pipe): Remove unneeded 'catch'.
  (machine-load): Check the exit value  upon (close-pipe pipe).  Call
  'warning' when it is non-zero.
2015-02-05 23:40:55 +01:00
Mark H Weaver 89328d240f Add support for 'cvs-fetch' method in origins.
* guix/cvs-download.scm, guix/build/cvs.scm: New files.
* Makefile.am (MODULES): Add them.
2015-02-04 01:51:20 -05:00
Mark H Weaver 613467abc5 Remove outdated comment from svn-fetch.
* guix/svn-download.scm (svn-fetch): Remove outdated comment.
2015-02-04 00:14:37 -05:00
David Thompson 4b7ad2e338 guix: environment: Consider all package outputs.
* guix/scripts/environment.scm (for-each-search-path): Iterate over all
  derivation output paths.
  (packages->transitive-inputs): Process inputs that specify an output, too.
2015-02-03 16:11:01 -05:00
Ludovic Courtès 01d8ac64ab store: Remove 'build-derivations'.
* guix/store.scm (build-derivations): Remove.
* guix/derivations.scm (build-derivations): Write in terms of
  'build-things'.
* doc/guix.texi (Invoking guix build): Adjust text accordingly.
2015-02-02 12:46:36 +01:00
Ludovic Courtès abac874b22 store: Add 'build-things'.
* guix/store.scm (operation-id): Rename 'build-derivations' to
  'build-things', as per Nix commit 1aba0bf0.
  (build-derivations): Rename to...
  (build-things): ... this.  Keep 'build-derivations' as an alias.
  (build): New procedure.
* tests/store.scm ("build-things with output path",
  "substitute + build-things with output path"): New tests.
2015-02-02 12:46:36 +01:00
Ludovic Courtès e6c8839c18 tests: Add 'with-derivation-substitute' and use it.
* guix/tests.scm (%substitute-directory): New variable.
  (call-with-derivation-narinfo): Use it.
  (call-with-derivation-substitute): New procedure.
  (with-derivation-substitute): New macro.
* tests/store.scm ("substitute"): Use 'with-derivation-substitute'.
  ("substitute, corrupt output hash"): Likewise.
2015-02-02 12:46:35 +01:00
Ludovic Courtès 6eebbab562 tests: Further factorize substitute mocks.
* guix/tests.scm (derivation-narinfo): Turn 'nar' into a keyword
  parameter.  Add #:sha256 parameter, and honor it.
  (call-with-derivation-narinfo): Add #:sha256 and pass it to
  'derivation-narinfo'.
  (with-derivation-narinfo): Extend with support for (sha256 => value).
* tests/store.scm ("substitute query"): Use 'with-derivation-narinfo'.
  ("substitute"): Likewise.
  ("substitute, corrupt output hash"): Likewise.
  ("substitute --fallback"): Likewise.
* tests/derivations.scm: Remove Emacs local variable.
2015-02-02 12:46:35 +01:00
Ludovic Courtès 9250b30466 ui: Update copyright year in '--version' output.
* guix/ui.scm (show-version-and-exit): Increment copyright year.
2015-01-28 21:32:58 +01:00
Ludovic Courtès 8fbf530260 lint: Fix argument parsing when several packages are specified.
* guix/scripts/lint.scm (%options) <--checkers>: Remove 'arg-handler'
  parameter, and return a single value.
  (guix-lint)[parse-options]: Remove 'arg-handler' parameter from
  handlers.  Remove second seed to 'args-fold*'.
* tests/guix-lint.sh: Add test.
2015-01-28 14:00:58 +01:00
Ludovic Courtès 3bcfe23cfc substitute-binary: Let the user know when the cache is being updated.
* guix/scripts/substitute-binary.scm (open-cache*): New macro.
  (guix-substitute-binary): Use it instead of (delay (open-cache ...)).
2015-01-26 21:58:12 +01:00
Ludovic Courtès 19a454448b hash: Initialize libgcrypt before use.
Fixes <http://bugs.gnu.org/19677>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/hash.scm: Use (guix gcrypt).
  (sha256, open-sha256-md, md-write, md-close): Use 'libgcrypt-func'
  instead of 'dynamic-func'.
2015-01-26 21:58:12 +01:00
Ludovic Courtès 4862bc4a1a Add (guix gcrypt).
* guix/gcrypt.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/pk-crypto.scm: Use it.
  (libgcrypt-func, gcrypt-version): Remove.
2015-01-26 21:58:12 +01:00
Ludovic Courtès 06aac933e1 guix lint: Make the 'source' checker happy if at least one URI is valid.
Before that it would check all the URIs of each package.

* guix/scripts/lint.scm (validate-uri): Really return #f on failure and
  #t otherwise.
  (check-source): Replace 'for-each' with 'any'.
2015-01-26 00:19:33 +01:00
Cyril Roelandt 17a7b75c0f lint: add 'source' checker.
* guix/scripts/lint.scm (validate-uri?): New procedure.
  (%checkers): Add 'source' checker
2015-01-25 18:34:51 +01:00
Ludovic Courtès f304c9c237 derivations: Raise an error for references to non-existent outputs.
Fixes <http://bugs.gnu.org/19630>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/derivations.scm (&derivation-error,
  &derivation-missing-output-error): New error conditions.
  (derivation->output-path): Raise a '&derivation-missing-output-error'
  if OUTPUT is not an output of DRV.
* guix/ui.scm (call-with-error-handling): Add case for
  'derivation-missing-output-error?'.
  (show-what-to-build): Check whether (derivation-outputs drv) is
  empty.
* tests/packages.scm ("reference to non-existent output"): Add test.
2015-01-24 22:57:49 +01:00
Ludovic Courtès ca79e42ea2 build-system/glib-or-gtk: Add MIME directories to $XDG_DATA_DIRS.
Fixes an Evince regression introduced in commit 3d243e9.

* guix/build/glib-or-gtk-build-system.scm (data-directories): Check the
  /mime sub-directory.
2015-01-23 23:49:24 +01:00
Ludovic Courtès 70e629f548 guix system: Improve error messages.
* guix/ui.scm (report-error): Export.
* guix/scripts/system.scm (read-operating-system): Report syntax errors
  using standard GNU format.  Report other errors using 'display-error'.
2015-01-22 22:43:46 +01:00
Ludovic Courtès 3698f524d5 store: Change 'run-with-store' to return a single value.
* guix/store.scm (run-with-store): Wrap 'run-with-state' in
  'call-with-values'.  Return only the first value.
2015-01-21 23:18:57 +01:00
Ludovic Courtès 1a0965045b guix package: Avoid spurious warnings from 'find-files'.
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-20 22:29:17 +01:00
Ludovic Courtès 6b1f9721a8 packages: Mark the 'patches' field as delayed.
* guix/packages.scm (<origin>)[patches]: Mark as 'delayed'.
  (print-origin, origin->derivation): Add call to 'force' when accessing
  'patches'.
2015-01-20 09:59:56 +01:00
Ludovic Courtès 310b32a2a6 records: Add support for delayed fields.
* guix/records.scm (make-syntactic-constructor): Add #:delayed
  parameter.
  [delayed-field?]: New procedure.
  [wrap-field-value]: Use it.
  (define-record-type*)[delayed-field?, wrapped-field?]: New procedures.
  [thunked-field-accessor-name]: Rename to...
  [wrapped-field-accessor-name]: ... this.
  [field-spec->srfi-9]: Change 'thunked' to 'wrapped'.
  [delayed-field-accessor-definition]: New procedure.
  Compute delayed-field accessors and emit them.  Pass #:delayed to
  'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & delayed",
  "define-record-type* & delayed & default",
  "define-record-type* & delayed & inherited"): New tests.
2015-01-19 23:30:42 +01:00
Ludovic Courtès 0db40ed289 make-syntactic-constructor kwarg default 2015-01-19 23:30:42 +01:00
Ludovic Courtès c492be654b records: Factorize value wrapping in the record constructor.
* guix/records.scm (make-syntactic-constructor)[wrap-field-value]: New
  procedure.
  [field-bindings, field-value]: Use it.
2015-01-19 23:30:42 +01:00
Ludovic Courtès cf4efb394f records: Move 'make-syntactic-constructor' to the top level.
* guix/records.scm (make-syntactic-constructor): New procedure, formerly
  nested in 'define-record-type*'.
2015-01-19 23:30:42 +01:00
Ludovic Courtès 9b543456d7 records: Use keyword parameters for 'make-syntactic-constructor'.
* guix/records.scm (define-record-type*)[make-syntactic-constructor]:
  Turn THUNKED and DEFAULTS into keyword arguments.
  Adjust caller accordingly.  Declare 'thunked' and 'defaults' local
  variables.
2015-01-19 23:30:42 +01:00
Ludovic Courtès 71c1d5280c nar: Read archive signatures as Latin-1 strings.
Fixes <http://bugs.gnu.org/19610>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/nar.scm (restore-one-item): Use 'read-latin1-string' to read the
  signature.
2015-01-18 22:19:04 +01:00
Ludovic Courtès aa27b56083 serialization: Read Latin-1 strings with 'get-bytevector-n'.
* guix/serialization.scm (read-latin1-string): Use 'get-bytevector-n'
  instead of 'get-string-n'.  Use 'list->string' etc. to convert the
  bytevector to a string.
2015-01-18 22:17:09 +01:00
Ludovic Courtès 5808dcc27c store: Change 'store-lower' to preserve the original procedure's documentation.
* guix/store.scm (preserve-documentation): New procedure.
  (store-lift, store-lower): Use it.
2015-01-18 17:38:15 +01:00
Ludovic Courtès 561fb6c31f doc: Document '%state-monad' and update '%store-monad' description.
* doc/guix.texi (The Store Monad): Document '%state-monad' and related
  procedures.  Describe '%store-monad' as an alias for '%state-monad'.
* guix/monads.scm: Update commentary.
2015-01-17 23:45:48 +01:00
Ludovic Courtès 4e190c2803 store: Make '%store-monad' an alias for '%state-monad'.
* guix/store.scm (define-alias): New macro.
  (%store-monad, store-return, store-bind): Define as aliases of the
  corresponding %STATE-MONAD part.
  (store-lift, text-file, interned-file): Return STORE as a second
  value.
  (run-with-store): Use 'run-with-state'.
* guix/packages.scm (set-guile-for-build, package-file): Return STORE as
  a second value.
* guix/monads.scm: Remove part of the module commentary.
2015-01-17 23:45:48 +01:00
Ludovic Courtès 81a97734e0 monads: Add the state monad.
* guix/monads.scm (state-return, state-bind, run-with-state,
  current-state, set-current-state, state-push, state-pop): New
  procedures.
  (%state-monad): New variable.
* tests/monads.scm (%monads): Add %STATE-MONAD.
  (%monad-run): Add 'run-with-state'.
  (values->list): New macro.
  ("set-current-state", "state-push etc."): New tests.
2015-01-17 23:45:48 +01:00
Ludovic Courtès 5660708895 guix archive: Add -r/--recursive.
* guix/scripts/archive.scm (show-help, %options): Add -r/--recursive.
  (export-from-store): Pass #:recursive? to 'export-paths'.
* doc/guix.texi (Invoking guix archive): Add -r in Emacs example.  Add
  example with ~/.guix-profile.  Document -r/--recursive.
2015-01-17 17:05:54 +01:00
Ludovic Courtès 9decb18c0b guix archive: Remove unused -r/--root option.
* guix/scripts/archive.scm (%options): Remove -r/--root.
2015-01-17 16:52:49 +01:00
Ludovic Courtès 1d50699354 store: Remove unused variable.
* guix/store.scm (export-paths): Remove unused variable 's'.
2015-01-17 16:03:35 +01:00
Ludovic Courtès 5b3d863f00 store: Add #:recursive? parameter to 'export-paths'.
* guix/store.scm (export-paths): Add #:recursive? parameter and honor
  it.
* tests/store.scm ("export/import incomplete", "export/import
  recursive"): New tests.
2015-01-17 15:59:00 +01:00
Ludovic Courtès 57b7e1a62d Merge branch 'core-updates'
Conflicts:
	gnu/packages/bootstrap.scm
2015-01-16 13:27:03 +01:00
Ludovic Courtès f220a83848 packages: Convert source derivations to monadic style.
* guix/packages.scm (origin->derivation): Take body from
  'package-source-derivation', and change it to monadic style.  Expect
  METHOD to a monadic procedure.
  (package-source-derivation): Define in terms of 'origin->derivation'.
* guix/download.scm (url-fetch): Remove 'store' argument.  Remove
  'guile-for-build' variable.  Turn into a monadic procedure.
* guix/git-download.scm (git-fetch): Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (url-fetch*): New procedure.
  Change tests to call 'url-fetch*' instead of 'url-fetch'.
* tests/packages.scm ("package-source-derivation, snippet"): Remove
  'store' parameter of 'fetch' and change it to use 'interned-file'
  instead of 'add-to-store'.
* gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store'
  parameter.
2015-01-14 14:42:10 +01:00
Ludovic Courtès 023d9892c0 store: Add 'store-lower'.
* guix/store.scm (store-lower): New procedure.
* tests/store.scm ("store-lower"): New test.
2015-01-14 14:25:58 +01:00
Ludovic Courtès e87f0591f3 monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.

* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file, package-file, package->derivation,
  package->cross-derivation, origin->derivation, imported-modules,
  compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file): ... here.
  (%guile-for-build): New variable.
  (run-with-store): Moved from monads.scm.  Remove default value for
  #:guile-for-build.
* guix/packages.scm (default-guile): Export.
  (set-guile-for-build): New procedure.
  (package-file, package->derivation, package->cross-derivation,
  origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
  (imported-modules): Rename to...
  (%imported-modules): ... this.
  (compiled-modules): Rename to...
  (%compiled-modules): ... this.
  (built-derivations, imported-modules, compiled-modules): New
  procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
  gnu/services/dmd.scm, gnu/services/networking.scm,
  gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
  gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
  guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
  guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
  (store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
  'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 13:34:52 +01:00
Mark H Weaver a813710a5f Merge branch 'master' into core-updates 2015-01-13 12:14:08 -05:00
Federico Beffa f5895dab8a build/glib-or-gtk-build-system: Fix 'generate-icon-cache'.
Reported by Mark H Weaver <mhw@netris.org>

* guix/build/glib-or-gtk-build-system.scm (generate-icon-cache): Add check for
  existence of icons directory.
2015-01-13 09:16:47 +01:00
Ludovic Courtès abebac4601 monads: Remove 'derivation-expression'.
* guix/monads.scm (lower-inputs, derivation-expression): Remove.
* tests/monads.scm (derivation-expression, "mlet* +
  derivation-expression"): Remove.
2015-01-12 23:33:08 +01:00
Ludovic Courtès 462a3fa36c monads: Rewrite 'text-file*' using gexps.
* guix/monads.scm (text-file*): Move to...
* guix/gexp.scm (text-file*): ... here.  Rewrite using gexps.
* tests/monads.scm ("text-file*"): Move to...
* tests/gexp.scm ("text-file*"): ... here.
2015-01-12 23:33:08 +01:00
Federico Beffa 61771a79ab guix: build/glib-or-gtk-build-system: Add support for GIO and XDG theming.
* guix/build/glib-or-gtk-build-system.scm (data-directories): Rename
  'schemas-directories' to 'data-directories' and add support for XDG theming
  data.

* guix/build/glib-or-gtk-build-system.scm (gio-module-directories): New
  function.

* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Update names to
  reflect that we are dealing with more types of data and not only with
  schemas.  Add handling of GIO modules.

* guix/build-system/glib-or-gtk.scm (lower): Import the 'bin' output of GLib
  instead of 'out'.  This was an error since we need the program
  'glib-compile-schemas'.  Update the description.
2015-01-12 18:00:08 +01:00
Ludovic Courtès c06d140c03 derivations: Use a set for 'substitution-oracle'.
* guix/derivations.scm (substitution-oracle): Use sets instead of lists.
2015-01-11 23:50:01 +01:00
Ludovic Courtès ed3592a980 derivations: Use sets for 'derivations-prerequisites'.
This yields a 46% improvement in 'derivation-prerequisites' invocations
on the Emacs derivation.

* guix/derivations.scm (derivation-prerequisites): Add 'input-set'
  variable, and use it in iterations.
2015-01-11 23:50:01 +01:00
Ludovic Courtès d326767e64 Add (guix sets).
* guix/sets.scm, tests/sets.scm: New files.sets
* Makefile.am (MODULES, SCM_TESTS): Add them.
2015-01-11 23:50:01 +01:00
Mark H Weaver 7744885731 Merge branch 'master' into core-updates 2015-01-11 09:38:49 -05:00
Ludovic Courtès e9651e39b3 derivations: Add 'substitution-oracle' and use it.
This makes 'guix environment PACKAGE' significantly faster when
substitutes are enabled.  Before that, it would lead to many invocations
of 'guix substitute-binary', one per 'derivation-prerequisites-to-build'
call.  Now, all these are replaced by a single invocation.

* guix/derivations.scm (derivation-output-paths, substitution-oracle):
  New procedures.
  (derivation-prerequisites-to-build): Replace #:use-substitutes? with
  #:substitutable?.  Remove the local 'derivation-output-paths' and
  'substitutable?'.
* guix/ui.scm (show-what-to-build): Add 'substitutable?'.  Pass it to
  'derivation-prerequisites-to-build'.
  [built-or-substitutable?]: Use it instead of 'has-substitutes?'.
* tests/derivations.scm ("derivation-prerequisites-to-build and
  substitutes"): Use #:substitutable? instead of #:use-substitutes?.
2015-01-10 00:39:59 +01:00
Ludovic Courtès 0b6af195fe derivations: Add 'derivation-output-names'.
* guix/derivations.scm (derivation-output-names): New procedure.
  (derivation-prerequisites-to-build): Use it for #:outputs.
  (map-derivation): Likewise.
* tests/derivations.scm ("derivation-output-names"): New test.
2015-01-09 23:36:24 +01:00
Ludovic Courtès 4eb01e5442 build-system/gnu: Patch /usr/bin/file in all 'configure' files.
* guix/build/utils.scm (patch-/usr/bin/file): New procedure.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using
  it.  Patch all the files returned by 'find-files' that are executable.
* gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*'
  for 'extension/configure'.
2015-01-09 23:29:20 +01:00
Eric Bavier d45dc6da5c import: Add CPAN importer.
* guix/import/cpan.scm, guix/scripts/import/cpan.scm, tests/cpan.scm:
  New files.
* Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add them.
* guix/scripts/import.scm (importers): Add cpan.
* doc/guix.texi (Requirements): Mention `guix import cpan` as a user
  of guile-json.
  (Invoking guix import): Document new `guix import cpan` command.
2015-01-09 10:38:26 -06:00
Eric Bavier 694b317c2d tests: import: Factorize utility function.
* tests/pypi.scm (mock): Move this...
* guix/tests.scm: to here.
2015-01-09 10:38:25 -06:00
Eric Bavier 1ff2619bc1 import: Factorize utility functions.
* guix/import/pypi.scm (hash-table->alist, flatten, assoc-ref*,
  url-fetch, json-fetch): Pull procedures from here into...
* guix/import/utils.scm: Here and...
* guix/import/json.scm: Here.  New file.
* Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add it.
* guix/import/gnu.scm (file-sha256): Move from here to...
* guix/hash.scm: Here.
* tests/pypi.scm (pypi->guix-package): Update mock module reference.
2015-01-09 10:33:24 -06:00
Eric Bavier c6cb82f5d5 import: gnu: Propagate the key-download argument.
* guix/import/gnu.scm (gnu->guix-package): Pass the key-download
  argument on to gnu-package->sexp.
2015-01-09 10:33:24 -06:00
Ludovic Courtès 8234fcf21a substitute-binary: Micro-optimize 'narinfo-sha256'.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Change "~a" to "~s" in error message.
  (%signature-line-rx): Remove.
  (narinfo-sha256): Use 'string-contains' instead of 'regexp-exec', and
  'string-take' instead of 'match:substring'.
2015-01-09 01:10:31 +01:00
Ludovic Courtès fb519bd831 records: Optimize 'recutils->alist' by avoiding regexps.
* guix/records.scm (%recutils-field-rx, %recutils-comment-rx,
  %recutils-plus-rx): Remove.
  (%recutils-field-charset): New variable.
  (recutils->alist): Adjust to use tests (string-ref line 0) instead of
  regexps.
2015-01-09 01:08:10 +01:00
Ludovic Courtès b2ad9d9b08 base64: Inline arithmetic operations.
* guix/base64.scm (define-alias): New macro.
  (fxbit-field, fxarithmetic-shift, fxarithmetic-shift-left, fxand,
  fxior, fxxor): New aliases.
2015-01-09 01:01:04 +01:00
Mark H Weaver 3f00ff8b43 gnu: Add toolchain support for 'armhf-linux'.
Based on preliminary work by John Darrington <john@darrington.wattle.id.au>.

* gnu/packages/cross-base.scm (xgcc-armhf): New variable.
* gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add armhf case.
  (gcc-4.7)[pre-configure]: Add gcc/config/*/linux-eabi.h to the list
  of files in which to patch GLIBC_DYNAMIC_LINKER.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add armhf case.
* guix/utils.scm (gnu-triplet->nix-system, nix-system->gnu-triplet):
  Add armhf cases.
2015-01-07 16:27:55 -05:00
Mark H Weaver 8eb8048432 Move 'nix-system->gnu-triplet' to (guix utils) and export it.
* gnu/packages/commencement.scm (nix-system->gnu-triplet): Move to...
* guix/utils.scm (nix-system->gnu-triplet): ... here.  Fix docstring typo.
2015-01-07 12:34:10 -05:00
Mark H Weaver 23800e4736 Merge branch 'master' into core-updates 2015-01-06 12:57:15 -05:00