Commit Graph

921 Commits (ae9cb418dfe864d8b4383770662fc79484244240)

Author SHA1 Message Date
Andreas Enge 1d1f939798 guix: python: Add parameter #:phases to build system.
* guix/build-system/python.scm (python-build): Use parameter #:phases.
2013-09-10 11:58:02 +02:00
Andreas Enge 11bb85a10d guix: python: Add package-with-python2, a procedure rewriting a package
to compile with Python 2 instead of the default Python 3.

* guix/build-system/python.scm (default-python2, package-with-explicit-python,
    package-with-python2): New procedures.
* guix/build-system/python.scm (python2-pytz, python2-babel): Use
    package-with-python2.
2013-09-08 16:57:37 +02:00
Andreas Enge b191f88ee3 guix: python: Add build phase and factor out calls to setup.py.
* guix/build/python-build-system.scm (call-setuppy): New procedure.
* guix/build/python-build-system.scm (build): New procedure.
* guix/build/python-build-system.scm (check, install): Use call-setuppy.
* guix/build/python-build-system.scm (%standard-phases): Add call to build.
2013-09-05 20:25:08 +02:00
Andreas Enge 7b96bf82da gnu: python: Honour #:tests? and #:test-target in build system.
* guix/build/python-build-system.scm (check): Use named parameters tests?
    and test-target (default now: "test" instead of "check").
2013-09-05 18:43:18 +02:00
Ludovic Courtès 29804e6eb2 gnu: linux-initrd: Fix creation of /dev/tty nodes.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/tty.  Change from 'block-special' to 'char-special' for /dev/tty*
  nodes.
2013-09-05 00:46:09 +02:00
Andreas Enge 3df47231e6 guix: python: Switch to python-wrapper as the default version for the python
build system (switches to Python 3) and compute python-version instead of
  passing it as a parameter.

* guix/build-system/python.scm (default-python): Switch to python-wrapper.
* guix/build-system/python.scm (python-build): Drop parameter #:python-version.
* guix/build/python-build-system.scm (wrap): Compute python version from input.
2013-09-04 18:07:55 +02:00
Ludovic Courtès bda44eed93 pull: Compile files in the lexicographic order.
* guix/scripts/pull.scm (unpack): Print the name of the file being
  compiled.  Sort the names of files to compile.
2013-09-03 10:48:52 +02:00
Ludovic Courtès 8badfc5558 build-system/cmake: Fix typo.
* guix/build-system/cmake.scm (default-cmake): Add missing quote.
2013-09-03 10:20:59 +02:00
Ludovic Courtès 0a2873e515 build-system/gnu: Delay resolution of (@ (gnu packages cmake) cmake).
* guix/build-system/cmake.scm (default-cmake): New procedure.
  (cmake-build): Use it.
2013-09-03 10:18:38 +02:00
Ludovic Courtès 00554b2a0f substitute-binary: Show the Nar size, when available.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--substitute"]:
  Show the Nar size, when available.
* guix/ui.scm (show-what-to-build): Add 'TODO'.
2013-09-02 23:33:13 +02:00
Ludovic Courtès 43dd92024a union: Don't traverse sub-directories only found in one element of the union.
This significantly reduces I/O when building profiles, especially with
lots of package-specific sub-directories (such as 'share/emacs/24.3',
'texmf', etc.)

* guix/build/union.scm (union-build)[file-tree](others-have-it?): New
  procedure.  Use it in the 'enter?' parameter of 'file-system-fold';
  change 'skip' parameter accordingly.
* tests/union.scm ("union-build"): Ensure that 'include' is a symlink
  and 'bin' is a directory.
2013-09-02 23:04:25 +02:00
Ludovic Courtès bf8e7fc502 store: Add a printer for <nix-server>.
* guix/store.scm (<nix-server>): Set a printer.
2013-09-02 00:20:14 +02:00
Ludovic Courtès d91712ee89 gnu: linux-initrd: Factorize device node creation.
* guix/build/linux-initrd.scm (make-essential-device-nodes): New
  procedure.
* gnu/packages/linux-initrd.scm (qemu-initrd): Use it.
2013-09-02 00:20:14 +02:00
Ludovic Courtès 89bf140b10 gnu: linux-initrd: Make Guile modules accessible in the chroot.
* gnu/packages/linux-initrd.scm (qemu-initrd): Add (guix build utils) to
  #:modules, and use it.  Copy .scm and .go files to /root.
* guix/build/linux-initrd.scm (bind-mount): New procedure.
2013-08-31 23:02:18 +02:00
Ludovic Courtès 88840f0246 gnu: linux-initrd: Add (guix build linux-initrd) and use it.
* gnu/packages/linux-initrd.scm (qemu-initrd): Add #:modules argument.
  Factorize and move some of the code to...
* guix/build/linux-initrd.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
2013-08-29 00:05:03 +02:00
Ludovic Courtès f989fa392f gnu: linux-initrd: Allow Guile modules to be embedded in the initrd.
* gnu/packages/linux-initrd.scm (raw-build-system): New macro.
  (module-package, compiled-module-package): New procedures.
  (expression->initrd): Add `modules' keyword parameter.
  Add "modules" and "modules/compiled" inputs; copy them onto the
  initrd.
* guix/derivations.scm (imported-modules, compiled-modules): Publicize.
2013-08-29 00:05:03 +02:00
Ludovic Courtès 858e92823f derivations: Rename #:dependency-graphs to #:references-graphs.
* guix/derivations.scm (derivation, build-expression->derivation):
  Rename #:dependency-graphs to #:references-graphs, for consistency in
  the terminology.
* tests/derivations.scm: Adjust accordingly.
2013-08-28 00:55:40 +02:00
Ludovic Courtès 9c629a27a4 derivations: Add #:dependency-graphs to `build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Add
  #:dependency-graphs keyword argument.  Pass it to `derivation'.
* tests/derivations.scm ("build-expression->derivation with
  #:dependency-graphs"): New test.
* doc/guix.texi (Derivations): Update `build-expression->derivation'
  description.
2013-08-26 22:20:58 +02:00
Ludovic Courtès 5b0c9d1635 derivations: Add #:dependency-graphs `derivation' parameter.
* guix/derivations.scm (derivation): Add `dependency-graphs' keyword
  parameter; honor it.
* tests/derivations.scm (bootstrap-binary): New procedure.
  (%bash): Use it.
  (%mkdir): New variable.
  (directory-contents): Add `slurp' optional parameter.
  ("derivation with #:dependency-graphs"): New test.
* doc/guix.texi (Derivations): Update accordingly.
2013-08-26 22:20:53 +02:00
Ludovic Courtès a987d2c025 derivations: Move 3 positional parameters into keyword parameters.
* guix/derivations.scm (derivation): Turn `system', `env-vars', and
  `inputs' into keyword parameters.
  (build-expression->derivation): Adjust accordingly.
* gnu/packages/bootstrap.scm (%bootstrap-guile): Likewise.
* tests/derivations.scm, tests/store.scm: Likewise.
* doc/guix.texi (Derivations): Likewise.
2013-08-26 22:20:27 +02:00
Ludovic Courtès 5d9cd70721 download: Add kernel.org mirrors.
Fixes <http://bugs.gnu.org/15182>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/download.scm (%mirrors)[kernel.org]: Add ftp.be.debian.org and
  mirror.linux.org.au.
2013-08-25 20:49:03 +02:00
Ludovic Courtès fe12c3458c build-system/gnu: Add `dist-package'.
* guix/build/gnu-dist.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/gnu.scm (%default-modules): New variable.
  (gnu-build): Use it.
  (dist-package): New procedure.
2013-08-24 17:30:31 +02:00
Ludovic Courtès 7357138bba packages: Allow file names as package sources.
* guix/packages.scm (package-source-derivation): Add cases for SOURCE as
  a store path or user file.
* tests/packages.scm ("package-source-derivation, file",
  "package-source-derivation, store path"): New tests.
2013-08-24 17:30:31 +02:00
Ludovic Courtès 7db3ff4a29 utils: Add `guile-version>?', and use it.
This fixes Guile version comparisons when (version) has a
vendor-specific suffix.

Reported by Andreas Enge <andreas@enge.fr>.

* guix/utils.scm (guile-version>?): New procedure.
* tests/utils.scm ("guile-version>? 1.8", "guile-version>? 10.5"): New
  tests.
* guix/scripts/substitute-binary.scm (fetch, progress-report-port): Use
  `guile-version>?' instead of `version>?'.
* guix/http-client.scm (when-guile<=2.0.5, http-fetch): Likewise.
2013-08-23 15:51:36 +02:00
Ludovic Courtès b6952cad8d substitute-binary: Try hard to avoid port buffering.
* guix/scripts/substitute-binary.scm (fetch): In the `file' case, open
  with the `b' flag, so that the coding cookie reading thing doesn't
  lead to buffering some of the data (on 2.0.5).
* tests/utils.scm ("filtered-port, file"): Open with `r0b'.  Fixes a
  test failure with Guile 2.0.5 whereby the first byte of FILE would be
  missing from DECOMPRESSED.
2013-08-22 17:14:20 +02:00
Ludovic Courtès db90b40dfd substitute-binary: Don't pretend to report download progress on Guile 2.0.5.
* guix/scripts/substitute-binary.scm (progress-report-port): On Guile
  2.0.5, return PORT directly and emit a warning.
2013-08-21 02:19:36 +02:00
Cyril Roelandt e12b3eb93e Make "guix -h" work as "guix --help".
* guix/ui.scm (guix-main): have the same behaviour for the "-h" and "--help"
  options.
2013-08-15 21:03:32 +02:00
Ludovic Courtès 079d127391 guix package: Allow separate install of several outputs of the same package.
* guix/scripts/package.scm (guix-package)[process-actions](same-package?):
  New procedure.  Use it instead of `alist-delete' when filtering out
  duplicate packages from the profile.
2013-07-15 23:51:28 +02:00
Ludovic Courtès 3b8258c569 Rename (guix web) to (guix http-client).
* guix/web.scm: Rename to...
* guix/http-client.scm: ... this.
* guix/gnu-maintenance.scm, guix/scripts/substitute-binary.scm,
  Makefile.am, po/POTFILES.in: Update accordingly.
2013-07-14 16:44:15 +02:00
Ludovic Courtès 2096b516e0 guix package: Fix handling of `-e'.
This fixes a bug whereby a command like

  guix package -e '(@@ (gnu packages base) gnu-make-boot0)'

would only succeed when the outputs of that package are available, and
otherwise fail with "/nix/store/... is not valid".

* guix/scripts/package.scm (guix-package)[process-action](package->tuple):
  Leave P as is in the result.  Move `package->tuple' call from INSTALL*
  to INSTALL.
2013-07-12 23:27:35 +02:00
Ludovic Courtès e14c39291b ui: Ignore SIGPIPE and catch `system-error' exceptions.
* guix/ui.scm (initialize-guix): Call `sigaction'.
  (call-with-error-handling): Wrap `thunk' in a (catch 'system-error ...).
2013-07-12 23:01:18 +02:00
Ludovic Courtès e3ccdf9e96 guix package: Reuse FTP connections for subsequent `latest-release' calls.
* guix/gnu-maintenance.scm (latest-release): Add `ftp-close' and
  `ftp-open' keyword parameters.
* guix/scripts/package.scm (ftp-open*): New variable.
  (check-package-freshness): Call `latest-release' with `ftp-open*' and
  a no-op procedure.
2013-07-12 22:59:33 +02:00
Ludovic Courtès 1f495e04c1 gnu-maintenance: `latest-release' closes its connection.
* guix/gnu-maintenance.scm (latest-release): Close CONN before
  returning.
2013-07-12 22:26:24 +02:00
Ludovic Courtès ce689ccf18 substitute-binary: Directly replace the global `regexp-exec'.
* guix/scripts/substitute-binary.scm (%regexp-exec-mutex, string->uri):
  Remove.
  (regexp-exec): Replace this global binding by a thread-safety wrapper.
  (fields->alist): Remove `with-mutex', and directly alias `recutils->alist'.
2013-07-11 22:42:41 +02:00
Ludovic Courtès 8b79e2e641 substitute-binary: Increase the default timeout.
* guix/scripts/substitute-binary.scm (%fetch-timeout): Set to 5 seconds.
2013-07-11 22:22:22 +02:00
Ludovic Courtès 560d4787f4 guix refresh: Keep only the newest versions of packages as upgrade candidates.
* guix/scripts/refresh.scm (guix-refresh)[keep-newest]: New procedure.
  Use it to keep only once copy of each package.
2013-07-11 19:56:30 +02:00
Ludovic Courtès c4ca9411f9 gnu-maintenance: Add `doc-description' field to <gnu-package-descriptor>.
* guix/gnu-maintenance.scm (%gsrc-package-list-url): New variable.
  (<gnu-package-descriptor>): Add `doc-description' field.
  (official-gnu-packages)[group-package-fields]: Rename to...
  [read-records]: ... this.  Reverse the result.
  [gsrc-description]: New procedure.
  Add the "description" field to the alist passed to `alist->record'.
2013-07-10 22:34:03 +02:00
Ludovic Courtès 836d10f154 records: `recutils->alist' recognizes lines starting with a `+'.
* guix/records.scm (%recutils-plus-rx): New variable.
  (recutils->alist): Use it to read + lines.
* tests/records.scm ("recutils->alist with + lines"): New test.
2013-07-10 21:53:29 +02:00
Ludovic Courtès b0efe83a8f gnu-maintenance: Use `recutils->alist'.
* guix/gnu-maintenance.scm (official-gnu-packages)[group-package-fields]:
  Rewrite in terms of `recutils->alist'.  Remove `state' parameter.
  Specify "doc-url" and "language" as multiple-value keys in the
  `alist->record' call.
2013-07-10 21:52:55 +02:00
Ludovic Courtès c8772a7a21 records: `alist->record' supports multiple-field occurrences.
* guix/records.scm (alist->record): Add `multiple-value-keys'
  parameter.  Update docstring, and honor it.
* tests/records.scm ("alist->record"): New record.
2013-07-10 21:52:51 +02:00
Ludovic Courtès b7b8828801 records: `recutils->alist' recognizes comments.
* guix/records.scm (%recutils-comment-rx): New variable.
  (recutils->alist): Match comments.
* tests/records.scm ("recutils->alist"): Add comments.
2013-07-10 18:01:12 +02:00
Ludovic Courtès fdc1bf659d records: Add `recutils->alist' for public consumption.
* guix/records.scm (%recutils-field-rx): New variable.
  (recutils->alist): New procedure, formerly known as `fields->alist'.
* guix/scripts/substitute-binary.scm (fields->alist): Use it.
* tests/records.scm ("recutils->alist"): New test.
2013-07-10 17:01:08 +02:00
Ludovic Courtès c769406010 Merge branch 'core-updates' 2013-07-09 22:17:18 +02:00
Ludovic Courtès 8c95b27ce6 store: Deal with unsupported `setsockopt' operation on GNU/Hurd.
* guix/store.scm (open-connection): Silently ignore ENOPROTOOPT on
  `setsockopt' calls, for the sake of GNU/Hurd.
  Reported by Matthew Lien <bluet@bluet.org> at
  <http://lists.gnu.org/archive/html/bug-guix/2013-07/msg00020.html>.
2013-07-04 22:49:00 +02:00
Ludovic Courtès 82f9b17687 build-system/gnu: Remove the "debug" output when `strip-binaries?' is #f.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Delete "debug"
  from OUTPUTS when STRIP-BINARIES? is false.
* gnu/packages/cross-base.scm (cross-libc): Leave `outputs' unchanged.
  This reverts commit a4627d4.
2013-07-04 13:26:35 +02:00
Ludovic Courtès be58d01a7e build-system/gnu: Write debug files to the "debug" sub-derivation, if any.
* guix/build/gnu-build-system.scm (strip): Add `objcopy-command' keyword
  parameter.
  [debug-output, debug-file-extension]: New variables.
  [debug-file, make-debug-file, add-debug-link]: New procedures.
  [strip-dir]: Use them.
2013-07-03 23:53:31 +02:00
Ludovic Courtès d475b25953 utils: Re-export `alist-cons' and `alist-delete'.
* guix/build/utils.scm: Re-export `alist-cons' and `alist-delete'.
2013-07-03 23:08:41 +02:00
Ludovic Courtès b0fad8a2d4 Use `port-sha256' and `open-sha256-port'.
* guix/derivations.scm (derivation-hash): Add comment as to why we keep
  the plain `sha256' call.
* guix/scripts/download.scm (guix-download): Use `port-sha256' instead
  of (compose sha256 get-bytevector-all).
* guix/scripts/refresh.scm (update-package): Likewise.
2013-07-03 01:18:24 +02:00
Ludovic Courtès 69927e78de hash: Add `open-sha256-port'.
* guix/hash.scm (GCRY_MD_SHA256): New macro.
  (sha256): Use it.
  (open-sha256-md, md-write, md-read, md-close, open-sha256-port,
  port-sha256): New procedures.
* tests/hash.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2013-07-02 22:38:03 +02:00
Ludovic Courtès 72626a71a9 Move `sha256' to (guix hash).
* guix/utils.scm (sha256): Move to...
* guix/hash.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/derivations.scm, guix/scripts/download.scm,
  guix/scripts/hash.scm, guix/scripts/refresh.scm, tests/base32.scm,
  tests/derivations.scm, tests/store.scm: Use (guix hash).
2013-07-01 23:28:21 +02:00
Ludovic Courtès 1a8b783470 ui: Don't make substituter-related RPCs at all when substitutes are disabled.
Reported by Nikita Karetnikov and Cyril Roelandt.

* guix/ui.scm (show-what-to-build): Call `substitutable-path-info'
  only when USE-SUBSTITUTES? is true.
2013-07-01 00:30:44 +02:00
Ludovic Courtès bb7dcaea57 substitute-binary: Avoid dangling connections to the server.
* guix/web.scm (open-socket-for-uri): New procedure.
  (http-fetch): Add `port' keyword parameter; use it.
* guix/scripts/substitute-binary.scm (%random-state): New variable.
  (with-timeout): Wait a little before retrying.
  (fetch): Use `open-socket-for-uri', and keep a copy of the socket in
  variable `port'.  Close PORT upon timeout.
2013-06-29 22:20:25 +02:00
Ludovic Courtès 3bba7b0a8f download: Add Savannah's master site.
* guix/download.scm (%mirrors): Add the "-noredirect" version of
  Savannah.
2013-06-27 22:36:23 +02:00
Ludovic Courtès a3cff41dd1 build-system/gnu: `package-with-explicit-inputs' skips non-GBS packages.
* guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]:
  Leave P unchanged if its build system is not GNU-BUILD-SYSTEM.
2013-06-25 23:04:32 +02:00
Ludovic Courtès 7e873a6708 build-system/gnu: Augment `package-with-explicit-inputs' for cross builds.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Add
  `native-inputs' keyword parameter.  Allow INPUTS and NATIVE-INPUTS to
  be thunks.
2013-06-25 20:54:56 +02:00
Ludovic Courtès ac5c1cec86 build-system/trivial: Don't bind `%target' in the builder.
* guix/build-system/trivial.scm (trivial-cross-build): Don't bind
  `%target' here since this causes problem when BUILDER
  contains (use-modules ...) clauses, and can be achieved differently
  anyway.
2013-06-25 00:06:31 +02:00
Ludovic Courtès f7c3429073 build-system/gnu: Disable test suite when cross building.
* guix/build-system/gnu.scm (gnu-cross-build): Change #:tests? to
  default to #f.
2013-06-24 23:26:50 +02:00
Ludovic Courtès b15669f37d utils: `set-path-environment-variable' calls `unsetenv' for empty values.
* guix/build/utils.scm (set-path-environment-variable): When VALUE is
  the empty string, call `unsetenv' instead of `setenv'.
* gnu/packages/guile.scm (guile-2.0)[arguments]: Remove `unsetenv'
  trick.
2013-06-22 16:42:46 +02:00
Ludovic Courtès 2f41f51c40 build-system/gnu: Set #:tests? to #f when cross-compiling.
* guix/build/gnu-build-system.scm (check): Add `target' formal
  parameter.  Change `tests?' to default to (not target).
2013-06-22 16:15:23 +02:00
Ludovic Courtès 91a7fde456 download: Don't fail when abbreviating `file://' URIs.
* guix/build/download.scm (uri-abbreviation)[elide-path]: Handle the
  case where URI has no `host' part.
2013-06-22 16:10:25 +02:00
Ludovic Courtès 4ca968eb95 build-system/gnu: Save `environment-variables' after each phase.
* guix/build/gnu-build-system.scm (set-paths): Move `system' call to...
  (gnu-build): ... here.
2013-06-21 00:32:07 +02:00
Ludovic Courtès 56c092ce94 build-system/gnu: Unify with (guix build-system gnu-cross-build).
* guix/build/gnu-build-system.scm (set-paths): Add `native-inputs' and
  `native-search-paths' keyword parameters.  Honor them.
  (configure): Add `target' and `native-inputs' keyword parameters.
  Look for Bash in NATIVE-INPUTS or INPUTS.  Pass `--host' when TARGET
  is true.
  (strip): Add `strip-command' keyword parameter.  Use it.
* guix/build/gnu-cross-build.scm: Remove.
* Makefile.am (MODULES): Adjust accordingly.
* gnu/packages/acl.scm, gnu/packages/attr.scm, gnu/packages/base.scm,
  gnu/packages/bash.scm, gnu/packages/gawk.scm,
  gnu/packages/gettext.scm, gnu/packages/guile.scm,
  gnu/packages/libffi.scm, gnu/packages/libsigsegv.scm,
  gnu/packages/linux.scm, gnu/packages/ncurses.scm,
  gnu/packages/readline.scm, guix/build-system/gnu.scm: Replace
  `%standard-cross-phases' by `%standard-phases'.  Remove references
  to (guix build gnu-cross-build).
2013-06-21 00:25:54 +02:00
Ludovic Courtès fe1818e26a package: Fix i18n of the number of packages message.
* guix/scripts/package.scm (guix-package)[process-actions]: Use `N_' for
  i18n of the number of packages message.
2013-06-20 23:41:31 +02:00
Ludovic Courtès a85060efec substitute-binary: Report progress while downloading.
* guix/scripts/substitute-binary.scm (decompressed-port): Improve docstring.
  (progress-report-port): New procedure.
  (guix-substitute-binary)["--substitute"]: Use it to report progress.
* guix/build/download.scm: Export `progress-proc' and `uri-abbreviation'.
2013-06-20 23:41:28 +02:00
Ludovic Courtès 9af05aa29d package: Display the number of installed packages upon completion.
* guix/scripts/package.scm (guix-package)[process-actions]: Display the
  number of packages in the profile upon completion.
2013-06-19 22:42:03 +02:00
Ludovic Courtès 7fa37abca0 gnu: Add ImageMagick.
* gnu/packages/imagemagick.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/download.scm (%mirrors): Add `imagemagick' entry.
2013-06-19 19:27:23 +02:00
Ludovic Courtès 2207f73156 substitute-binary: Provide feedback when the server is unresponsive.
* guix/scripts/substitute-binary.scm (%fetch-timeout): New variable.
  (with-timeout): New macro.
  (fetch): Add `timeout?' keyword parameter.  Enclose `http-fetch' call
  in `with-timeout'.
  (guix-substitute-binary): Call `fetch' with #:timeout? #f.
2013-06-18 00:12:22 +02:00
Ludovic Courtès 9c71a2aec4 build-system/trivial: Fix introduction of `%target' when cross-building.
* guix/build-system/trivial.scm (trivial-cross-build): Wrap BUILDER in a
  `let' rather than in `begin'.
2013-06-15 23:39:32 +02:00
Ludovic Courtès 0bd31a2188 derivations: Micro-optimize `derivation-hash'.
* guix/derivations.scm (derivation-hash): Use a UTF-8-encoded string
  output port.  This makes things deterministic, and slightly faster.
2013-06-14 15:48:29 +02:00
Ludovic Courtès 8e59fdd53b guix gc: Add `--requisites'.
* guix/scripts/gc.scm (show-help, %options): Add `--requisites'.
  (guix-gc): Handle it.
* doc/guix.texi (Invoking guix gc): Document `--requisites'.
* NEWS: Update.
2013-06-13 22:15:41 +02:00
Ludovic Courtès 3f1e69395c store: Add `requisites'.
* guix/store.scm (fold-path, requisites): New procedures.
* tests/store.scm ("requisites"): New test.
2013-06-13 22:03:42 +02:00
Cyril Roelandt 16df248e4b Fix Guile version checking in the "web" code.
* guix/web.scm (http-fetch): fix Guile version checking. The previous version
would use features from Guile 2.0.9+ when using Guile 2.0.7.
2013-06-10 10:43:23 +02:00
Nikita Karetnikov 392b5d8cab guix refresh: Add '--key-download'.
* guix/gnu-maintenance.scm (download-tarball): Add a 'key-download'
  keyword argument and pass it to 'gnupg-verify*'.  Make
  'archive-type' a keyword argument.
  (package-update): Add a 'key-download' keyword argument.  Pass
  'archive-type' and 'key-download' keyword arguments to
  'download-tarball'.

* guix/gnupg.scm: Import (ice-9 i18n) and (guix ui).
  (gnupg-verify*): Add a 'key-download' keyword argument and adjust
  'gnupg-verify*' to use it.  Make 'server' a keyword argument.

* guix/scripts/refresh.scm (show-help, %options): Add and document
  '--key-download'.
  (update-package): Add a 'key-download' keyword argument and pass it
  to 'package-update'.
  (guix-refresh): Pass 'key-download' to 'update-package'.  Limit
  lines to a maximum of 79 characters.
2013-06-10 08:15:17 +00:00
Ludovic Courtès 9d97a1b3d6 packages: Make the `propagated-inputs' field thunked.
* guix/packages.scm (<package>): Make `propagated-inputs' thunked.
2013-06-06 00:04:11 +02:00
Ludovic Courtès a3e69bb892 gnu: Fix `static-package' arguments overriding.
* guix/build-system/gnu.scm (static-package): Call `package-arguments'
  from within the `arguments' field, so it see the
  right (%current-target-system).
2013-06-05 16:39:58 +02:00
Ludovic Courtès ae3b6bb0f4 substitute-binary: Don't cache .narinfo lookups when lacking networking.
* guix/scripts/substitute-binary.scm (lookup-narinfo): Don't cache
  NARINFO when CACHE is #f.
2013-06-04 09:43:38 +02:00
Nikita Karetnikov ef7cf2917a licenses: Add 'agpl3' and 'agpl3+'.
* guix/licenses.scm (agpl3, agpl3+): New variables.
2013-06-03 11:39:38 +00:00
Ludovic Courtès 89d02b98f9 ui: define-diagnostic: Don't mark `_' and `N_' as literals.
* guix/ui.scm (define-diagnostic): Use `free-identifier=?' to compare
  the user's input with `_' and `N-".  This should fix builds with Guile 2.1.
  Reported by Cojocaru Alexandru <xojoc@gmx.com>.
2013-05-30 00:49:34 +02:00
Ludovic Courtès 5282181d51 build-system/python: Avoid circular dependency.
This fixes a circular dependency introduced in commit acc26ff ("gnu: Add
pytz.").

* guix/build-system/python.scm (default-python): New procedure.
  (python-build): Use it.
2013-05-30 00:47:34 +02:00
Ludovic Courtès cf5d2ca329 substitute-binary: Gracefully exit upon networking errors.
Suggested by Andreas Enge <andreas@enge.fr>.

* guix/scripts/substitute-binary.scm (with-networking): New macro.
  (guix-substitute-binary): Wrap the body in `with-networking'.
2013-05-29 23:22:05 +02:00
Ludovic Courtès 56b1f4b780 build, package: Add `--fallback' option.
* guix/scripts/build.scm (%options, show-help): Add `--fallback'.
  (guix-build): Call `set-build-options' with #:fallback?.
* guix/scripts/package.scm (%options, show-help): Add `--fallback'.
  (guix-package): Call `set-build-options' with #:fallback?.
* doc/guix.texi (Invoking guix package, Invoking guix build): Document
  `--fallback'.
2013-05-29 23:22:05 +02:00
Ludovic Courtès c3eb878f0b store: Test the `fallback?' store option.
* guix/store.scm (set-build-options): Rename #:try-fallback? to #:fallback?.
* tests/store.scm ("substitute --fallback"): New test.
2013-05-29 23:22:05 +02:00
Cyril Roelandt 842ded334f python-build-system: add a check phase.
* guix/build/python-build-system.scm (check): New procedure.
  (%standard-phases): Use it.
2013-05-28 22:53:35 +02:00
Ludovic Courtès 9b222abe03 packages: Raise an error condition a cross builder is needed but unavailable.
* guix/packages.scm (&package-cross-build-system-error): New condition type.
  (package-cross-derivation): Raise &package-cross-build-system-error
  when the build system doesn't support cross builds.
* guix/ui.scm (call-with-error-handling): Add
  package-cross-build-system-error? case.
* tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
2013-05-27 23:43:00 +02:00
Ludovic Courtès ea84ec7711 build-system/gnu: Fix typo in `gnu-cross-build'.
* guix/build-system/gnu.scm (gnu-cross-build)[builder]: When
  IMPLICIT-TARGET-INPUTS is #f, default to '().
2013-05-27 23:43:00 +02:00
Ludovic Courtès a7dc055bb5 packages: Make `native-inputs' thunked.
* guix/packages.scm (<package>): Make `native-inputs' thunked.
2013-05-25 16:14:57 +02:00
Ludovic Courtès cd52703ace packages: Re-export `%current-target-system'.
* guix/packages.scm: Re-export `%current-target-system'.
2013-05-25 16:14:37 +02:00
Ludovic Courtès ee4d736881 build-system/gnu: Make sure build input variables contain pairs.
* guix/build-system/gnu.scm (gnu-cross-build)[builder]: Make sure
  %build-host-inputs and %build-target-inputs always contain pairs, not
  lists.
2013-05-25 15:35:36 +02:00
Ludovic Courtès 5dce82180b build-system/trivial: Implement the cross-build protocol.
* guix/build-system/trivial.scm (guile-for-build): New procedure.
  (trivial-build): Use it.
  (trivial-cross-build): New procedure.
  (trivial-build-system): Use it.
2013-05-24 23:53:06 +02:00
Ludovic Courtès cba363bea8 package: Fix default profile ownership check when it's just been created.
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check
  whether S is true before checking its owner.  Fixes the case where we
  built %PROFILE-DIRECTORY just above.
2013-05-24 23:14:19 +02:00
Ludovic Courtès e55ec43d8b build: Add `--target' option.
* guix/scripts/build.scm (derivations-from-package-expressions): Add
  `package-derivation' parameter.
  (show-help, %options): Add `--target'.
  (guix-build): Use `package-cross-derivation' when `--target' is
  passed.
* tests/guix-build.sh: Add dry-run test with `--target'.
* doc/guix.texi (Invoking guix build): Document `--target'.
2013-05-24 22:52:52 +02:00
Ludovic Courtès 264218a47e build-system/gnu: Implement cross build.
* guix/build-system/gnu.scm (inputs-search-paths): New procedure.
  (standard-search-paths): Use it.
  (expand-inputs): New procedure.
  (standard-inputs): Use it.
  (standard-cross-packages, standard-cross-inputs,
  standard-cross-search-paths, gnu-cross-build): New procedures.
  (gnu-build-system): Set `cross-build' field to `gnu-cross-build'.
* gnu/packages/cross-base.scm: Export `cross-gcc', `cross-binutils', and
  `cross-libc'.
* guix/build/gnu-cross-build.scm: New file.
* Makefile.am (MODULES): Add it.
2013-05-24 22:44:15 +02:00
Ludovic Courtès 9c1edabd8b packages: Implement `package-cross-derivation'.
* guix/packages.scm (package-transitive-target-inputs,
  package-transitive-native-inputs): New procedures.
  (package-derivation): Parametrize `%current-target-system'.
  (package-cross-derivation): Implement.
* guix/utils.scm (%current-target-system): New variable.
* tests/packages.scm ("package-cross-derivation"): New test.
* doc/guix.texi (Defining Packages): Document
  `package-cross-derivation'.
2013-05-24 22:30:58 +02:00
Ludovic Courtès a63062b55a packages: Factorize things common to `package-{,cross-}derivation'.
* guix/packages.scm (expand-input): New procedure, moved out of...
  (package-derivation): ... here.  Adjust accordingly.
  (package-cross-derivation): Add `cross-system' and `system'
  parameters.
2013-05-24 08:58:52 +02:00
Ludovic Courtès 969e678ed9 Add `--max-silent-time' to `guix build' and `guix package'.
* guix/scripts/build.scm (%default-options): Add default
  `max-silent-time' value.
  (show-help, %options):  Add `--max-silent-time'.
  (guix-build): Pass `max-silent-time' to `set-build-options'.
* guix/scripts/package.scm (%default-options): Add default
  `max-silent-time' value.
  (show-help, %options):  Add `--max-silent-time'.
  (guix-package): Pass `max-silent-time' to `set-build-options'.
* guix/ui.scm (string->number*): New procedure.
* tests/derivations.scm ("build-expression->derivation and
  max-silent-time"): New test.
* doc/guix.texi (Invoking guix package, Invoking guix build): Document
  `--max-silent-time'.
2013-05-20 18:29:26 +02:00
Ludovic Courtès 70c4329172 package: Make sure the profile directory is owned by the user.
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check
  the owner of %PROFILE-DIRECTORY.  Report an error when the owner is
  not the current user.  Add `rtfm' procedure.
* doc/guix.texi (Invoking guix package): Mention the ownership test.
2013-05-16 20:04:13 +02:00
Ludovic Courtès 101d9f3fd4 substitute-binary: Pass `filtered-port' an unbuffered port.
This fixes a bug whereby `read-response' would read more than just the
response, with the extra data going into the port's buffer; the
"bzip2 -dc" process spawned by `filtered-port' would not see the those
buffered data, which are definitely lost, and would bail out with
"bzip2: (stdin) is not a bzip2 file."

* guix/utils.scm (filtered-port): Document that INPUT must be
  unbuffered.
* guix/web.scm (http-fetch): Add `buffered?' parameter.  Call
  `open-socket-for-uri' explicitly, and call `setvbuf' when BUFFERED? is
  false.  Pass the port to `http-get'.  Close it upon 301/302.
* guix/scripts/substitute-binary.scm (fetch): Add `buffered?'
  parameter.  Pass it to `http-fetch'; honor it for `file' URIs.
  (guix-substitute-binary): Call `fetch' with #:buffered? #f for port RAW.
* tests/utils.scm ("filtered-port, file"): Open FILE as unbuffered.
2013-05-15 23:40:09 +02:00
Ludovic Courtès 0332386251 substitute-binary: Work around thread-unsafe `regexp-exec'.
* guix/scripts/substitute-binary.scm (%regexp-exec-mutex): New variable.
  (string->uri): New procedure.
  (fields->alist): Wrap `regexp-exec' call in `with-mutex'.
2013-05-14 23:53:38 +02:00
Ludovic Courtès 90a1e4b303 package: Always clear the SIGINT handler.
* guix/scripts/package.scm (call-with-sigint-handler): Wrap THUNK in
  `dynamic-wind' so that the SIGINT handler is always cleared.
2013-05-14 23:52:13 +02:00
Ludovic Courtès 91fe0e20c7 ftp-client: Let callers handle `ftp-open' exceptions.
* guix/ftp-client.scm (ftp-open): Let exceptions through.
* guix/scripts/package.scm (waiting): Wrap EXP in a `dynamic-wind', so
  the line is always cleared.
2013-05-14 23:51:36 +02:00
Ludovic Courtès b30b13dc3d Sort commands alphabetically in "guix --help".
* guix/ui.scm (show-guix-help): Sort commands.
2013-05-14 13:37:53 +02:00
Ludovic Courtès 2b8cf44fd9 Fix "guix --help" on Guile 2.0.5.
Reported at <http://linuxfr.org/news/sortie-de-gnu-guix-0-2>.

* guix/ui.scm (command-files): Filter the result of `scandir' to make
  sure only `.scm' files are present.
2013-05-14 13:37:21 +02:00
Ludovic Courtès c0cd1b3ea7 Move record utilities to (guix records).
* guix/utils.scm (define-record-type*): Move to...
* guix/records.scm: ... here.  New file.
* guix/build-system.scm, guix/packages.scm: Use it.
* guix/gnu-maintenance.scm: Likewise.
  (official-gnu-packages)[alist->record]: Remove.
* guix/scripts/substitute-binary.scm: Likewise.
  (alist->record, object->fields): Remove.
* tests/utils.scm ("define-record-type*", "define-record-type* with
  letrec* behavior", "define-record-type* & inherit",
  "define-record-type* & inherit & letrec* behavior",
  "define-record-type* & thunked", "define-record-type* & thunked &
  default", "define-record-type* & thunked & inherited"): Move to...
* tests/records.scm: ... here.  New file.
2013-05-12 15:46:16 +02:00
Ludovic Courtès ccbce84809 tests: Add `guix hash' test.
* guix/scripts/hash.scm (guix-hash)[eof->null]: New procedure.
  Use it to convert the EOF object to the empty bytevector.
* tests/guix-hash.sh: New file.
* Makefile.am (SH_TESTS): Add it.
2013-05-11 15:09:56 +02:00
Ludovic Courtès f92300852f refresh: Add `--key-server' and `--gpg'.
* guix/scripts/refresh.scm (%options): Add `--key-server' and `--gpg'.
  (show-help): Update accordingly.
  (update-package): New procedure, formerly in `guix-refresh'.
  (guix-refresh): Use it.  Parameterize `%openpgp-key-server' and
  `%gpg-command'.
2013-05-11 14:36:58 +02:00
Ludovic Courtès 0ba91c945b gnupg: Turn the GPG command name and keyserver into parameters.
* guix/gnupg.scm (%gpg-command): Turn into a SRFI-39 parameter.
  (%openpgp-key-server): Likewise.  Default to pgp.mit.edu, as
  keys.gnupg.net is unreliable.
  Update users.
2013-05-11 14:32:20 +02:00
Ludovic Courtès 25c936766e ui: Invite users to try `--help' in the error message.
* guix/ui.scm (show-guix-usage): Mention `guix --help'.
  Suggested by Mark H. Weaver.
  (run-guix-command): Invoke it when a command is not found.
  (guix-main): Adjust accordingly.
2013-05-10 23:14:26 +02:00
Ludovic Courtès 741c70c63e package: Store the output path of packages installed with `-e'.
* guix/scripts/package.scm (guix-package)[process-actions](package->tuple):
  Put the output path in the tuple, not the derivation path.
* tests/guix-package.sh: Add test.
2013-05-10 23:04:39 +02:00
Ludovic Courtès 94a4b3b9f2 package: Make sure the dependencies get built along with the manifest.
Before this, something like "guix package -i glibc" could fail because
glibc lists linux-libre-headers as a propagated input (which would be
added as a dependency in the manifest) but the linux-libre-headers
output could be unavailable, leading to an error like this:

  path `/nix/store/4v2bk8sx5cm166gks3fi3q7d9zchibnk-linux-libre-headers-3.3.8' is not valid

This patch adds such dependencies as inputs of the profile derivation.

* guix/scripts/package.scm (profile-derivation): Accept package objects
  in the `deps' field of an element of PACKAGES.  Convert them to their
  output path for BUILDER, and add them to the inputs of the
  `build-expression->derivation' call.
  (input->name+path): When INPUT doesn't contain a package object,
  return it as is.
  (guix-package)[process-actions](canonicalize-deps): Expect DEPS to
  contain package objects, and leave them as is.
2013-05-10 22:46:19 +02:00
Ludovic Courtès fe3e603d14 refresh: Gracefully handle failure to download a tarball.
* guix/scripts/refresh.scm (guix-refresh): When updating a source file,
  gracefully handle the case where TARBALL is #f.
  Reported by Nikita Karetnikov <nikita@karetnikov.org>.
2013-05-10 15:07:00 +02:00
Ludovic Courtès e31ff8b8d0 ui: Implement `guix --help'.
* guix/ui.scm (command-files, commands, show-guix-help): New procedures.
  (guix-main): Invoke `show-guix-help' when passed `--help'.
2013-05-10 12:33:18 +02:00
Ludovic Courtès ec5d0a85eb ui: Gracefully report "command not found" errors.
* guix/ui.scm (run-guix-command): Can `resolve-interface' errors and
  report them with `leave'.  Parameterize `program-name' from here.
  (guix-main): Remove parameterization of `program-name'.
2013-05-10 12:14:01 +02:00
Ludovic Courtès a4007c9852 gnu-maintenance: Add GnuTLS FTP server.
* guix/gnu-maintenance.scm (ftp-server/directory)[quirks]: Add GnuTLS.
2013-05-10 01:15:04 +02:00
Ludovic Courtès dd9afe64b5 download: Fix premature socket close on TLS connections.
This would manifest when downloading a large file such as the Bazaar
tarball, leading to an "Error in the pull function" GnuTLS exception.

* guix/build/download.scm (add-weak-reference): New procedure.
  (tls-wrap): Add (add-weak-reference record port).
2013-05-10 01:14:25 +02:00
Ludovic Courtès a81bc5312b package: Use ~/.guix-profile as the default for --search-paths.
* guix/scripts/package.scm (search-path-environment-variables): Prefer
  %USER-ENVIRONMENT-DIRECTORY when it points to PROFILE.
  (display-search-paths): Use 3 spaces for indentation.
2013-05-10 00:36:00 +02:00
Nikita Karetnikov 40506d5d92 Add 'python-build-system'.
* guix/build-system/python.scm, guix/build/python-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
2013-05-08 22:46:12 +00:00
Ludovic Courtès 3309e3a103 Add (guix build rpath).
* guix/build/rpath.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages/python.scm (python): Use it; remove local copy of
  the *rpath* procedures.
* gnu/packages/samba.scm (samba): Likewise.
2013-05-08 23:45:02 +02:00
Ludovic Courtès a2ed738989 package: Display the output of packages to be installed/removed.
* guix/scripts/package.scm (guix-package)[show-what-to-remove/install]:
  Display the output name.
2013-05-08 15:21:47 +02:00
Ludovic Courtès ce3b7a619d package: Preserve the installed package output when upgrading.
* guix/scripts/package.scm (guix-package)[find-package]: Add optional
  parameter `output'.  Use it.
  [process-actions]: When computing UPGRADE, pass OUTPUT to
  `find-package'.
2013-05-08 15:11:20 +02:00
Ludovic Courtès 83e61a73c4 ui: Capitalize informative messages.
* guix/ui.scm (show-what-to-build): Capitalize user messages, as per the
  GCS (info "(standards) Errors").
2013-05-07 13:28:11 +02:00
Ludovic Courtès 15f67744fe package: Fix spacing in user messages.
* guix/scripts/package.scm (guix-package)[process-actions]: Fix spacing.
2013-05-07 13:23:30 +02:00
Ludovic Courtès 313109e050 refresh: Change default to not update source files.
* guix/scripts/refresh.scm (%options): Change `--dry-run' to `--update'.
  (show-help): Adjust accordingly.
  (guix-refresh): Likewise.
2013-05-06 22:31:28 +02:00
Ludovic Courtès 0734a9a813 Merge branch 'core-updates' 2013-04-30 17:06:00 +02:00
Nikita Karetnikov 01155b1808 utils: Adjust 'wrap-program'.
* guix/build/utils.scm (wrap-program): Fix computation of PROG-REAL and
  PROG-TMP when PROG is an absolute file name.  Add "$@" in the
  generated script, and quote PROG-REAL.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2013-04-30 16:58:59 +02:00
Ludovic Courtès e0fbbc889d substitute-binary: Support decompression from non-file ports.
* guix/scripts/substitute-binary.scm (filtered-port): Move to utils.scm.
  (decompressed-port): Upon "none", return '() as the second value.
  (guix-substitute-binary): Expect `decompressed-port' to return a list
  of PIDs as its second value.
* guix/utils.scm (filtered-port): New procedure.  Add case for when
  INPUT is not `file-port?'.
* tests/utils.scm ("filtered-port, file", "filtered-port, non-file"):
  New tests.
2013-04-29 23:25:19 +02:00
Ludovic Courtès 593987671a build-system/gnu: Fix default name for the "doc" output directory.
* guix/build/gnu-build-system.scm (configure)[package-name]: Drop the
  prefix corresponding to the hash part of OUT.
2013-04-28 23:39:28 +02:00
Ludovic Courtès 5924080dcc guix package: Add `--search-paths' & co.
* guix/scripts/package.scm (search-path-environment-variables,
  display-search-paths): New procedures.
  (show-help, %options): Add `--search-paths'.
  (guix-package)[process-actions]: Call `display-search-paths' once the
  profile is ready.
  [process-query]: Honor `search-paths'.
2013-04-28 23:19:03 +02:00
Ludovic Courtès 2bcfb9e065 utils: Add `string-tokenize*'.
* guix/utils.scm (string-tokenize*): New procedure.
* tests/utils.scm ("string-tokenize*"): New test.
2013-04-28 23:19:03 +02:00
Ludovic Courtès 8e77f41ede packages: Work around compiler bug in Guile 2.0.5.
* guix/packages.scm (package-field-location): Work around compiler bug
  in 2.0.5.  Reported by Andreas Enge <andreas@enge.fr>.
2013-04-27 23:02:06 +02:00
Ludovic Courtès 89be37a5a3 web: Add workaround for <http://bugs.gnu.org/13095>.
* guix/web.scm: Add workaround for <http://bugs.gnu.org/13095>.
2013-04-27 23:00:51 +02:00
Ludovic Courtès 61ef22f432 web: Add 2.0.5 workaround for responses without content-length.
* guix/web.scm (read-response-body*)[when-guile<=2.0.5]: Support
  responses without content-length.
  Reported by Andreas Enge <andreas@enge.fr>.
2013-04-27 23:00:21 +02:00
Ludovic Courtès c4ca12c15b gnu-maintenance: Fix error message of `update-package-source'.
* guix/gnu-maintenance.scm (update-package-source): In the (not loc)
  case, pass the location first and convert it to a string.
2013-04-27 22:52:43 +02:00
Ludovic Courtès a5975cedf2 ui: Add `args-fold*' and use it.
* guix/ui.scm (args-fold*): New procedure.
* guix/scripts/build.scm, guix/scripts/download.scm,
  guix/scripts/gc.scm, guix/scripts/hash.scm, guix/scripts/import.scm,
  guix/scripts/package.scm, guix/scripts/pull.scm,
  guix/scripts/refresh.scm: Use `args-fold*' instead of `args-fold'.
2013-04-27 16:46:39 +02:00
Ludovic Courtès 14e2afa74b ui: Use consistent spacing in `show-what-to-build' messages.
* guix/ui.scm (show-what-to-build): Use consistent spacing in "the
  following..." messages.
2013-04-27 16:37:09 +02:00
Ludovic Courtès 049b2f1d7b gnu-maintenance: Fix `latest-release' for GnuPG.
* guix/gnu-maintenance.scm (latest-release): Filter out directories
  whose name does not contain digits early in the process.  This fixes
  (latest-release "gnupg").
2013-04-27 16:26:48 +02:00
Ludovic Courtès 87dfd45594 ftp-client: `ftp-chdir' changes one step at a time.
* guix/ftp-client.scm (%char-set:not-slash): New variable.
  (ftp-chdir): Add docstring.  Change to DIR one step at a time.
  (ftp-retr): Fix indentation.
2013-04-27 16:25:54 +02:00
Ludovic Courtès 786944576c pull: Use `download-to-store'.
* guix/scripts/pull.scm (download-and-store): Remove.
  (unpack): Use `download-to-store' instead.
2013-04-27 11:40:18 +02:00
Ludovic Courtès 1424a96e25 web: Backport chunked encoding support for Guile <= 2.0.5.
* guix/web.scm (when-guile<=2.0.5): New macro.
  (read-chunk-header, read-chunk, read-chunk-body,
  make-chunked-input-port, read-response-body*)[when-guile<=2.0.5]: New
  procedures.
  (http-fetch): Clarify message when (not data).
2013-04-27 11:37:31 +02:00
Ludovic Courtès a9db7d10b6 Merge branch 'master' into core-updates
Conflicts:
	Makefile.am
	gnu/packages/autotools.scm
	gnu/packages/guile.scm
	gnu/packages/python.scm
	gnu/packages/shishi.scm
	guix/gnu-maintenance.scm
	guix/scripts/build.scm
	guix/scripts/gc.scm
	guix/scripts/package.scm
	guix/scripts/substitute-binary.scm
	guix/ui.scm
	nix/nix-daemon/guix-daemon.cc
	test-env.in
	tests/nar.scm
	tests/store.scm
2013-04-26 16:43:08 +02:00
Ludovic Courtès dfb43e45b5 gnu-maintenance: Add newline in warning messages.
* guix/gnu-maintenance.scm (download-tarball): Add newline in warning
  messages.
2013-04-25 23:07:24 +02:00
Ludovic Courtès 37a5340262 refresh: Add `--select'.
* guix/scripts/refresh.scm (%options): Add `--select'.
  (show-help): Likewise.  Augment initial help text.
  (guix-refresh)[core-package?]: New procedure.
  Use it when selecting packages.
2013-04-25 22:56:25 +02:00
Ludovic Courtès 1c9e7d65d4 web: Factorize `http-get' hackery.
This should fix `substitute-binary --query' on Guile 2.0.5.

* guix/web.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.
* guix/gnu-maintenance.scm (http-fetch): Remove.
  (%package-list-url): Turn into a URI.
  (official-gnu-packages): Add #:text? #t to `http-fetch' call.
* guix/scripts/substitute-binary.scm (fetch): Remove `http' case, and
  use `http-fetch' instead.
2013-04-25 22:14:51 +02:00
Ludovic Courtès 65b96a0c10 gnu-maintenance: Optimize `gnu-package?'.
* guix/gnu-maintenance.scm (gnu-package?): Capture a memoizing version
  of `gnu-package?'.
2013-04-25 00:13:56 +02:00
Ludovic Courtès d55a99fed3 gnu-maintenance: Optimize `release-file'.
* guix/gnu-maintenance.scm (tarball-regexp): Remove.
  (%tarball-rx): New variable.
  (release-file): Adjust to use %TARBALL-RX.
2013-04-25 00:13:56 +02:00
Ludovic Courtès cac137aa84 gnu-maintenance: Optimize `latest-release'.
* guix/gnu-maintenance.scm (tarball-regexp, sans-extension,
  release-file): New procedures.
  (%alpha-tarball-rx): New variable.
  (releases): Use them instead of local copies.
  (latest-release): Rewrite to not do a recursive search of all
  versions and instead jump directly to the latest.
2013-04-25 00:13:56 +02:00
Ludovic Courtès 0fdd3bea58 Add `guix refresh' and related auto-update tools.
* guix/gnu-maintenance.scm (ftp-server/directory)[quirks]: Add glib.
  (package-update-path, download-tarball, package-update,
  update-package-source): New procedures.
* guix/gnupg.scm, guix/scripts/refresh.scm: New files.
* Makefile.am (MODULES): Add them.
* guix/utils.scm (file-extension): New procedure.
2013-04-25 00:13:56 +02:00
Ludovic Courtès f903dc056a packages: Use `read' and source properties for `package-field-location'.
* guix/packages.scm (package-field-location): Rewrite using `read' and
  source properties.  Change to return #f upon failure.
* tests/packages.scm ("package-field-location"): Check for #f upon failure.
* build-aux/sync-synopses.scm: Adjust accordingly.
2013-04-25 00:13:56 +02:00
Ludovic Courtès 5fe21fbeef utils: Fix column number returned by `source-properties->location'.
* guix/utils.scm (source-properties->location): Use COL, not COL + 1.
2013-04-25 00:13:56 +02:00
Ludovic Courtès d66c70967f packages: Add `package-field-location'.
* guix/packages.scm (package-field-location): New procedure.
* build-aux/sync-synopses.scm: Use it instead of `package-location'.
* tests/packages.scm ("package-field-location"): New test.
2013-04-22 23:07:13 +02:00
Ludovic Courtès b2a886f6c7 ui: Move macro definitions before any use.
* guix/ui.scm (define-diagnostic, warning, report-error, leave): Move
  definitions before any use.  Reported by Nikita Karetnikov.
  (install-locale): Move back close to `initialize-guix'.
2013-04-22 13:24:39 +02:00
Ludovic Courtès 861693f3e7 Factorize `download-and-store'.
* guix/download.scm (download-to-store): New procedure.
* guix/scripts/download.scm (fetch-and-store): Remove.
  (guix-download): Use `download-to-store' instead.
* guix/ui.scm (call-with-temporary-output-file): Move to...
* guix/utils.scm (call-with-temporary-output-file): ... here.
2013-04-21 22:40:40 +02:00
Nikita Karetnikov 6c365eca6d Add 'guix hash'.
* guix/scripts/hash.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.
* doc/guix.texi (Invoking guix hash): New node.
  (Defining Packages): Add a cross-reference to the 'Invoking guix
  hash' node.
2013-04-21 19:22:14 +00:00
Nikita Karetnikov bfda2997c8 guix download: Add supported formats to '--help'.
* guix/scripts/download.scm (show-help): Add supported formats.
2013-04-21 19:04:24 +00:00
Ludovic Courtès 238328c990 ui: Move definition of `install-locale' after that of the `warning' macro.
* guix/ui.scm (install-locale): Move definition after that of `warning'.
2013-04-21 11:53:06 +02:00
Nikita Karetnikov 98eb8cbe8d ui: Add a 'define-diagnostic' macro.
* guix/ui.scm (define-diagnostic): New macro, which is based on the
  previous version of 'warning'.
  (warning, leave): Redefine using 'define-diagnostic'.
  (report-error): New macro.
  (install-locale): Use 'warning' instead of 'format'.
  (call-with-error-handling): Adjust 'leave'.
* gnu/packages.scm (package-files): Use 'warning' instead of 'format'.
* guix/gnu-maintenance.scm (http-fetch): Use 'warning' and 'leave'.
* guix/scripts/build.scm (derivations-from-package-expressions, guix-build):
  Adjust 'leave'.
* guix/scripts/download.scm (guix-download): Adjust 'leave'.
* guix/scripts/gc.scm (size->number, %options): Adjust 'leave'.
* guix/scripts/package.scm (roll-back, guix-package): Adjust 'leave'.
* po/POTFILES.in: Add 'guix/gnu-maintenance.scm'.
2013-04-21 08:08:40 +00:00
Ludovic Courtès 4c7cacf117 substitute-binary: Remove expired cache entries once in a while.
* guix/scripts/substitute-binary.scm (%narinfo-expired-cache-entry-removal-delay):
  New variable.
  (obsolete?): New procedure, formerly in `lookup-narinfo'.
  (lookup-narinfo): Adjust accordingly.
  (remove-expired-cached-narinfos, maybe-remove-expired-cached-narinfo):
  New procedures.
  (guix-substitute-binary): Call `maybe-remove-expired-cached-narinfo'.
2013-04-20 15:12:24 +02:00
Ludovic Courtès f286f71634 snix: Prefer synopses from the Womb rather than from Nixpkgs.
* guix/snix.scm (snix-derivation->guix-package): When NAME is
  in (official-gnu-packages), use this synopsis instead of the one from
  Nixpkgs.
2013-04-20 11:52:50 +02:00
Ludovic Courtès 0ff3e3aa9b daemon: Gracefully handle cases where the daemon does not return a status code.
* guix/store.scm (process-stderr): Check for EOF before doing (read-int p).
2013-04-20 10:53:31 +02:00
Ludovic Courtès b52cb20d43 guix package: Allow the search of the latest release to be interrupted.
* guix/scripts/package.scm (%sigint-prompt): New variable.
  (call-with-sigint-handler): New procedure.
  (waiting): Use it.
2013-04-17 22:43:14 +02:00
Ludovic Courtès 801486fe46 ui: Fix format string in `warning'.
* guix/ui.scm (warning)[augmented-format-string]: Add missing ~*.
2013-04-17 18:02:48 +02:00
Ludovic Courtès dd36b51bf7 scripts: Report what will be substituted.
* guix/derivations.scm (derivation-input-output-paths): New procedure.
  (derivation-prerequisites-to-build): New `use-substitutes?' keyword
  argument.  Change two return the list of substitutable paths as a
  second argument.
* guix/ui.scm (show-what-to-build): Turn `dry-run?' into a keyword
  argument.  New `use-substitutes?' keyword argument.  Use `fold2' and
  adjust to use both return values of
  `derivation-prerequisites-to-build'.  Display what will/would be
  downloaded.
* guix/scripts/build.scm (guix-build): Adjust accordingly.
* guix/scripts/package.scm (guix-package): Likewise.
* tests/derivations.scm ("derivation-prerequisites-to-build and
  substitutes"): New test.
2013-04-17 00:08:21 +02:00
Cyril Roelandt acb6ba2567 package: allow users to upgrade the whole system by not providing a regexp.
* guix/scripts/packages.scm (guix-package) [process-actions]: When upgrading,
use "" when REGEXP is #f.
* doc/guix.texi: update the documentation accordingly.
2013-04-16 23:12:29 +02:00
Ludovic Courtès 35ac56b63e build-system/{perl,cmake}: Keep the standard search paths of gnu-build-system.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/build-system/gnu.scm (standard-search-paths): New procedure.
  (gnu-build): Use it.
* guix/build-system/perl.scm (perl-build):
  Append (standard-search-paths) to the search paths of PERL.
* guix/build-system/cmake.scm (cmake-build):
  Append (standard-search-paths) to SEARCH-PATHS.
2013-04-16 14:05:00 +02:00
Ludovic Courtès e967678ed1 substitute-binary: Skip servers that use a different store prefix.
* guix/scripts/substitute-binary.scm (fetch-narinfo): Return #f when
  CACHE uses a store directory different from (%store-prefix).
2013-04-15 23:43:13 +02:00
Ludovic Courtès 0c357a088b substitute-binary: Call `open-cache' only when needed.
* guix/scripts/substitute-binary.scm (lookup-narinfo): Force CACHE when
  passing it to `fetch-narinfo'.
  (guix-substitute-binary): Delay calls to `open-cache'.
2013-04-15 23:43:10 +02:00
Ludovic Courtès eba783b7b2 substitute-binary: Add a local cache.
* guix/scripts/substitute-binary.scm (%narinfo-cache-directory,
  %narinfo-ttl, %narinfo-negative-ttl): New variables.
  (with-atomic-file-output, object->fields, read-narinfo,
  write-narinfo, narinfo->string, string->narinfo, lookup-narinfo): New
  procedures.
  (fetch-narinfo): Adjust to use `read-narinfo'.
  (guix-substitute-binary): Ensure the existence of
  %NARINFO-CACHE-DIRECTORY.  Use `lookup-narinfo' instead of
  `fetch-narinfo'.
2013-04-15 23:42:55 +02:00
Ludovic Courtès 04fd96cac3 utils: Add `fold2'.
* gnu/packages.scm (fold2): Remove.
* guix/utils.scm (fold2): New procedure.  Generalization of the above to
  one and two lists.
* tests/utils.scm ("fold2, 1 list", "fold2, 2 lists"): New tests.
2013-04-14 16:56:08 +02:00
Ludovic Courtès 841032d448 store: Remove unneeded and conflicting import.
* guix/store.scm: Remove unneeded (ice-9 rdelim) import.  In Guile 2.0.9
  that module exports `read-string', which conflicts with that of (guix
  serialization).
2013-04-12 21:58:47 +02:00
Ludovic Courtès d5d6db8918 package: Being at the empty profile is not an error.
* guix/scripts/package.scm (roll-back): Use `format', not `leave' when
  indicating "already at the empty profile".  Fixes a regression
  introduced in a2011be5df.  Reported by
  Nikita Karetnikov <nikita@karetnikov.org>.
2013-04-12 21:58:47 +02:00
Ludovic Courtès 581f9eb845 guix package: Add `--no-substitutes'.
* guix/scripts/package.scm (%default-options): Add `substitutes?'.
  (show-help, %options): Add and document `--no-substitutes'.
  (guix-package): Call `set-build-options' to honor `substitutes?'.
2013-04-12 21:58:47 +02:00
Ludovic Courtès cdf2022052 substitute-binary: Implement `--substitute'.
This allows build outputs to be transparently downloaded from
http://hydra.gnu.org, for example.

* config-daemon.ac: Check for `gzip', `bzip2', and `xz'.
* guix/config.scm.in (%gzip, %bzip2, %xz): New variable.
* guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value.
  (<narinfo>): Change `url' to `uri'.
  (make-narinfo): Rename to...
  (narinfo-maker): ... this.  Handle relative URLs.
  (fetch-narinfo): Adjust accordingly.
  (filtered-port, decompressed-port): New procedures.
  (guix-substitute-binary): Implement the `--substitute' case.
* tests/store.scm ("substitute query"): Use (%store-prefix) instead
  of (getenv "NIX_STORE_DIR").
  ("substitute"): New test.
2013-04-12 21:58:47 +02:00
Ludovic Courtès f03f0c9a86 substitute-binary: Correctly handle missing narinfos in `--query' mode.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]("have",
  "info"): Filter SUBSTITUTABLE through `narinfo?'.
2013-04-12 21:58:47 +02:00
Ludovic Courtès c7b62db614 nar: Add support for symlinks.
* guix/nar.scm (write-file): Add case for type `symlink'.
  (restore-file): Likewise.
* tests/nar.scm (random-file-size, make-file-tree, delete-file-tree,
  with-file-tree, file-tree-equal?, make-random-bytevector,
  populate-file): New procedures.
  (%test-dir): New variable.
  ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'.
  ("write-file + restore-file with symlinks"): New test.
2013-04-12 21:58:47 +02:00
Ludovic Courtès 6f80c9d8f3 ui: Add a `warning' macro.
* guix/ui.scm (program-name, guix-warning-port): New variables.
  (warning): New macro.
  (guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
  guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
  and `warning' consistently.
2013-04-12 21:58:46 +02:00
Ludovic Courtès ca877f5a3a nar: Implement restoration from Nar.
* guix/nar.scm (&nar-error, &nar-read-error): New condition types.
  (dump): New procedure.
  (write-contents)[dump]: Remove.  Use the one above instead.
  (read-contents, write-file, restore-file): New procedures.
  (%archive-version-1): New variable.
2013-04-12 21:58:46 +02:00
Ludovic Courtès f0cd71f21e Add (guix nar) and (guix serialization).
* guix/store.scm (write-int, read-int, write-long-long, read-long-long,
  write-padding, write-string, read-string, read-latin1-string,
  write-string-list, read-string-list, write-store-path,
  read-store-path, write-store-path-list, read-store-path-list): Move to
  serialization.scm.
  (write-contents, write-file): Move to nar.scm.
* guix/nar.scm, guix/serialization.scm: New files.
* Makefile.am (MODULES): Add them.
2013-04-12 21:57:58 +02:00
Ludovic Courtès 7ce1f2160f substitute-binary: Fix communication of several store paths to the daemon.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]:
  Emit blank lines only after the complete list of store paths has been
  returned.
2013-04-12 21:57:58 +02:00
Ludovic Courtès 419fffa2e8 Add preliminary binary substituter.
* guix/scripts/substitute-binary.scm: New file.
* Makefile.am (MODULES): Add it.
* nix/scripts/substitute-binary.in: New file.
* config-daemon.ac: Produce nix/scripts/substitute-binary.
* daemon.am (nodist_pkglibexec_SCRIPTS): Add
  nix/scripts/substitute-binary.
* guix/store.scm (substitutable-path-info): Use the
  `query-substitutable-path-infos' RPC.
* nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'.
* pre-inst-env.in: Set `NIX_SUBSTITUTERS'.
* test-env.in: Leave `NIX_SUBSTITUTERS' unchanged.  Set
  `GUIX_BINARY_SUBSTITUTE_URL, and create
  $NIX_STATE_DIR/substituter-data.
  Run `guix-daemon' within `./pre-inst-env'.
* tests/store.scm ("substitute query"): New test.
2013-04-12 21:57:58 +02:00
Ludovic Courtès afb49942e0 store: Add `store-path-hash-part'.
* guix/store.scm (store-path-hash-part): New procedure.
* tests/store.scm ("store-path-hash-part", "store-path-hash-part #f"):
  New tests.
2013-04-12 21:57:57 +02:00
Ludovic Courtès 5477e0342f gnu-maintenance: Adjust `http-fetch' to the various Guile versions.
* guix/gnu-maintenance.scm (http-fetch): Try #:streaming? #t, or
  'http-get*', or 'http-get' as a last resort.  Check whether DATA is
  #f, a string, or an input port.
2013-04-12 21:57:57 +02:00
Ludovic Courtès bdf06d8922 pull: Switch to the cgit URL.
* guix/scripts/pull.scm (%snapshot-url): Switch to the cgit URL, given
  that the Hydra one is not currently available.
2013-04-12 21:57:57 +02:00
Ludovic Courtès 9adb6934f4 store: Remove unneeded and conflicting import.
* guix/store.scm: Remove unneeded (ice-9 rdelim) import.  In Guile 2.0.9
  that module exports `read-string', which conflicts with that of (guix
  serialization).
2013-04-12 18:22:41 +02:00
Ludovic Courtès c31d1a7860 package: Being at the empty profile is not an error.
* guix/scripts/package.scm (roll-back): Use `format', not `leave' when
  indicating "already at the empty profile".  Fixes a regression
  introduced in a2011be5df.  Reported by
  Nikita Karetnikov <nikita@karetnikov.org>.
2013-04-12 18:07:17 +02:00
Ludovic Courtès 3b82460576 guix package: Add `--no-substitutes'.
* guix/scripts/package.scm (%default-options): Add `substitutes?'.
  (show-help, %options): Add and document `--no-substitutes'.
  (guix-package): Call `set-build-options' to honor `substitutes?'.
2013-04-12 17:31:05 +02:00
Ludovic Courtès fe0cff14f6 substitute-binary: Implement `--substitute'.
This allows build outputs to be transparently downloaded from
http://hydra.gnu.org, for example.

* config-daemon.ac: Check for `gzip', `bzip2', and `xz'.
* guix/config.scm.in (%gzip, %bzip2, %xz): New variable.
* guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value.
  (<narinfo>): Change `url' to `uri'.
  (make-narinfo): Rename to...
  (narinfo-maker): ... this.  Handle relative URLs.
  (fetch-narinfo): Adjust accordingly.
  (filtered-port, decompressed-port): New procedures.
  (guix-substitute-binary): Implement the `--substitute' case.
* tests/store.scm ("substitute query"): Use (%store-prefix) instead
  of (getenv "NIX_STORE_DIR").
  ("substitute"): New test.
2013-04-12 17:31:01 +02:00
Ludovic Courtès d7c5d27795 substitute-binary: Correctly handle missing narinfos in `--query' mode.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]("have",
  "info"): Filter SUBSTITUTABLE through `narinfo?'.
2013-04-12 17:30:47 +02:00
Ludovic Courtès 8f3114b7a4 nar: Add support for symlinks.
* guix/nar.scm (write-file): Add case for type `symlink'.
  (restore-file): Likewise.
* tests/nar.scm (random-file-size, make-file-tree, delete-file-tree,
  with-file-tree, file-tree-equal?, make-random-bytevector,
  populate-file): New procedures.
  (%test-dir): New variable.
  ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'.
  ("write-file + restore-file with symlinks"): New test.
2013-04-12 14:42:56 +02:00
Ludovic Courtès a2011be5df ui: Add a `warning' macro.
* guix/ui.scm (program-name, guix-warning-port): New variables.
  (warning): New macro.
  (guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
  guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
  and `warning' consistently.
2013-04-11 22:30:06 +02:00
Ludovic Courtès 068cdcd07c build-system/gnu: Fix search path computation with implicit inputs.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/build-system/gnu.scm (standard-packages): New procedure.
  (standard-inputs): Use it instead of resolving things locally.
  (gnu-build)[implicit-search-paths]: Map over (standard-packages), not
  over STANDARD-INPUTS.
2013-04-09 19:01:21 +02:00
Ludovic Courtès 53c63ee937 nar: Implement restoration from Nar.
* guix/nar.scm (&nar-error, &nar-read-error): New condition types.
  (dump): New procedure.
  (write-contents)[dump]: Remove.  Use the one above instead.
  (read-contents, write-file, restore-file): New procedures.
  (%archive-version-1): New variable.
2013-04-08 23:21:38 +02:00
Ludovic Courtès 0f41c26f9b Add (guix nar) and (guix serialization).
* guix/store.scm (write-int, read-int, write-long-long, read-long-long,
  write-padding, write-string, read-string, read-latin1-string,
  write-string-list, read-string-list, write-store-path,
  read-store-path, write-store-path-list, read-store-path-list): Move to
  serialization.scm.
  (write-contents, write-file): Move to nar.scm.
* guix/nar.scm, guix/serialization.scm: New files.
* Makefile.am (MODULES): Add them.
2013-04-04 22:29:08 +02:00
Ludovic Courtès 462f8e9f33 substitute-binary: Fix communication of several store paths to the daemon.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]:
  Emit blank lines only after the complete list of store paths has been
  returned.
2013-04-04 21:47:55 +02:00
Andreas Enge 6be960c7f7 Merge branch 'xorg' into core-updates 2013-04-04 18:49:28 +02:00
Ludovic Courtès f65cf81a3c Add preliminary binary substituter.
* guix/scripts/substitute-binary.scm: New file.
* Makefile.am (MODULES): Add it.
* nix/scripts/substitute-binary.in: New file.
* config-daemon.ac: Produce nix/scripts/substitute-binary.
* daemon.am (nodist_pkglibexec_SCRIPTS): Add
  nix/scripts/substitute-binary.
* guix/store.scm (substitutable-path-info): Use the
  `query-substitutable-path-infos' RPC.
* nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'.
* pre-inst-env.in: Set `NIX_SUBSTITUTERS'.
* test-env.in: Leave `NIX_SUBSTITUTERS' unchanged.  Set
  `GUIX_BINARY_SUBSTITUTE_URL, and create
  $NIX_STATE_DIR/substituter-data.
  Run `guix-daemon' within `./pre-inst-env'.
* tests/store.scm ("substitute query"): New test.
2013-04-03 22:44:39 +02:00
Ludovic Courtès 2c6ab6ccd4 store: Add `store-path-hash-part'.
* guix/store.scm (store-path-hash-part): New procedure.
* tests/store.scm ("store-path-hash-part", "store-path-hash-part #f"):
  New tests.
2013-04-01 17:35:27 +02:00
Ludovic Courtès ef8c03407d gnu-maintenance: Adjust `http-fetch' to the various Guile versions.
* guix/gnu-maintenance.scm (http-fetch): Try #:streaming? #t, or
  'http-get*', or 'http-get' as a last resort.  Check whether DATA is
  #f, a string, or an input port.
2013-04-01 00:41:55 +02:00
Ludovic Courtès fdfd3d5d9c pull: Switch to the cgit URL.
* guix/scripts/pull.scm (%snapshot-url): Switch to the cgit URL, given
  that the Hydra one is not currently available.
2013-03-31 12:46:28 +02:00
Ludovic Courtès a18eda2747 packages: Add `native-search-paths' field and honor it.
* guix/packages.scm (<search-path-specification>): New record type.
  (search-path-specification->sexp): New procedure.
  (<package>)[native-search-paths]: New field.
  (package-derivation): Accumulate the search paths, and pass them
  as #:search-paths toe BUILDER.
* guix/build-system/gnu.scm (gnu-build): Add #:search-paths.  Compute
  `implicit-search-paths'.  Pass #:search-paths in BUILDER.
* guix/build-system/perl.scm (perl-build): Add #:search-paths, pass it
  to BUILDER with the search paths of PERL.
* guix/build-system/cmake.scm (cmake-build): Add #:search-paths, pass it
  to BUILDER.
* guix/build-system/trivial.scm (trivial-build): Add #:search-paths,
  ignore it.
* guix/build/gnu-build-system.scm (set-paths): Add #:search-paths.
  Remove explicit settings of CPATH, LIBRARY_PATH, and PKG_CONFIG_PATH.
  Instead, walk SEARCH-PATHS and call `set-path-environment-variable'
  for them.
* guix/build/perl-build-system.scm (perl-build): Remove PERL5LIB setting.
* tests/packages.scm ("search paths"): New test.
* gnu/packages/bootstrap.scm (%bootstrap-guile)[raw]: Add
  #:search-paths.
  (%bootstrap-gcc): Add `native-search-paths' field.
* gnu/packages/perl.scm (perl): Likewise.
* gnu/packages/pkg-config.scm (pkg-config): Likewise.
* gnu/packages/glib.scm (intltool): Remove `arguments'.
* gnu/packages/avahi.scm (avahi): Remove #:phases.
2013-03-30 22:57:03 +01:00
Ludovic Courtès a96748bb46 build-system/gnu: Remove #:path-exclusions parameter.
* guix/build/gnu-build-system.scm (set-paths): Remove `path-exclusions'
  parameter.  Replace `relevant-input-directories' by
  `input-directories'.
* guix/build-system/gnu.scm (gnu-build): Remove `path-exclusions'
  parameter; don't pass it in BUILDER.
* guix/build-system/cmake.scm (cmake-build): Likewise.
2013-03-30 21:46:59 +01:00
Ludovic Courtès 4928e50033 Merge branch 'master' into core-updates
Conflicts:
	Makefile.am
	gnu/packages/base.scm
2013-03-29 21:44:31 +01:00
Ludovic Courtès 3f5a932eea snix: Adjust import to current Nixpkgs input attribute names.
* guix/snix.scm (snix-derivation->guix-package): Use the new names
  `nativeBuildInputs' and `propagatedNativeBuildInputs'.
2013-03-29 00:16:58 +01:00
Nikita Karetnikov f9bbf2a819 gnu-maintenance: Improve 'official-gnu-packages'; add related procedures.
* guix/gnu-maintenance.scm (http-fetch): Return an input port.
  (<gnu-package-descriptor>): Add it.
  (official-gnu-packages): Use <gnu-package-descriptor>.
  (find-packages): Add it.
  (gnu-package?): Adjust accordingly.
2013-03-28 22:00:10 +00:00
Cyril Roelandt c6bded8a29 Add (guix build-system cmake).
* guix/build/cmake-build-system.scm, guix/build-system/cmake.scm: New files.
* Makefile.am (MODULES): Add them.
2013-03-28 21:04:54 +01:00
Ludovic Courtès c9f94132ca download: Remove unreliable GNU mirror.
* guix/download.scm (%mirrors)[gnu]: Remove ftp.chg.ru.
2013-03-27 15:50:18 +01:00
Ludovic Courtès 128663e4c8 store: Really disable file name canonicalization for derivation inputs.
* guix/store.scm (write-contents)[call-with-binary-input-file]: Set
  %FILE-PORT-NAME-CANONICALIZATION to #f.
* gnu/packages.scm (search-patch, search-bootstrap-binary): Leave
  %FILE-PORT-NAME-CANONICALIZATION unchanged.  This reverts 9776ebb.
2013-03-22 23:15:34 +01:00
Ludovic Courtès 238f739777 store: Use `sendfile' when available.
* guix/store.scm (write-contents)[call-with-binary-input-file]: New
  procedure.
  Use `sendfile' instead of `dump' when available.  Add `size'
  parameter.
  (write-file): Update caller.
2013-03-22 23:15:34 +01:00
Ludovic Courtès a4f08f9258 guix package: Report packages to be removed/installed.
* guix/scripts/package.scm (guix-package)[process-actions](show-what-to-remove/install):
  New procedure.
  Call it before `show-what-to-build'.
2013-03-18 23:04:07 +01:00
Ludovic Courtès 0bb1aa9e05 derivations: Optimize `build-expression->derivation'.
This reduces the execution time of
"guix build -e '(@ (gnu packages emacs) emacs)' -d" by 6%, from
1.15s to 1.08s.

* guix/derivations.scm (build-expression->derivation): Write the builder
  as UTF-8.
2013-03-16 17:23:17 +01:00
Ludovic Courtès d80855999a derivations: Optimize `write-derivation'.
This reduces the execution time of
"guix build -e '(@ (gnu packages emacs) emacs)' -d" by 25%, from
1.54 s. to 1.15s.

* guix/derivations.scm (write-sequence, write-list, write-tuple): New
  procedures.
  (write-derivation)[list->string, write-list]: Remove.
  [write-string-list, write-output, write-input, write-env-var]: New helpers.
  Rewrite in terms of these new helpers.
2013-03-16 16:48:22 +01:00
Ludovic Courtès 993fb66dd2 guix package: Gracefully handle `official-gnu-packages' failure.
* guix/gnu-maintenance.scm (http-fetch): Error out when DATA is #f.
* guix/scripts/package.scm (check-package-freshness): Wrap
  `gnu-package?' call in `false-if-exception'.
  Reported by Cyril Roelandt <tipecaml@gmail.com>.
2013-03-16 00:59:19 +01:00
Ludovic Courtès ef86c39f27 ui: Gracefully report failures to connect to the daemon.
* guix/store.scm (&nix-connection-error): New condition type.
  (open-connection): Translate `system-error' during the `connect' call
  into `&nix-connection-error'.
* guix/ui.scm (call-with-error-handling): Add case for `nix-connection-error?'.
* guix/scripts/package.scm (guix-package): Move `open-connection' call
  within `with-error-handling'.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/download.scm (guix-download): Move body within
  `with-error-handling'.
2013-03-07 19:44:14 +01:00
Nikita Karetnikov 30db6af1de utils: Add 'wrap-program'.
* guix/build/utils.scm (wrap-program): New procedure.
2013-03-07 00:46:23 +01:00
Ludovic Courtès 1fb78cb2c3 packages: Remove the default value for `license'.
* guix/packages.scm (<package>): Remove the default value for `license'.
* gnu/packages/bootstrap.scm (package-from-tarball,
  %bootstrap-glibc, %bootstrap-gcc): Initialize `license'.
* tests/packages.scm (dummy-package): Likewise.
2013-03-07 00:42:18 +01:00
Ludovic Courtès 6ba9dd813d Revert "utils: Add 'wrap-program'."
This reverts commit 02065130de.
2013-03-07 00:36:14 +01:00
Nikita Karetnikov 02065130de utils: Add 'wrap-program'.
* guix/build/utils.scm (wrap-program): New procedure.
2013-03-06 21:03:26 +00:00
Nikita Karetnikov bbd60260dd licenses: Add 'x11-style'.
* guix/licenses.scm (x11-style): New variable.
2013-03-06 20:40:11 +00:00
Andreas Enge 0820a58b3c gnu: xorg: Fix http mirror and uncomment xcb packages.
* guix/download.scm (%mirrors): Fix main http mirror address.
* gnu/packages/xorg.scm (libpthread-stubs, libxcb, xcb-proto): Uncomment
     and add licenses.
2013-03-06 13:28:01 +01:00
Ludovic Courtès 6a917ef7e6 gnu-maintenance: Clarify `releases'.
* guix/gnu-maintenance.scm (releases): Change to use `match' and
  `match-lambda'.  Add `release-file' auxiliary function.
2013-03-05 22:31:19 +01:00
Ludovic Courtès 296540a6db gnu-maintenance: Fix `gnu-package?' for packages lacking a `source'.
* guix/gnu-maintenance.scm (gnu-package?): Support PACKAGE when its
  source is #f.
2013-03-05 22:25:40 +01:00
Ludovic Courtès 19777ae6ea guix package: Recover from freshness check transient errors.
* guix/scripts/package.scm (check-package-freshness): Ignore
  `getaddrinfo-error' and `ftp-error' exceptions.
2013-03-05 22:24:19 +01:00
Ludovic Courtès ef010c0f3d guix package: Inform about new upstream versions of GNU packages.
* guix/gnu-maintenance.scm (gnu-package?): New procedure.
* guix/scripts/package.scm (waiting): New macro.
  (check-package-freshness): New procedure.
  (guix-package)[process-actions]: Use it.
* doc/guix.texi (Invoking guix package): Mention the feature.
2013-03-05 20:35:47 +01:00
Ludovic Courtès 71eb5c1067 gnu: Add intltool.
* guix/download.scm (%mirrors): Add `gnome' mirrors.
* gnu/packages/glib.scm (intltool): New variable.
2013-03-05 19:09:53 +01:00
Ludovic Courtès 12761f48ea utils: Add a #:follow-symlinks? parameter to `copy-recursively'.
* guix/build/utils.scm (copy-recursively): Turn `log' into a keyword
  parameter.  Add the `follow-symlinks?' parameter and honor it.
2013-03-05 19:03:39 +01:00
Ludovic Courtès e65df6a63a utils: Add `delete-file-recursively'.
* guix/build/utils.scm (delete-file-recursively): New procedure.
2013-03-05 18:53:53 +01:00
Ludovic Courtès 81eec00cb2 Merge branch 'master' into core-updates
Conflicts:
	Makefile.am
	guix/scripts/gc.scm
	guix/scripts/package.scm
	guix/ui.scm
	tests/guix-package.sh
2013-03-04 23:27:24 +01:00
Andreas Enge 8689a1908a guix: build: Add "share/pkgconfig" to PKG_CONFIG_PATH, as used by xorg.
* guix/build/gnu-build-system.scm (set-paths): Add "share/pkgconfig"
     to PKG_CONFIG_PATH.
2013-03-04 10:14:34 +01:00
Ludovic Courtès 08fd1ebefd Add (guix build-system perl).
* guix/build-system/perl.scm, guix/build/perl-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
* guix/build-system/gnu.scm (standard-inputs): Make public.
2013-03-04 00:48:00 +01:00
Ludovic Courtès 6af3101999 download: Add CPAN mirrors.
* guix/download.scm (%mirrors)[cpan]: New URLs.
2013-03-04 00:48:00 +01:00
Ludovic Courtès eb0880e71d ui: Factorize `read/eval-package-expression'.
* guix/scripts/package.scm (read/eval-package-expression): Move to...
* guix/ui.scm (read/eval-package-expression): ... here.
* guix/scripts/build.scm (derivations-from-package-expressions): Use it.
2013-03-01 21:55:42 +01:00
Ludovic Courtès 5d4b411f8a guix package: Add `--install-from-expression'.
* guix/scripts/package.scm (read/eval-package-expression): New
  procedure.
  (show-help): Add `-e'.
  (%options): Likewise.
  (guix-package)[process-actions]: Handle ('install . p) pairs, where P
  is a package.
* tests/guix-package.sh: Add `boot_make_drv'.  Use `-i $boot_make_drv'
  once, and then use `-e $boot_make'.
* doc/guix.texi (Invoking guix package): Document `-e'.
2013-03-01 21:54:56 +01:00
Ludovic Courtès ba8b732d20 guix gc: Add `--references' and `--referrers'.
* guix/scripts/gc.scm (show-help): Update.
  (%options): Add `--references' and `--referrers'.
  (guix-gc)[symlink-target, store-directory]: New procedures.
  Handle the `list-references' and `list-referrers' actions.
* tests/guix-gc.sh: Add tests for `--references'.
* doc/guix.texi (Invoking guix gc): Document `--references' and
  `--referrers'.
2013-02-27 23:16:00 +01:00
Ludovic Courtès fae31edcec store: Add queries for references & co.
* guix/store.scm (operation-id)[query-valid-derivers]: New value.
  (references, referrers, valid-derivers, query-derivation-outputs): New
  procedures.
* tests/store.scm ("references", "derivers"): New tests.
2013-02-27 22:40:35 +01:00
Ludovic Courtès da9bf2efc5 pull: Distinguish "already up to date" from "updated".
* guix/ui.scm (show-what-to-build): Return (length req*).
* guix/scripts/pull.scm (guix-pull): Print an "already up to date"
  message when there's nothing to build.
2013-02-27 20:55:42 +01:00
Ludovic Courtès a1c1467756 pull: Build (guix build download) first, because of the (gnutls) autoload.
* guix/scripts/pull.scm (unpack): Build (guix build download) first, as
  done in 855a8ad71d.
  Reported by Andreas Enge <andreas@enge.fr>.
2013-02-27 20:55:42 +01:00
Ludovic Courtès 69ce1ffc7d Add "guix pull".
* guix/scripts/pull.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (Invoking guix pull): New node.
  (Invoking guix package): Add cross-ref to it.
* guix/ui.scm (config-directory): New procedure.
* scripts/guix.in: When `GUIX_UNINSTALLED' is undefined, add
  $XDG_CONFIG_HOME/guix/latest to the search path.
* po/POTFILES.in: Add guix/scripts/pull.scm.
2013-02-27 20:55:42 +01:00
Ludovic Courtès 7650e148f6 ui: Factorize `show-what-to-build'.
* guix/scripts/package.scm (guix-package)[show-what-to-build]: Move to..
* guix/ui.scm (show-what-to-build): ... here.  Add a `store'
  parameter'.  Adjust callers.
* guix/scripts/build.scm (guix-build): Use it.  Remove `req' and `req*'
  variables.
2013-02-27 20:55:41 +01:00
Ludovic Courtès bdeee95a21 ui: Add temporary file handling and atomic symlink switch.
* guix/scripts/download.scm (call-with-temporary-output-file): Move to
  ui.scm.
* guix/scripts/package.scm (switch-symlinks): Likewise.
* guix/ui.scm (call-with-temporary-output-file, switch-symlinks): New
  procedures.
2013-02-27 20:55:41 +01:00
Ludovic Courtès cc68ccc5b0 download: Adjust to `http-get*' deprecation.
* guix/build/download.scm (http-fetch): Adjust to use #:streaming? when
  using Guile 2.0.8+.
2013-02-27 20:55:41 +01:00
Ludovic Courtès e95da44576 derivations: Add a search path parameter for module derivations.
* guix/derivations.scm (imported-modules, compiled-modules): Add a
  `module-path' parameter.  Use it instead of %LOAD-PATH.
2013-02-27 20:55:41 +01:00
Ludovic Courtès 05c0ac721e store: Add the `%daemon-socket-file' parameter.
* guix/store.scm (%daemon-socket-file): New variable.
  (open-connection): Use it as the default value for FILE.
2013-02-27 20:55:41 +01:00
Ludovic Courtès dc3f1809cf scripts: Remove hyphen in the command name shown by `--version'.
* guix/scripts/build.scm (%options): Remove hyphen from the name passed
  to `show-version-and-exit'.
* guix/scripts/download.scm (%options): Likewise.
* guix/scripts/gc.scm (%options): Likewise.
* guix/scripts/import.scm (%options): Likewise.
* guix/scripts/package.scm (%options): Likewise.
2013-02-27 20:55:40 +01:00
Ludovic Courtès c07512179e scripts: Remove initialization now redundant with `initialize-guix'.
* guix/scripts/build.scm (guix-build): Remove calls to `install-locale',
  `textdomain', etc., now redundant with `initialize-guix'.
* guix/scripts/download.scm (guix-download): Likewise.
* guix/scripts/import.scm (guix-import): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/ui.scm: Remove export of `install-locale' and `initialize-guix'.
  (initialize-guix): Add docstring.
2013-02-27 20:55:40 +01:00
Mark H Weaver 868c923f13 Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.

* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'.  Remove 'guix-build',
  'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.

  (MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
  'guix/scripts/import.scm', 'guix/scripts/package.scm', and
  'guix/scripts/gc.scm'.

* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'.  Remove 'guix-build',
  'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.

* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
  guix-package.in: Remove shell script boilerplate.  Move to guix-COMMAND.in
  to guix/scripts/COMMAND.scm.  Rename module from (guix-COMMAND) to
  (guix scripts COMMAND).  Change "guix-COMMAND" to "guix COMMAND" in
  usage help string.

* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
  Export $GUIX_UNINSTALLED.

* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
  tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
  "guix-COMMAND".

* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
  "guix COMMAND".

* po/POTFILES.in: Update.
2013-02-27 20:55:40 +01:00
Ludovic Courtès 5f7c5a97ba packages: Add `package-output'.
* guix/packages.scm (package-output): New procedure.
* tests/packages.scm ("package-output"): New test.
2013-02-27 20:55:39 +01:00
Ludovic Courtès 790b8e0ebe build-system/gnu: Make the strip behavior of `static-package' configurable.
* guix/build-system/gnu.scm (static-package): Add #:strip-all? keyword
  parameter.
2013-02-27 20:55:38 +01:00
Mark H Weaver 6c7b6a51a4 Add version-compare and version>? to utils.scm.
* guix/utils.scm (version-compare, version>?): New exported procedures,
  based on version-string>?, which was formerly in gnu-maintenance.scm.

* guix/gnu-maintenance.scm (version-string>?): Removed procedure.
  (latest-release): Use 'version>?' instead of 'version-string>?'.
2013-02-27 20:55:38 +01:00
Andreas Enge ca8def6e6f Patch-shebang: Do not add space after interpreter without argument.
* guix/build/utils.scm (patch-shebang): Do not add a space after a command
  interpreter not followed by an argument; this made two tests of
  coreutils fail.
2013-02-23 23:27:46 +01:00
Andreas Enge 11996d85d3 Patch-shebang: Handle "#!/usr/bin/env command"
* guix/build/utils.scm (patch-shebang): Handle replacement of
   "#!.*/env CMD ARGS" by "#!/nix/store/path/.../to/CMD ARGS".
2013-02-23 20:32:03 +01:00
Andreas Enge 149acc2981 download: Add X.org mirrors.
* guix/download.scm (%mirrors): Add `xorg'.
2013-02-23 19:01:19 +01:00
Ludovic Courtès 4d60610ad7 pull: Distinguish "already up to date" from "updated".
* guix/ui.scm (show-what-to-build): Return (length req*).
* guix/scripts/pull.scm (guix-pull): Print an "already up to date"
  message when there's nothing to build.
2013-02-22 21:08:06 +01:00
Ludovic Courtès 7b50c68455 pull: Build (guix build download) first, because of the (gnutls) autoload.
* guix/scripts/pull.scm (unpack): Build (guix build download) first, as
  done in 855a8ad71d.
  Reported by Andreas Enge <andreas@enge.fr>.
2013-02-22 20:01:29 +01:00
Ludovic Courtès f651b477b7 Add "guix pull".
* guix/scripts/pull.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (Invoking guix pull): New node.
  (Invoking guix package): Add cross-ref to it.
* guix/ui.scm (config-directory): New procedure.
* scripts/guix.in: When `GUIX_UNINSTALLED' is undefined, add
  $XDG_CONFIG_HOME/guix/latest to the search path.
* po/POTFILES.in: Add guix/scripts/pull.scm.
2013-02-20 23:47:16 +01:00
Ludovic Courtès 9bb2b96aab ui: Factorize `show-what-to-build'.
* guix/scripts/package.scm (guix-package)[show-what-to-build]: Move to..
* guix/ui.scm (show-what-to-build): ... here.  Add a `store'
  parameter'.  Adjust callers.
* guix/scripts/build.scm (guix-build): Use it.  Remove `req' and `req*'
  variables.
2013-02-20 23:46:57 +01:00
Ludovic Courtès c61b026e3a ui: Add temporary file handling and atomic symlink switch.
* guix/scripts/download.scm (call-with-temporary-output-file): Move to
  ui.scm.
* guix/scripts/package.scm (switch-symlinks): Likewise.
* guix/ui.scm (call-with-temporary-output-file, switch-symlinks): New
  procedures.
2013-02-20 23:03:24 +01:00
Ludovic Courtès 80736cdf20 download: Adjust to `http-get*' deprecation.
* guix/build/download.scm (http-fetch): Adjust to use #:streaming? when
  using Guile 2.0.8+.
2013-02-20 22:59:35 +01:00
Ludovic Courtès 8dcb0c55ab derivations: Add a search path parameter for module derivations.
* guix/derivations.scm (imported-modules, compiled-modules): Add a
  `module-path' parameter.  Use it instead of %LOAD-PATH.
2013-02-20 21:08:09 +01:00
Ludovic Courtès 9fd72fb1ff store: Add the `%daemon-socket-file' parameter.
* guix/store.scm (%daemon-socket-file): New variable.
  (open-connection): Use it as the default value for FILE.
2013-02-18 21:53:59 +01:00
Ludovic Courtès fdca1c079b scripts: Remove hyphen in the command name shown by `--version'.
* guix/scripts/build.scm (%options): Remove hyphen from the name passed
  to `show-version-and-exit'.
* guix/scripts/download.scm (%options): Likewise.
* guix/scripts/gc.scm (%options): Likewise.
* guix/scripts/import.scm (%options): Likewise.
* guix/scripts/package.scm (%options): Likewise.
2013-02-17 22:19:32 +01:00
Ludovic Courtès 633f045f62 scripts: Remove initialization now redundant with `initialize-guix'.
* guix/scripts/build.scm (guix-build): Remove calls to `install-locale',
  `textdomain', etc., now redundant with `initialize-guix'.
* guix/scripts/download.scm (guix-download): Likewise.
* guix/scripts/import.scm (guix-import): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/ui.scm: Remove export of `install-locale' and `initialize-guix'.
  (initialize-guix): Add docstring.
2013-02-17 15:38:02 +01:00
Mark H Weaver e49951eb3e Replace individual scripts with master 'guix' script.
* scripts/guix.in: New script.

* Makefile.am (bin_SCRIPTS): Add 'scripts/guix'.  Remove 'guix-build',
  'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.

  (MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm',
  'guix/scripts/import.scm', 'guix/scripts/package.scm', and
  'guix/scripts/gc.scm'.

* configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'.  Remove 'guix-build',
  'guix-download', 'guix-import', 'guix-package', and 'guix-gc'.

* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
  guix-package.in: Remove shell script boilerplate.  Move to guix-COMMAND.in
  to guix/scripts/COMMAND.scm.  Rename module from (guix-COMMAND) to
  (guix scripts COMMAND).  Change "guix-COMMAND" to "guix COMMAND" in
  usage help string.

* pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH.
  Export $GUIX_UNINSTALLED.

* tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh,
  tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of
  "guix-COMMAND".

* doc/guix.texi: Replace all occurrences of "guix-COMMAND" with
  "guix COMMAND".

* po/POTFILES.in: Update.
2013-02-16 22:17:37 -05:00
Ludovic Courtès d510ab4614 packages: Add `package-output'.
* guix/packages.scm (package-output): New procedure.
* tests/packages.scm ("package-output"): New test.
2013-02-16 01:37:26 +01:00
Ludovic Courtès 9011e97f8d build-system/gnu: Make the strip behavior of `static-package' configurable.
* guix/build-system/gnu.scm (static-package): Add #:strip-all? keyword
  parameter.
2013-02-14 01:12:24 +01:00
Mark H Weaver 0d1e6ce4d2 Add version-compare and version>? to utils.scm.
* guix/utils.scm (version-compare, version>?): New exported procedures,
  based on version-string>?, which was formerly in gnu-maintenance.scm.

* guix/gnu-maintenance.scm (version-string>?): Removed procedure.
  (latest-release): Use 'version>?' instead of 'version-string>?'.
2013-02-12 20:34:25 -05:00
Cyril Roelandt b1426f1785 gnu: Add tmux. licenses: add ISC.
* gnu/packages/tmux.scm: New file.
* Makefile.am (MODULES): Use it.
* guix/licenses.scm: add ISC.
2013-02-11 22:23:29 +01:00
Ludovic Courtès cab249615d Re-export `%current-system' from (guix packages).
* guix/packages.scm: Re-export `%current-system'.
* gnu/packages/bdw-gc.scm, gnu/packages/gawk.scm,
  gnu/packages/gperf.scm, gnu/packages/libffi.scm,
  gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm,
  gnu/packages/lout.scm, gnu/packages/m4.scm,
  gnu/packages/multiprecision.scm, gnu/packages/ncurses.scm,
  gnu/packages/perl.scm, gnu/packages/pkg-config.scm,
  gnu/packages/readline.scm, gnu/packages/recutils.scm,
  gnu/packages/scheme.scm: Remove (guix utils) import.
2013-02-10 17:23:48 +01:00
Ludovic Courtès a38f0ab0b9 build-system/gnu: Clarify docstring of `package-with-extra-configure-variable'.
* guix/build-system/gnu.scm (package-with-extra-configure-variable): Add
  "recursively" in the docstring.
2013-02-08 18:03:36 +01:00
Ludovic Courtès 1be77eac08 union: Don't warn when colliding leaves point to the same file.
* guix/build/union.scm (union-build)[resolve-collision]: Pass LEAVES
  through `delete-duplicates'; warn iff the result contains more than
  one item.
2013-02-06 23:04:10 +01:00
Ludovic Courtès 6211223021 union: Delete duplicates when passed the same input several times.
* guix/build/union.scm (union-build): Prepend "." to the result of
  `union-tree', to match the expectations of `delete-duplicate-leaves'.
  Don't do mkdir when SUBDIR is ".".
* tests/union.scm ("union-build"): Keep duplicates in %BOOTSTRAP-INPUTS.
2013-02-06 23:04:10 +01:00
Andreas Enge 6d36a6f3b0 licenses: Add new meta-license fsf-free.
* guix/licenses.scm (fsf-free): New record with constructor.
2013-02-05 23:56:42 +01:00
Ludovic Courtès 0f3d2504f7 store: Add substitute-related procedures.
* guix/store.scm (has-substitutes?, substitutable-paths,
  read-substitutable-path-list, substitutable-path-info): New
  procedures.
  (<substitutable>): New record type.
  (read-arg): Add `substitutable-path-info'.  Change `hash' pattern
  variable to `base16' literal.
* tests/store.scm ("no substitutes"): New test.
2013-02-04 08:58:48 +01:00
Ludovic Courtès 63193ebfdc store: Update to protocol 1.12.
* guix/store.scm (%protocol-version): Bump.
  (operation-id): Comment out `query-substitutable-path-info'.
  Rename `query-valid-paths' to `query-all-valid-paths'.  Add
  `query-path-from-hash-part', `query-substitutable-path-infos',
  `query-valid-paths', and `query-substitutable-paths'.
  (set-build-options): Add `binary-caches' keyword parameter.  When
  using a server >= 1.12, send the list of binary caches.
  (query-path-hash): Use the `store-path' type, for clarity.
2013-02-04 08:58:48 +01:00
Ludovic Courtès 238e43b9fa store: Write string length as a 32-bit integer.
* guix/store.scm (write-string): Write L as a 32-bit integer.  Bug
  introduced in 82c38fe64c ("store:
  Micro-optimize `write-string'.")
2013-02-04 08:58:47 +01:00
Ludovic Courtès 299112d36e guix-package: Report `--search' matches in recutils format.
* guix/ui.scm (fill-paragraph, string->recutils, package->recutils): New
  procedures.
* guix-package.in (guix-package)[process-query]: Use `package->recutils'
  to display package meta-data.
* tests/guix-package.sh: Adjust test.
* tests/ui.scm: New file.
* Makefile.am (TESTS): Add it.
* doc/guix.texi (Invoking guix-package): Adjust `--search'
  documentation, and give an example.
2013-02-01 13:16:41 +01:00
Ludovic Courtès bbdb3ffaf3 store: Don't expect build logs to be UTF-8-encoded.
* guix/store.scm (read-latin1-string): New procedure.
  (process-stderr): Use it instead of `read-string'.
  Reported by Andreas Enge <andreas@enge.fr>.
2013-01-31 17:49:54 +01:00
Ludovic Courtès d0840e4a23 derivations: Memoize `read-derivation'.
* guix/derivations.scm (read-derivation): Rename to...
  (%read-derivation): ... this.
  (read-derivation): New procedure.
  This reduces the execution of "guix-build gdb" from 2.5s to 1.7s.
2013-01-30 18:58:38 +01:00
Ludovic Courtès fce2394e7d store: Slightly improve memoization hashing.
* guix/store.scm (open-connection): Call `make-hash-table' with 100.
  (add-text-to-store): Move TEXT first in ARGS, for better `hash'
  results.
  (add-to-store): Likewise, move ST first.
2013-01-30 17:05:54 +01:00
Ludovic Courtès a9ebd9efd0 store: Remove the `fixed?' parameter from `add-to-store'.
* guix/store.scm (add-to-store): Remove the `fixed?' parameter from the
  public interface.
* gnu/packages/bootstrap.scm, guix-download.in, guix/derivations.scm,
  guix/packages.scm, tests/derivations.scm: Update all callers
  accordingly.
2013-01-30 16:30:49 +01:00
Ludovic Courtès fd060fd30d store: Avoid use of `set!'.
* guix/store.scm (operation): New macro.
  (define-operation): Define in terms of `operation'.
  (add-text-to-store): Define using `operation', and remove now
  unnecessary `set!'.
  (add-to-store): Likewise.
  (add-text-to-store/cached, add-to-store/cached): Remove.
2013-01-30 16:22:33 +01:00
Ludovic Courtès 82c38fe64c store: Micro-optimize `write-string'.
* guix/store.scm (write-string): Optimize to write the length, contents,
  and padding all at once.  This yields a 2% improvement on the
  execution time of "guix-build gdb".
2013-01-30 00:37:26 +01:00
Ludovic Courtès 473b03b3c6 Gracefully handle failure to install the current locale.
* guix/ui.scm (install-locale): New procedure.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
  guix-package.in: Use it instead of (setlocale LC_ALL "").
2013-01-30 00:09:32 +01:00
Ludovic Courtès bdcf35a6b2 store: Cache `add-text-to-store' results.
* guix/store.scm (<nix-server>)[atts-cache]: New field.
  (add-text-to-store/cached): New procedure.  Use it as a wrapper around
  `add-text-to-store'.
  When running "guix-build gdb", this reduces the number of RPCs from
  3048 to 289, and execution time from 4.7s to 2.6s.
2013-01-30 00:09:32 +01:00
Ludovic Courtès 2c3f47ee3a store: Make the `add-to-store' cache per-connection.
* guix/store.scm (<nix-server>)[ats-cache]: New field.
  (open-connection): Update accordingly.
  (add-to-store/cached): Use (nix-server-add-to-store-cache SERVER)
  instead of a weak hash table.
2013-01-30 00:09:32 +01:00
Ludovic Courtès a7b6ffee68 store: Make `add-to-store' memoizing.
* guix/store.scm (add-to-store/cached): New variable.
  Use it as the new `add-to-store'.
  This reduces the number of RPCs when doing "guix-build gdb" from 5009
  to 3053, and the execution time from 7s to 3.9s.
2013-01-29 00:16:18 +01:00
Ludovic Courtès 47f9db4128 download: Add Apache mirrors.
* guix/download.scm (%mirrors): Add `apache'.
2013-01-25 21:52:08 +01:00
Ludovic Courtès 67158a4900 download: Follow HTTP redirection upon 301 "moved permanently".
* guix/build/download.scm (http-fetch): Follow redirections upon 301.
  This is what `downloads.sourceforge.net' returns, for instance.
2013-01-25 21:52:08 +01:00
Ludovic Courtès dd6b9a3790 packages: Mark the `inputs' field of <package> as thunked.
* guix/packages.scm (<package>)[inputs]: Mark as thunked.
  (package-derivation)[expand-input]: Remove case where the input is a
  procedure.
* tests/packages.scm ("trivial with system-dependent input"): Remove
  `lambda', and use (%current-system).
* gnu/packages/bootstrap.scm (package-from-tarball): Likewise for `inputs'.
  (%bootstrap-glibc, %bootstrap-gcc): Likewise.
* gnu/packages/scheme.scm (mit-scheme): Likewise.
2013-01-24 23:33:51 +01:00
Cyril Roelandt d192efae07 gnu: Add OCaml. licenses: Add QPL.
* gnu/packages/ocaml.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/licenses.scm: New variable.
2013-01-24 00:03:43 +01:00
Ludovic Courtès 21c203a53a packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
  (package-derivation): Adjust accordingly.  Parameterize
  %CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.

* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
  `package-arguments' to always return a list, and return a list.
  (package-with-extra-configure-variable): Likewise.
  (static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
  gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
  static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
  from a lambda to a list, and use (%current-system) as needed.
  (nix-system->gnu-triplet, boot-triplet): Have the first argument
  default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
  default to (%current-system).
  (%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
  expect `package-arguments' to return a list.
  (%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 23:33:09 +01:00
Ludovic Courtès bbb7a00e9a define-record-type*: Add the `thunked' field definition keyword.
* guix/utils.scm (define-record-type*)[make-syntactic-constructor]: Add
  a `thunked' parameter.
  (thunked-field?, field-bindings): New procedures.  Use the latter when
  generating `letrec*' bindings.
  [thunked-field?, thunked-field-accessor-name, field-spec->srfi-9,
  thunked-field-accessor-name]: New procedures.
  Use them when generating the `define-record-type' form, and to
  generated thunk field accessors, along call to
  `make-syntactic-constructor' with the new argument.
* tests/utils.scm ("define-record-type* & thunked",
  "define-record-type* & thunked & default",
  "define-record-type* & thunked & inherited"): New tests.
2013-01-23 23:33:09 +01:00
Ludovic Courtès f153d89155 packages: Remove redundant test for inputs-as-procedures.
* guix/packages.scm (package-derivation)[expand-input]: Remove redundant
  test when the input is a procedure.
2013-01-22 00:17:42 +01:00
Ludovic Courtès 483f11589e download: Add HTTPS support.
* guix/build/download.scm: Autoload (gnutls).
  (tls-wrap): New procedure.
  (open-connection-for-uri): Add support for `https'.  Wrap the socket
  with `tls-wrap' in that case.
  (url-fetch): Add `https'.
* guix/download.scm (gnutls-derivation): New procedure.
  (url-fetch)[need-gnutls?]: New variable.
  Call `gnutls-derivation' when NEED-GNUTLS? is true, and add its output
  to the `GUILE_LOAD_PATH' env. var. in that case.
2013-01-20 22:54:36 +01:00
Ludovic Courtès e509d1527d packages: Have `package-derivation' return a <derivation> as a second value.
* guix/packages.scm (cache): Change the `drv' argument to `thunk'.
  Memoize all the return values of THUNK.
  (cached-derivation): Remove.
  (cached): New macro.
  (package-derivation): Use `cached' instead of `(or (cached-derivation) …)'.
* doc/guix.texi (Defining Packages): Update accordingly.
2013-01-20 22:54:36 +01:00
Andreas Enge b387a1c5b2 gnu: Add Freetype.
licenses: Add freetype license.

* gnu/packages/freetype.scm: New file.
* guix/licenses.scm (freetype): New variable.
* Makefile.am (MODULES): Add freetype.scm.
2013-01-19 12:28:55 +01:00
Andreas Enge 99e6c1b18e licenses: Add 'vim'.
* guix/licenses.scm (vim): New variable.
2013-01-18 22:48:28 +01:00
Ludovic Courtès 1ffa7090b9 distro: Change the module name space to (gnu ...).
* distro: Rename to...
* gnu: ... this.  Update module names accordingly.
* Makefile.am: Adjust accordingly.
* po/POTFILES.in: Likewise.
* distro.scm: Search for files under /gnu/packages instead of
  /distro/packages.
* gnu/packages/base.scm (ld-wrapper-boot3): Likewise.
2013-01-18 01:07:31 +01:00
Ludovic Courtès aba326f79c packages: Change `base32' to allow non-literal strings.
* guix/packages.scm (base32): Allow arguments that are not literal strings.
2013-01-17 15:45:05 +01:00
Ludovic Courtès 874e687428 doc: Start documenting derivations.
* doc/guix.texi (Defining Packages): Add cross-reference to
  "Derivations".
  (The Store): Add `build-derivations'.
  (Derivations): Populate.
2013-01-16 23:09:53 +01:00
Ludovic Courtès e531ac2ad9 doc: Start documenting (guix store).
* doc/guix.texi (The Store): Populate.
  (Introduction): Add cross-reference.  Change "package store" to "the
  store".
2013-01-15 23:32:13 +01:00
Nikita Karetnikov e2034de5d0 licenses: Add 'psfl'.
* guix/licenses.scm (psfl): New variable.
2013-01-15 09:54:38 +01:00
Ludovic Courtès 29c1793dc2 build-system/gnu: Allow the `source' argument to be #f.
* guix/build-system/gnu.scm (gnu-build): Allow SOURCE to be #f.
2013-01-15 01:05:39 +01:00
Ludovic Courtès 5b00f53526 snix: When unable to determine the version number, leave the URI unchanged.
* guix/snix.scm (snix-derivation->guix-package)[pretty-uri]: When
  VERSION is #f, return URI.
2013-01-14 23:45:54 +01:00
Andreas Enge 1ca982808a licenses: Add 'openldap2.8'.
* guix/licenses.scm (openldap2.8): New variable.
2013-01-13 23:18:58 +01:00
Ludovic Courtès 34fcbe3a10 store: In `open-connection', process all the server's stderr.
* guix/store.scm (open-connection): Loop until `process-stderr' returns #t.
2013-01-13 22:27:00 +01:00
Ludovic Courtès 01e354eb83 Merge branch 'core-updates'
Conflicts:
	guix/build/union.scm
2013-01-11 16:01:49 +01:00
Ludovic Courtès 28e5560421 download: Abbreviate URLs when displaying the progress report.
* guix/build/download.scm (uri-abbreviation): New procedure.
  (ftp-fetch, http-fetch): Use it instead of `uri->string' when calling
  `progress-proc'.  Reported by Andreas Enge.
2013-01-11 15:41:58 +01:00
Ludovic Courtès a06a99ff77 build-system/gnu: Improve support for "lib" outputs; support "doc" outputs.
* guix/build/gnu-build-system.scm (configure)[package-name]: New
  procedure.
  When LIBDIR is true and INCLUDEDIR is false, add
  --includedir=LIBDIR/include.
  Add support for --docdir when a "doc" output exists.
2013-01-10 00:08:40 +01:00
Ludovic Courtès b2d58cd80a union: Detect collisions, and delete duplicate leaves.
* guix/build/union.scm (delete-duplicate-leaves): New procedure.
  (union-build)[leaf=?, resolve-collision]: New procedures.
  Use `delete-duplicate-leaves' on the result of `tree-union'.
* tests/union.scm ("delete-duplicate-leaves, default",
  "delete-duplicate-leaves, file names"): New tests.
2013-01-09 22:10:06 +01:00
Ludovic Courtès 784bb1f37b derivations: Fix `derivation-prerequisites-to-build' when outputs are there.
Before it would list inputs not built, even if the outputs of the given
derivation were already available.

* guix/derivations.scm (derivation-prerequisites-to-build): Add
  `outputs' keyword parameter.
  [built?, derivation-built?]: New procedures.
  [loop]: Add `sub-drvs' parameter.  Use `derivation-built?' to check if
  the SUB-DRVS of DRV are built before checking its inputs.
2013-01-09 08:38:57 +01:00
Ludovic Courtès 98fefb210a gnu-maintenance: Add `latest-release' and related tools.
* guix/gnu-maintenance.scm (ftp-server/directory, releases,
  version-string>?, latest-release, gnu-package-name->name+version): New
  procedures.
  (%package-name-rx): New variable.
2013-01-08 22:46:12 +01:00
Ludovic Courtès e7aa73ef09 snix: Use (guix licenses) variables.
* guix/snix.scm (snix-derivation->guix-package)[license-variable]: New
  procedure.
  Use it to determine the variable name for the license.
2013-01-07 22:32:28 +01:00
Ludovic Courtès ab8ed44fce snix: Gracefully handle `null' in Nix build inputs.
* guix/snix.scm (snix-derivation->guix-package)[convert-inputs]:
  Gracefully handle `null' as an input.
2013-01-07 22:23:50 +01:00
Ludovic Courtès e66ca1a5a8 download: Report the progress of HTTP downloads.
* guix/build/download.scm (http-fetch): Rename `bv' to `bv-or-port'.
  Use `http-get*' followed by `dump-port' when the former is available,
  and pass a progress procedure to `dump-port'.
2013-01-06 18:36:50 +01:00
Ludovic Courtès e47bac7902 download: Report the progress of FTP downloads.
* guix/build/download.scm (progress-proc): New procedure.
  (ftp-fetch): Call `ftp-size' on URI.  Use `progress-proc', and pass
  the result to `dump-port', along with #:buffer-size.
2013-01-06 18:35:23 +01:00
Ludovic Courtès fb83842efb ftp-client: Add `ftp-size'.
* guix/ftp-client.scm (ftp-size): New procedure.
2013-01-06 18:23:44 +01:00
Ludovic Courtès 4050e5d6cf Merge branch 'master' into core-updates
Conflicts:
	build-aux/download.scm
	distro/packages/autotools.scm
	distro/packages/base.scm
	distro/packages/bootstrap.scm
	distro/packages/lsh.scm
	distro/packages/make-bootstrap.scm
	distro/packages/ncurses.scm
	distro/packages/perl.scm
	tests/derivations.scm
	tests/union.scm
2013-01-06 17:33:02 +01:00
Ludovic Courtès 233e76769a Update license headers.
Change all license headers, except guix/build/* and ld-wrapper.scm, with
this code:

  (use-modules (guix build utils)
	       (srfi srfi-1))

  (fluid-set! %default-port-encoding "UTF-8")

  (substitute* (remove (lambda (f)
			 (or (string-contains f ".tar.")
			     (string-contains f ".git/")
			     (string-contains f ".so")
			     (string-suffix? ".o" f)
			     (string-suffix? ".a" f)
			     (string-suffix? ".go" f)
			     (string-suffix? ".pdf" f)
			     (string-suffix? ".png" f)
			     (string-suffix? ".info" f)
			     (equal? (basename f) "guix-daemon")
			     (equal? (basename f) "nix-setuid-helper")
			     (string-contains f "nix-upstream/")
			     (string-contains f "distro/packages/bootstrap/")))
		       (find-files "." "\\.[a-z]+$"))
    (("^([[:graph:]]+) This file is part of Guix." _ comment-start)
     (string-append comment-start " This file is part of GNU Guix."))
    (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start)
     (string-append comment-start
		    " GNU Guix --- Functional package management for GNU\n"))
    (("^([[:graph:]]+) Guix is " _ comment-start)
     (string-append comment-start " GNU Guix is "))
    (("^([[:graph:]]+) along with Guix." _ comment-start)
     (string-append comment-start " along with GNU Guix."))
    (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start)
     (string-append comment-start " Copyright ©")))

Change headers using C-style comments manually.
2013-01-06 00:47:50 +01:00
Ludovic Courtès 7244a5f74e derivations: Add `derivation-path->output-paths'.
* guix/derivations.scm (derivation-path->output-paths): New procedure.
* tests/derivations.scm ("multiple-output derivation"): Test it.
2013-01-05 23:51:13 +01:00
Ludovic Courtès 4155e2a909 Update license headers of builder-side code.
Change license headers with this script:

  (use-modules (guix build utils))

  (fluid-set! %default-port-encoding "UTF-8")

  (substitute* (cons "distro/packages/ld-wrapper.scm"
		     (find-files "guix/build" "\\.scm$"))
    (("^([[:graph:]]+) This file is part of Guix." _ comment-start)
     (string-append comment-start " This file is part of GNU Guix."))
    (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start)
     (string-append comment-start
		    " GNU Guix --- Functional package management for GNU\n"))
    (("^([[:graph:]]+) Guix is " _ comment-start)
     (string-append comment-start " GNU Guix is "))
    (("^([[:graph:]]+) along with Guix." _ comment-start)
     (string-append comment-start " along with GNU Guix."))
    (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start)
     (string-append comment-start " Copyright ©")))

* distro/packages/ld-wrapper.scm, guix/build/download.scm,
  guix/build/gnu-build-system.scm, guix/build/union.scm,
  guix/build/utils.scm: Update license headers.
2013-01-05 16:08:07 +01:00
Ludovic Courtès 7584f822bf utils: Add `which'.
* guix/build/utils.scm (which): New procedure.

* distro/packages/lsh.scm (lsh): Use `which' instead of `search-path'.
* distro/packages/perl.scm (perl): Likewise.
* distro/packages/attr.scm (attr): Likewise.
2013-01-05 16:02:32 +01:00
Ludovic Courtès 3441e16497 ui: Factorize bug-report information in `--help'.
* guix/config.scm.in (%guix-home-page-url): New variable.
* guix/ui.scm (show-bug-report-information): New procedure.
* guix-build.in (show-help): Use it.
* guix-download.in (show-help): Likewise.
* guix-import.in (show-help): Likewise.
* guix-package.in (show-help): Likewise.
2013-01-05 15:55:47 +01:00
Ludovic Courtès 93b0357575 utils: Use binary I/O primitives for `remove-store-references'.
* guix/build/utils.scm (fold-port-matches)[get-char]: New procedure.
  (remove-store-references): Use `put-u8' and `put-bytevector'.
2013-01-01 23:12:34 +01:00
Ludovic Courtès 4d058c6792 build-system/gnu: Add `static-package'.
* distro/packages/make-bootstrap.scm (static-package): Move to...
* guix/build-system/gnu.scm (static-package): ... here.  New procedure.
2013-01-01 16:55:34 +01:00
Ludovic Courtès b2adb3ae04 build-system/gnu: Add support for the "bin" output.
* guix/build/gnu-build-system.scm (configure): Add support for "bin"
  output.
2013-01-01 16:52:27 +01:00
Ludovic Courtès bc5bf85fa2 utils: Restore the mtime/atime of patched files.
* guix/build/utils.scm (set-file-time): New procedure.
  (patch-shebang): New `keep-mtime?' parameter; call `set-file-time'
  when it's true.
  (patch-makefile-SHELL): Likewise.
2012-12-31 01:17:43 +01:00
Andreas Enge 6253961de2 build-system/gnu: enable test-target during the check phase
* guix/build-system/gnu.scm: add variable test-target
2012-12-30 22:37:28 +01:00
Ludovic Courtès c089511288 build-system/gnu: Patch shebangs in all the source; patch SHELL in makefiles.
* guix/build/utils.scm (call-with-ascii-input-file): New procedure.
  (patch-shebang): Use it.
  (patch-makefile-SHELL): New procedure.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Patch all the
  files, not just executables; remove `po/Makefile.in.in' patching.
  (patch-generated-files): Rename to...
  (patch-generated-file-shebangs): ... this.  Patch executables and
  makefiles.
  (%standard-phases): Adjust accordingly.

* distro/packages/autotools.scm (libtool): Remove call to `patch-shebang'.
* distro/packages/base.scm (gcc-4.7): Likewise.
  (guile-final): Remove hack to skip `test-command-line-encoding2'.
* distro/packages/bash.scm (bash): Remove `pre-configure-phase'.
* distro/packages/readline.scm (readline): Likewise.
* distro/packages/ncurses.scm (ncurses): Remove `pre-install-phase'.
2012-12-21 22:31:25 +01:00
Ludovic Courtès eca63d3df8 build-system/gnu: Patch shebangs after `configure'.
* guix/build/gnu-build-system.scm (patch-generated-files): New
  procedure.
  (%standard-phases): Add it after `configure'.
2012-12-20 23:06:34 +01:00
Ludovic Courtès 4c377e861b build-system/gnu: Report the execution time of each phase.
* guix/build/gnu-build-system.scm (gnu-build): Report the success or
  failure of each phase and its execution time.
2012-12-20 22:31:08 +01:00
Ludovic Courtès a18b4d085b utils: Add a `progress' parameter to `dump-port'.
* guix/build/utils.scm (dump-port): Add a `progress' keyword parameter.
  Call it after each transfer.
2012-12-20 01:38:56 +01:00
Ludovic Courtès c3ee7448c9 build-system/gnu: Change the order of `patch-source-shebangs' and `patch'.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Add a newline
  after the "SHELL =" line in po/Makefile.in.in.
  (%standard-phases): Move `patch-source-shebangs' after `patch'.
2012-12-19 00:48:20 +01:00
Ludovic Courtès c43e006164 download: Remove unreachable SourceForge mirror.
* guix/download.scm (%mirrors)[sourceforge]: Remove kent.dl.*, which is
  unreachable.
2012-12-17 00:18:15 +01:00
Ludovic Courtès 3c738d6bd8 download: Correctly detect "No route to host" conditions.
* guix/build/download.scm (open-connection-for-uri): Delete addrinfos
  with the same address.  Always open SOCK_STREAM/IPPROTO_IP sockets.
  Fix the error handler's condition to determine what to do.
  Reported by Nikita Karetnikov <nikita.karetnikov@gmail.com> at
  <http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00150.html>.
2012-12-17 00:14:30 +01:00
Ludovic Courtès d008415219 build-system/gnu: Patch shebangs in executable source files.
This allows many packages to build in a chroot that lacks /bin and
thus /bin/sh.

* guix/build/gnu-build-system.scm (patch-source-shebangs): New
  procedure.
  (%standard-phases): Add it.
* guix/build/utils.scm (executable-file?): New procedure.
* distro/packages/perl.scm (perl): Don't use /bin/sh to run `Configure'.
2012-12-15 16:35:26 +01:00
Ludovic Courtès c1c94acf32 build-system/gnu: Make the error port line-buffered.
* guix/build/gnu-build-system.scm (gnu-build): Make the error port
  line-buffered.
2012-12-15 16:01:52 +01:00
Ludovic Courtès 74baf333bf utils: Make the buffer size of `dump-port' a parameter.
* guix/build/utils.scm (dump-port): Make `buffer-size' a keyword
  parameter.
2012-12-15 15:54:29 +01:00
Ludovic Courtès a784c3077e Merge branch 'master' into core-updates
Conflicts:
	distro/packages/multiprecision.scm
2012-12-15 15:28:50 +01:00
Ludovic Courtès b3a53fb361 download: Work around (web client) bug <http://bugs.gnu.org/13095>.
* guix/build/download.scm: Annihilate `shutdown' in (web client).
2012-12-14 18:07:10 +01:00
Ludovic Courtès 7f4f06513a build: Fix default value of `%state-directory'.
* guix/config.scm.in (%state-directory): Append `/nix'.
  Reported by Andreas Enge <andreas@enge.fr>.
2012-12-13 23:53:37 +01:00
Ludovic Courtès 9d1d434cd0 build-system/gnu: Avoid using /bin/sh.
* guix/build/gnu-build-system.scm (configure): Add `inputs' keyword
  parameter.  Take Bash from there, falling back to /bin/sh.  Set
  `CONFIG_SHELL' and `SHELL' to that Bash.  Run "bash ./configure"
  instead of just "./configure".
* distro/packages/bootstrap.scm (%bootstrap-inputs): Add "bash".
* distro/packages/base.scm (gcc-boot0-wrapped): Use "bash" from
  %BOOT1-INPUTS instead of /bin/sh.
2012-12-13 23:38:32 +01:00
Ludovic Courtès 1e9824513c Merge branch 'nix-integration'
Conflicts:
	tests/guix-package.sh
2012-12-13 22:14:25 +01:00
Nikita Karetnikov f15b31c562 licenses: Add 'bsd-style', 'expat', 'gpl1', 'gpl1+', 'lgpl2.0', and 'lgpl2.0+'.
* guix/licenses.scm (bsd-style, expat, gpl1, gpl1+)
  (lgpl2.0, lgpl2.0+): New variables.
2012-12-12 14:40:11 +01:00
Ludovic Courtès a09ec3a5af Have `%nixpkgs-directory' default to #f when $NIXPKGS is the empty string.
* guix/utils.scm (%nixpkgs-directory): Set to #f when the `NIXPKGS'
  environment variable is set but empty.  Reported by
  Andreas Enge <andreas@enge.fr>.
2012-12-10 22:53:28 +01:00
Ludovic Courtès 200dc93761 derivations: Distinguish direct store paths from files within a store path.
* guix/derivations.scm (derivation)[direct-store-path?]: New procedure.
  Use it to determine which inputs must be added to the store.
2012-12-10 00:44:17 +01:00
Ludovic Courtès 4d152bf1d9 Merge branch 'master' into nix-integration
Conflicts:
	guix/store.scm
2012-12-09 23:54:37 +01:00
Ludovic Courtès 3259877d35 store: Add GC-related operations.
* guix/store.scm (gc-action): New enumerate type.
  (read-long-long, read-string-list, write-store-path,
  write-store-path-list, read-store-path-list): New procedures.
  (write-arg): Add support for `store-path' and `store-path-list'.
  (read-arg): Add support for `store-path-list'.
  (define-operation): Add support for multiple-value returns.
  (run-gc, live-paths, dead-paths, collect-garbage, delete-paths): New
  procedures.
  (%long-long-max): New macro.
* tests/store.scm: New file.
* Makefile.am (TESTS): Add it.
2012-12-09 23:52:59 +01:00
Ludovic Courtès d3648e0118 store: Add `add-temp-root'.
* guix/store.scm (add-temp-root): New procedure.
2012-12-09 23:50:17 +01:00
Nikita Karetnikov 838d78e3e0 Add (guix licenses).
* guix/licenses.scm: New file.
* Makefile.am (MODULES): Add it.
2012-12-08 19:17:02 +01:00
Ludovic Courtès a4eabecd11 download: Fix the primary Savannah URL.
* guix/download.scm (%mirrors)[savannah]: Use
  "http://download.savannah.gnu.org/releases/" as the primary URL.
2012-12-07 22:32:03 +01:00
Ludovic Courtès d8eea3d2bc build: Capture configure-time settings in (guix config).
* configure.ac: Compute and substitute `guix_localstatedir'.
* m4/guix.m4: Substitute `guix_system'.
* guix/config.scm.in (%store-directory, %store-directory, %system): New
  variables.
* guix/store.scm (%nix-state-dir): Remove.
  (%default-socket-path): Use %STATE-DIRECTORY as the default.
  (%store-prefix): Use %STORE-DIRECTORY as the default.
* guix/utils.scm (%current-system): Default to %SYSTEM.
2012-12-06 00:07:17 +01:00
Nikita Karetnikov 22189ed117 Add (guix gnu-maintenance).
* guix/gnu-maintenance.scm: New file.
* Makefile.am (MODULES): Add it.
2012-12-05 14:56:25 +01:00
Ludovic Courtès cd3ded4301 store: Honor $NIX_STORE_DIR and $NIX_STATE_DIR.
* guix/store.scm (%nix-state-dir): Honor $NIX_STATE_DIR.
  (%store-prefix): Honor $NIX_STORE_DIR.
2012-12-04 23:48:21 +01:00
Ludovic Courtès 860a6f1ae0 derivations: Fix erroneous call to `add-to-store' for local files as input.
* guix/derivations.scm (derivation)[inputs]: Fix typo in call to
  `add-to-store'.
* tests/derivations.scm ("derivation with local file as input"): New test.
* tests/packages.scm ("trivial with local file as input"): New test.
2012-12-04 23:46:50 +01:00
Ludovic Courtès b40b259f12 download: Add kernel.org mirrors.
* guix/download.scm (%mirrors): Add `kernel.org' mirrors.
2012-11-27 21:55:53 +01:00
Ludovic Courtès 480943dd46 download: Keep only one slash when concatenating URIs.
* guix/build/download.scm (url-fetch)[uri-vicinity]: New procedure.
  [maybe-expand-mirrors]: Use it.
2012-11-27 21:33:54 +01:00
Ludovic Courtès 52bda18abf packages: Add missing export.
* guix/packages.scm: Export `package-home-page'.
2012-11-25 16:55:35 +01:00
Ludovic Courtès 64fc89b6ec guix-package: Add `--list-available'.
* guix-package.in (show-help, %options): Add `--list-available'.
  (guix-package)[process-query]: Add support for `--list-available'.
* doc/guix.texi (Invoking guix-package): Document it.
* tests/guix-package.sh: Add test.

* guix/ui.scm (location->string): New procedure.
* guix/utils.scm: Export <location>.
2012-11-19 23:04:38 +01:00
Ludovic Courtès ec4d308a9e guix-download: Use code from (guix build download).
* guix-download.in (http-fetch, ftp-fetch): Remove.
  (fetch-and-store): Replace `uri' parameter with `name', for the output
  file name.  Redirect the output of `fetch' to the error port.
  (guix-download): Call `url-fetch' for all URI schemes except `file'.
  Handle PATH equal to #f.
* guix/download.scm: Export `%mirrors'.
* tests/guix-download.sh: Change erroneous URL, because URLs at
  example.com are all valid redirections.
2012-11-13 23:04:21 +01:00
Ludovic Courtès 94d222ad97 download: Add support for mirror:// URLs.
* guix/download.scm (%mirrors): New variable.  Mirror lists taken from
  Nixpkgs.
  (url-fetch): New `mirrors' keyword parameter.
  [builder]: Pass it.

* guix/build/download.scm (url-fetch): New `mirrors' keyword parameter.
  [maybe-expand-mirrors]: New procedure.
  [uri]: Use it.
2012-11-13 00:23:43 +01:00
Ludovic Courtès 270246defe download: Follow HTTP redirections.
* guix/build/download.scm (http-fetch): Follow the redirection when CODE
  is 302.
2012-11-13 00:23:43 +01:00
Ludovic Courtès 87f5d36630 Remove (guix http) and (guix ftp).
* guix/ftp.scm, guix/http.scm, guix/build/ftp.scm, guix/build/http.scm:
  Remove.
* Makefile.am (MODULES): Likewise.
* tests/builders.scm, distro/packages/base.scm,
  distro/packages/bash.scm, distro/packages/bdw-gc.scm,
  distro/packages/compression.scm, distro/packages/gawk.scm,
  distro/packages/gnupg.scm, distro/packages/gperf.scm,
  distro/packages/guile.scm, distro/packages/libffi.scm,
  distro/packages/libsigsegv.scm, distro/packages/libtool.scm,
  distro/packages/libunistring.scm, distro/packages/lout.scm,
  distro/packages/m4.scm, distro/packages/multiprecision.scm,
  distro/packages/ncurses.scm, distro/packages/perl.scm,
  distro/packages/pkg-config.scm, distro/packages/pth.scm,
  distro/packages/readline.scm, distro/packages/recutils.scm: Use
  `url-fetch' instead of `http-fetch' and `ftp-fetch'.
* distro/packages/bootstrap.scm: Likewise
  (bootstrap-origin): Remove references to `http-fetch' and
  `ftp-fetch'.
* guix.scm (%public-modules): Remove `http' and `ftp'; add `download'.
2012-11-13 00:23:39 +01:00
Ludovic Courtès 62cab99c32 Add (guix download) and (guix build download).
* guix/download.scm, guix/build/download.scm: New files.
* Makefile.am (MODULES): Add them.
* tests/builders.scm ("url-fetch"): New test.
* distro/packages/bootstrap.scm (bootstrap-origin): Support
  `url-fetch'.
* guix/snix.scm (snix-derivation->guix-package): Use `url-fetch' instead
  of `http-fetch'.
2012-11-12 23:35:04 +01:00
Ludovic Courtès ddc29a782e Move base32 code to (guix base32).
* guix/utils.scm (bytevector-quintet-ref, bytevector-quintet-ref-right,
  bytevector-quintet-length, bytevector-quintet-fold,
  bytevector-quintet-fold-right, make-bytevector->base32-string,
  %nix-base32-chars, %rfc4648-base32-chars, bytevector->base32-string,
  bytevector->nix-base32-string, bytevector-quintet-set!,
  bytevector-quintet-set-right!, base32-string-unfold,
  base32-string-unfold-right, make-base32-string->bytevector,
  base32-string->bytevector, nix-base32-string->bytevector): Move to...
* guix/base32.scm: ... here.  New file.

* tests/utils.scm (%nix-hash, "bytevector->base32-string",
  "base32-string->bytevector", "nix-base32-string->bytevector", "sha256
  & bytevector->base32-string"): Move to...
* tests/base32.scm: ... here.  New file

* guix-download.in, guix/derivations.scm, guix/packages.scm,
  guix/snix.scm, tests/builders.scm, tests/derivations.scm: Adjust
  accordingly.
* guix.scm (%public-modules): Add `base32'.
2012-11-11 22:33:28 +01:00
Ludovic Courtès cfeb75954a http: Add informative output.
* guix/build/http.scm (http-fetch): Emit message indicating the
  download.
2012-11-09 00:21:18 +01:00
Ludovic Courtès e722af7522 http: Check the HTTP response code, and bail if not 200.
* guix/build/http.scm (http-fetch): Check RESP's code; error out when
  it's not 200.
2012-11-09 00:19:20 +01:00
Ludovic Courtès 7bdd1f0e3c derivations: build-expression->derivation: Builder only refers to sources.
* guix/derivations.scm (build-expression->derivation)[source-path]: New
  procedure.
  [builder]: Pass only sources as references.  This fixes a bug whereby
  changing a fixed-output drv referred to by a builder would cause the
  builder's hash to change, thereby leading to a full rebuild.
* tests/derivations.scm ("build-expression->derivation with a
  fixed-output input"): New test.
2012-11-09 00:07:10 +01:00
Ludovic Courtès c4c7406b90 store: Document `add-to-store' hack for `fixed?'.
* guix/store.scm (add-to-store): Document that `fixed?' must be #t.
2012-11-08 00:26:13 +01:00
Ludovic Courtès 53dcd5eea1 build-system/gnu: Add `static-libgcc-package' & supporting procedure.
* guix/build-system/gnu.scm (package-with-extra-configure-variable,
  static-libgcc-package): New procedures.
2012-11-05 23:51:09 +01:00
Ludovic Courtès 0af2c24ef7 utils: Add `default-keyword-arguments' and `substitute-keyword-arguments'.
* distro/packages/base.scm (default-keyword-arguments,
  substitute-keyword-arguments): Move to...
* guix/utils.scm: ... here.
2012-11-05 23:50:57 +01:00
Ludovic Courtès 10226c05b1 Add (guix snix) and the `guix-import' command.
* guix/snix.scm, tests/snix.scm, guix-import.in: New files.
* configure.ac: Output `guix-import' and make it executable.
* Makefile.am (bin_SCRIPTS): Add `guix-import'.
  (MODULES): Add `guix/snix.scm'.
  (TESTS): Add `tests/snix.scm'.
2012-11-04 19:38:31 +01:00
Ludovic Courtès d45122f537 packages: `description' → `synopsis', `long-description' → `description'.
* guix/packages.scm (<package>): Rename `description' to `synopsis', and
  `long-description' to `description'.
* tests/packages.scm, distro/packages/base.scm,
  distro/packages/databases.scm, distro/packages/guile.scm,
  distro/packages/typesetting.scm:  Update accordingly.
* po/Makevars (XGETTEXT_OPTIONS): Update `--keyword' flags accordingly.
2012-11-04 13:48:35 +01:00
Ludovic Courtès 9b48fb88ca utils: Add `package-name->name+version'.
* guix/utils.scm (package-name->name+version): New procedure.
* guix-package.in (guix-package)[find-package]: Use it.
* tests/utils.scm ("package-name->name+version"): New test.
2012-11-04 01:29:18 +01:00
Ludovic Courtès d388c2c435 build: Require GNU libgcrypt.
* guix/utils.scm (sha256): Remove Coreutils- and libchop-based
  implementations.
* README: Update accordingly.

* m4/guix.m4: New file.
* configure.ac: Use `GUIX_ASSERT_LIBGCRYPT_USABLE'.  Set and substitute
  `LIBGCRYPT_PREFIX'.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Pass
  `--with-libgcrypt-prefix=$(LIBGCRYPT_PREFIX)'.
2012-11-03 21:49:54 +01:00
Ludovic Courtès cdd5d6f95f ui: Factorize `--version'.
* guix/ui.scm (show-version-and-exit): New procedure.
* guix-build.in (show-version): Remove.
  (%options)["version"]: Use `show-version-and-exit'.
* guix-download.in: Likewise.
* guix-package.in: Likewise.
2012-11-03 21:19:43 +01:00
Ludovic Courtès 00e219d1c9 build: Produce (guix config) instead of using compile-time tricks.
* guix/config.scm.in: New file.
* guix/utils.scm: Use it.
  (%libgcrypt): Remove.
  (%nixpkgs-directory): Don't capture the compile-time $NIXPKGS; use
  %NIXPKGS instead.
  (nixpkgs-derivation): Use %NIX-INSTANTIATE.
* pre-inst-env.in (NIX_INSTANTIATE, NIXPKGS, LIBGCRYPT): Remove.

* configure.ac: Emit `guix/config.scm'.
* Makefile.am (GOBJECTS): Add `guix/config.go'.
  (nobase_nodist_guilemodule_DATA): Add `guix/config.scm'.
2012-11-03 21:11:28 +01:00
Ludovic Courtès e76bdf8b87 build: Clearly mark Nixpkgs as optional.
* configure.ac: Always show the result of checking for Nixpkgs.  Don't
  warn when Nixpkgs is not found.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Remove `--with-nixpkgs'
  flag.
* guix/utils.scm (%nixpkgs-directory): Use either the compile-time or
  the run-time `NIXPKGS' environment variable.
* release.nix (jobs.tarball, jobs.build): Remove `--with-nixpkgs'
  configure flag.
* README: Mark Nixpkgs as optional.

* distro/packages/databases.scm, distro/packages/guile.scm,
  distro/packages/typesetting.scm: Change uses of `nixpkgs-derivation*'
  to `nixpkgs-derivation', to avoid failing at compile-time.
2012-11-03 21:11:26 +01:00
Ludovic Courtès e3d741065e store: Add `store-path-package-name'.
* guix/store.scm (store-path-package-name): New procedure.
* tests/utils.scm ("store-path-package-name"): New test.
2012-11-01 01:39:23 +01:00
Ludovic Courtès 07d18f39cc utils: Remove stuff committed by error.
This was wrongfully committed in df1fab58.

* guix/utils.scm (hash-set-proc, hash-ref*, memoizing-lambda): Remove.
2012-11-01 01:35:00 +01:00
Ludovic Courtès 073c34d72f Add (guix ui).
* guix/ui.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.

* guix-build.in: Use it.
  (_, N_, leave): Remove.
  (guix-build): Use `with-error-handling' instead of the `guard' form.
* guix-download.in: Use it.
  (_, N_, leave): Remove.
2012-11-01 00:52:44 +01:00
Ludovic Courtès 111111d046 build-system/gnu: Distinguish between imported modules and used modules.
* guix/build-system/gnu.scm (gnu-build): Add the `imported-modules'
  keyword parameter.  Pass it to `build-expression->derivation'.
2012-10-31 17:53:59 +01:00
Ludovic Courtès 34811f02bf guix-build: Add `--root'.
* guix/store.scm (add-indirect-root): New operation.
* guix-build.in (show-help): Document `--root'.
  (%options): Add `--root'.
  (guix-build)[register-root]: New procedure.  Call it when `--root' is
  passed.
2012-10-30 00:20:53 +01:00
Ludovic Courtès c8c88afaa1 Add (guix build union).
* guix/build/union.scm, tests/union.scm: New files.
* Makefile.am (MODULES): Add `guix/build/union.scm'.
  (TESTS): Add `tests/union.scm'.
2012-10-29 22:39:46 +01:00
Ludovic Courtès 0778385802 guix-build: Gracefully handle `&package-input-error' conditions.
* guix/packages.scm: Export `package-error?' and `package-input-error?'.
* guix-build.in (guix-build): Catch `&package-input-error' conditions,
  print a human-readable message, and exit.
2012-10-27 14:56:46 +02:00
Ludovic Courtès 5e6c90121f location: Start column numbers at 1.
* guix/utils.scm (source-properties->location): Use COL + 1.
2012-10-27 14:53:47 +02:00
Ludovic Courtès 20d83444dd utils: Remove special `substitute*' syntax for lists of files.
* guix/build/utils.scm (substitute*): Remove special syntax for
  list-of-files; instead, check whether FILE is `list?' at run time.

* distro/packages/base.scm (gcc-4.7, %binutils-static): Adjust
  accordingly.
2012-10-26 09:07:37 +02:00
Ludovic Courtès fbc93bedff Add a `system' parameter to `nixpkgs-derivation'.
* guix/utils.scm (nixpkgs-derivation): Add a `system' parameter.  Pass
  it in the `nix-instantiate' invocation.
2012-10-25 23:42:06 +02:00
Ludovic Courtès b642e4b853 packages: Pass `system' around.
* guix/packages.scm (package-source-derivation): Add `system'
  parameter.  Pass it to METHOD.
  (package-derivation)[expand-input]: Pass SYSTEM to
  `package-derivation' and `package-source-derivation'.

* distro/packages/base.scm (package-with-bootstrap-guile)[boot]: Pass
  SYSTEM to FETCH.
2012-10-25 23:41:15 +02:00
Ludovic Courtès ae39d1b233 derivations: Make sure `build-expression->derivation' & co. pass `system'.
* guix/derivations.scm (imported-files): Call
  `build-expression->derivation' with SYSTEM, not (%current-system).
  (build-expression->derivation): Pass SYSTEM to `imported-modules' and
  `compiled-modules'.
2012-10-25 23:14:27 +02:00
Ludovic Courtès b272c47433 derivations: Pass the derivation of guile-for-build to `imported-files' & co.
* guix/derivations.scm (%guile-for-build): Initialize to #f.
  (imported-files, imported-modules, compiled-modules): Add `guile'
  keyword parameter.  Pass it down to `build-expression->derivation'.
  (build-expression->derivation)[guile-drv]: New variable.  Pass it as
  the #:guile parameter for `imported-modules' and `compiled-modules'.

* tests/derivations.scm: Set %GUILE-FOR-BUILD to the derivation of
  %BOOTSTRAP-GUILE.
2012-10-25 18:03:48 +02:00
Ludovic Courtès 82058eff59 store: Add `query-path-hash'.
* guix/store.scm (write-arg, read-arg): Add `base16' literal and
  corresponding rule.
  (query-path-hash): New operation.

* tests/derivations.scm ("fixed-output derivation"): Check whether
  `query-path-hash' returns a bytevector.
2012-10-24 23:52:15 +02:00
Ludovic Courtès d90248844b derivations: Compile the #:modules passed to `build-expression->derivation'.
* guix/derivations.scm (imported-files)[parent-dirs]: Move to...
  (parent-directories): ... here.  New procedure.
  (compiled-modules): New procedure.
  (build-expression->derivation): Use it.

* tests/derivations.scm ("build-expression->derivation with modules"):
  New test.
2012-10-24 00:09:25 +02:00
Ludovic Courtès 592ef6c88f packages: Add support for system-dependent inputs.
* guix/packages.scm (package-derivation)[intern]: New procedure.  Pass
  #t as the `recursive?' argument, instead of #f.
  [expand-input]: New procedure, with code formerly in the body.
  Support inputs where the input is a procedure returning a file name or
  an <origin>.
  Use `expand-input' in the body.

* tests/packages.scm ("trivial with system-dependent input"): New test.
2012-10-21 17:52:16 +02:00
Ludovic Courtès d6e8777688 distro: Use the bootstrap Guile for the derivation of sources.
* distro/packages/base.scm (bootstrap-origin,
  package-with-bootstrap-guile): New procedures.
  (gnu-make-boot0, diffutils-boot0, findutils-boot0, binutils-boot0,
  gcc-boot0, linux-libre-headers-boot0, glibc-final, bash-final,
  guile-final): Use `package-with-bootstrap-guile'.
  (gcc-boot0-wrapped): Clear `source'.

* guix/ftp.scm (ftp-fetch): Add a #:guile keyword parameter.  Honor it.
* guix/http.scm (http-fetch): Likewise.
2012-10-18 23:18:38 +02:00
Ludovic Courtès d14ecda913 http/ftp: Tweak to avoid depending on libc's NSS.
* guix/build/http.scm (open-connection-for-uri): New procedure.
  (http-fetch): Use it.  Pass the result as a #:port argument to
  `http-get'.
  Add hack to modify the `set-port-encoding!' binding in (web response).

* guix/ftp-client.scm (ftp-open): Add optional `port' parameter,
  defaulting to 21.  When calling `getaddrinfo', convert PORT to a
  string and pass AI_NUMERICSERV when PORT is a number.
2012-10-18 22:32:23 +02:00
Ludovic Courtès 4c261f4169 utils: Add `find-files'.
* guix/build/utils.scm (find-files): New procedure.
2012-10-17 23:25:25 +02:00
Ludovic Courtès c0746cc9db utils: Add `copy-recursively'; use it.
* guix/build/utils.scm (copy-recursively): New procedure.

* distro/packages/base.scm (%guile-static-stripped): Use it.
2012-10-17 23:25:25 +02:00
Ludovic Courtès 7da95264f1 utils: Add `mkdir-p'; use it.
* guix/build/utils.scm (mkdir-p): New procedure.

* distro/packages/base.scm (gnu-make-boot0, gcc-boot0-wrapped,
  ld-wrapper-boot3, %static-binaries, %guile-static-stripped): Use it.
* distro/packages/typesetting.scm (lout): Likewise.
2012-10-17 23:25:25 +02:00
Ludovic Courtès 7172116ca5 build-system/gnu: Pass the system type to the builder.
* guix/build-system/gnu.scm (gnu-build)[builder]: Pass SYSTEM to
  `gnu-build' as a keyword argument.
2012-10-17 23:25:25 +02:00
Ludovic Courtès 91133c2d71 utils: Add `fold-port-matches' and `remove-store-references'.
* guix/build/utils.scm (fold-port-matches, remove-store-references): New
  procedures.

* tests/build-utils.scm ("fold-port-matches", "fold-port-matches,
  trickier", "fold-port-matches, with unmatched chars"): New tests.
2012-10-16 23:01:01 +02:00
Ludovic Courtès dcd7290654 utils: Add `with-atomic-file-replacement'.
* guix/build/utils.scm (with-atomic-file-replacement): New procedure.
  (substitute): Use it.
2012-10-16 17:31:16 +02:00
Ludovic Courtès df1fab5837 distro: Add a statically-linked, relocatable Guile 2.0 package.
* distro/packages/base.scm (%guile-static, %guile-static-stripped): New
  variables.

* distro/patches/guile-relocatable.patch: New file.
* Makefile.am (dist_patch_DATA): Add it.
2012-10-13 22:36:39 +02:00
Ludovic Courtès 4004f95379 ftp-client: Try all the addresses returned by `getaddrinfo'.
* guix/ftp-client.scm (ftp-open): Upon connection failure, try the other
  addresses returned by `getaddrinfo'.
2012-10-13 21:18:16 +02:00
Ludovic Courtès e4588af969 packages: Fix and optimize memoization of `package-derivation'.
* guix/packages.scm (%derivation-cache): Pass an initial size of 100.
  (cache): Use `hashq-set!', and use a SYSTEM/DRV pair as the value.
  (cached-derivation): Update accordingly.
2012-10-08 22:07:19 +02:00
Ludovic Courtès ead1f1086d packages: Micro-optimize `package-derivation'.
* guix/packages.scm (package-derivation): Move `cache' call before the
  traversal of PACKAGE's inputs.
2012-10-08 21:57:14 +02:00
Ludovic Courtès df7bbd3813 derivations: Set input port to UTF-8 in `read-derivation'.
* guix/derivations.scm (read-derivation): Set DRV-PORT's encoding to
  UTF-8.
2012-10-07 22:28:07 +02:00
Ludovic Courtès 81c7948d9a build-system/{gnu,trivial-build}: Fix handling of #:guile argument.
* guix/build-system/gnu.scm (gnu-build)[guile-for-build]: Check whether
  GUILE matches string? before checking whether it matches
  derivation-path?.
* guix/build-system/trivial.scm (trivial-build)[guile-for-build]:
  Likewise.
2012-10-07 22:22:27 +02:00
Ludovic Courtès 12d5aa0f5a build-system/{gnu,trivial}: Add a `#:guile' keyword parameter.
* guix/build-system/gnu.scm (package-with-explicit-inputs): New `guile'
  keyword parameter.  Add it to P's arguments, and pass it in recursive
  calls.
  (gnu-build): New `guile' keyword parameter; new `guile-for-build'
  variable.  Pass it as the `#:guile-for-build' parameter of
  `build-expression->derivation'.

* guix/build-system/trivial.scm (trivial-build): Likewise.
2012-10-06 01:25:17 +02:00
Ludovic Courtès db1a15314d Support build-cores = 0; change `guix-build' to default to 0.
* guix/build/gnu-build-system.scm (%parallel-job-count): New variable.
  (build, check): Use it instead of $NIX_BUILD_CORES.

* guix-build.in (guix-build): Default to 0 for the #:build-cores option.
2012-10-05 23:21:09 +02:00
Ludovic Courtès 1f455fdca6 distro: Rename (distro ...) to (distro packages ...).
* distro/base.scm, distro/ld-wrapper.scm: Move to `distro/packages'.
  Adjust LD-WRAPPER-BOOT3 input file name accordingly.
* Makefile.am (MODULES): Adjust accordingly.
* distro.scm (%distro-module-directory): Change to "/distro/packages".
* guix/build-system/gnu.scm (standard-inputs): Change module name
  to (distro packages base).
* tests/packages.scm (test-packages): Likewise.
2012-09-26 22:00:58 +02:00
Ludovic Courtès 457dd86d66 Add (guix ftp) and companion modules.
* guix/ftp-client.scm, guix/ftp.scm, guix/build/ftp.scm: New files.
* Makefile.am (MODULES): Add them.

* distro/base.scm (libffi): Use `ftp-fetch'.
2012-09-12 23:47:49 +02:00
Ludovic Courtès be13fbfa83 Add (guix build-system trivial).
* guix/build-system/trivial.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/packages.scm ("trivial"): New test.

* guix/packages.scm (package-derivation): Allow SOURCE to be #f.
2012-09-10 22:47:10 +02:00
Ludovic Courtès 2d14ef0f2c build-system/gnu: Fix `#:path-exclusions' handling.
* guix/build/gnu-build-system.scm (set-paths)[relevant-input-directories]:
  New procedure.  Use it.  This fixes #:path-exclusions handling.
2012-09-06 22:58:43 +02:00
Ludovic Courtès 9d9ef458e8 utils: Make `set-path-environment-variable' verbose.
* guix/build/utils.scm (set-path-environment-variable): Print ENV-VAR
  and its value.
2012-09-06 22:57:46 +02:00
Ludovic Courtès dc1045be7d packages: Accept <origin> as package inputs.
* guix/packages.scm (package-derivation): Accept use of an <origin> as
  an input.
2012-09-06 00:00:00 +02:00
Ludovic Courtès 1f34bda1e2 build-system/gnu: Relax location handling in `package-with-explicit-inputs'.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Convert LOC
  when it is a source-property list.
2012-09-05 23:59:23 +02:00
Ludovic Courtès 2847050a61 packages: Add `package-full-name'.
* guix/packages.scm (package-full-name): New procedure.
  (package-derivation): Use it.
2012-09-05 19:01:47 +02:00
Ludovic Courtès ff352cfb97 Move <location> to (guix utils).
* guix/packages.scm (<location>, location): Move to...
* guix/utils.scm: ... here.
2012-09-03 01:07:01 +02:00
Ludovic Courtès 60f984b262 distro: Bootstrap standard inputs from Nixpkgs.
This is a first step towards bootstrapping from a set of pre-built,
statically-linked binaries.

* guix/build-system/gnu.scm (package-with-explicit-inputs,
  standard-inputs): New procedure.
  (%store): New variable.
  (%standard-inputs): Remove.
  (gnu-build): New `implicit-inputs?' keyword parameter.  Use it to
  choose whether to use `(standard-inputs SYSTEM)' or the empty list.

* distro/base.scm (guile-2.0): Remove dependency on XZ, which is now
  implicit.
  (%bootstrap-inputs, gcc-boot0, binutils-boot0, linux-headers-boot0,
  %boot1-inputs, glibc-final, %boot2-inputs, m4-boot2, gmp-boot2,
  mpfr-boot2, mpc-boot2, %boot3-inputs, gcc-final, %boot4-inputs,
  %final-inputs): New variables.
2012-09-02 20:05:39 +02:00
Ludovic Courtès 113aef68fb packages: Add `package-transitive-propagated-inputs'.
* guix/packages.scm (transitive-inputs): New procedure.
  (package-transitive-inputs): Rewrite in terms of `transitive-inputs'.
  (package-transitive-propagated-inputs): New procedure.
2012-09-02 19:58:03 +02:00
Ludovic Courtès a2ebaddda7 packages: Cache the result of `package-derivation'.
* guix/packages.scm (%derivation-cache): New variable.
  (cache, cached-derivation): New procedures.
  (package-derivation): Use them.
2012-09-02 19:40:08 +02:00
Ludovic Courtès 946b72c924 packages: Add a printer for <package>.
* guix/packages.scm (<package>): Add record printer.
2012-09-02 15:41:52 +02:00
Ludovic Courtès aaa848f3af Optimize `write-derivation' and `derivation-path->output-path'.
* guix/derivations.scm (write-derivation): Explicitly use
  `simple-format'.
  (derivation-path->output-path): Memoize.
2012-09-02 01:51:52 +02:00
Ludovic Courtès f39bd08ad2 Optimize `store-path?'.
* guix/store.scm (store-path?): Check with `string-prefix?' instead of a
  regexp.
2012-09-01 23:38:28 +02:00
Ludovic Courtès d118c548b5 build-system/gnu: Really apply patches.
* guix/build/gnu-build-system.scm (patch): Use `--input FILE', not just
  `FILE'.
2012-09-01 19:21:33 +02:00
Ludovic Courtès 8197c978ef utils: Change `substitute*' to allow iteration over several matches.
* guix/build/utils.scm (substitute): Do not pass the OUT to PROC; use
  `list-matches' instead of `regexp-exec' and pass a list of matches to
  PROC. Expect PROC to return a string, and output that.  Fold over
  RX+PROC in order.  Use `(read-line p 'concat)' to include the trailing
  delimiter in LINE.
  (substitute*): Produce code to iterate over the matches, and return a
  string, which includes anything from the original line that's in
  between matches.

* distro/base.scm (gcc-4.7, glibc): Adjust accordingly: remove use
  of (ice-9 regex) and `regexp-substitute/global'; return a string.
2012-09-01 19:21:31 +02:00
Ludovic Courtès 6dd7787c39 Add a `guile-for-build' parameter to `build-expression->derivation'.
* guix/derivations.scm (%guile-for-build): Use `nixpkgs-derivation*'
  instead of `nixpkgs-derivation'.
  (build-expression->derivation): New `guile-for-build' keyword
  parameter.  Use it.
2012-09-01 11:45:52 +02:00
Ludovic Courtès 4c1eddf766 Add an `env-vars' keyword parameter to `build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): New `env-vars'
  keyword parameter; default to '().  Use it.
2012-09-01 11:33:20 +02:00
Ludovic Courtès dc4e02572e build-system/gnu: Add `path-exclusions' parameter.
* guix/build/gnu-build-system.scm (set-paths): Add new `path-exclusions'
  parameter; honor it.
* guix/build-system/gnu.scm (gnu-build): New `path-exclusions' keyword
  parameter; pass it to BUILDER.

* distro/base.scm (gcc-4.7): Exclude "libc" from $LIBRARY_PATH.
2012-09-01 01:14:31 +02:00
Ludovic Courtès 877217b85a build-system/gnu: Honor the `patch-shebangs?' and `strip-binaries?' parameters.
* guix/build/gnu-build-system.scm (patch-shebangs): Honor
  PATCH-SHEBANGS?.
  (strip): Honor STRIP-BINARIES?.  Display a message from `strip-dir'.
2012-08-31 23:58:21 +02:00
Ludovic Courtès e815763e69 build-system/gnu: Add a `strip' phase.
* guix/build/gnu-build-system.scm (strip): New procedure.
  (%standard-phases): Add it.

* guix/build-system/gnu.scm (gnu-build): New `strip-binaries?',
  `strip-flags', and `strip-directories' keyword parameters.  Pass them
  to BUILDER.
2012-08-31 17:04:53 +02:00
Ludovic Courtès 84209975fd build-system/gnu: Always invoke `configure' with a relative path.
* guix/build/gnu-build-system.scm (configure): Change SRCDIR to always
  be a relative path.
2012-08-30 23:30:42 +02:00
Ludovic Courtès dcd60f4398 define-record-type*: Add the `inherit' syntactic constructor keyword.
* guix/utils.scm (define-record-type*)[make-syntactic-constructor]: New
  `type' parameter.  Add the `inherit' keyword and corresponding support
  code.

* tests/utils.scm ("define-record-type* & inherit", "define-record-type*
  & inherit & letrec* behavior"): New tests.
2012-08-30 00:18:50 +02:00
Ludovic Courtès 8773648e35 utils: Change `substitute*' to accept a list of files to patch.
* guix/build/utils.scm (substitute*): Support a list of files as the
  first argument.
2012-08-25 13:12:45 +02:00
Ludovic Courtès 22b5d9c9a5 build-system/gnu: Add `out-of-source?' keyword parameter.
* guix/build/gnu-build-system.scm (configure): Add an `out-of-source?'
  keyword parameter; build out-of-source-tree when #t.
* guix/build-system/gnu.scm (gnu-build): Add `out-of-source?' keyword
  parameter.  Pass it in BUILDER.
2012-08-23 23:13:41 +02:00
Ludovic Courtès d36622dc44 packages: Raise an error condition upon invalid input.
* guix/packages.scm (&package-error, &package-input-error): New
  condition types.
  (package-derivation): Raise a `&package-input-error' when no match is
  made.
2012-08-23 23:09:13 +02:00
Ludovic Courtès 3abaf0c440 Add `close-connection'.
* guix/store.scm (close-connection): New procedure.
2012-08-22 17:25:47 +02:00
Ludovic Courtès fc484f605c build-system/gnu: Augment $PATH with $out for `patch-shebangs'.
* guix/build/gnu-build-system.scm (patch-shebangs): Add BINDIRS to
  $PATH, and pass that to `patch-shebang'.
2012-08-19 23:05:04 +02:00
Ludovic Courtès 525a59d6d3 utils: Add a `path' argument to `patch-shebang'.
* guix/build/utils.scm (patch-shebang): Add an optional `path'
  parameter.  Change SHEBANG-RX to match the whole interpreter file
  name.  Don't patch when BIN and CMD are the same.  Add docstring.
2012-08-19 23:04:03 +02:00
Ludovic Courtès 437fd80992 build-system/gnu: Add a `patch-shebangs' phase.
* guix/build/gnu-build-system.scm (patch-shebangs): New procedure.
  (%standard-phases): Add it.

* guix/build-system/gnu.scm (gnu-build): New `patch-shebangs?' keyword
  parameter.  Pass it to the builder's `gnu-build'.
2012-08-19 17:54:54 +02:00
Ludovic Courtès ebe2f31f19 utils: Add `patch-shebang'.
* guix/build/utils.scm (search-path-as-string->list): New procedure.
  (dump-port, patch-shebang): New procedures.
2012-08-19 17:41:30 +02:00
Ludovic Courtès 3a310cc017 build: Add `--with-libgcrypt-prefix'; capture the path to libgcrypt.
* configure.ac: Add `--with-libgcrypt-prefix'.  Substitute `LIBGCRYPT'.

* Makefile.am (.scm.go): Pass $(LIBGCRYPT).

* guix/utils.scm (%libgcrypt): New variable.
  (sha256): Use it.
2012-08-17 10:41:27 +02:00
Ludovic Courtès 93a0a8b3fd packages: Add all non-derivation paths to the store.
* guix/packages.scm (package-derivation): Add all non-derivation paths
  to the store.
2012-08-16 19:00:49 +02:00
Ludovic Courtès cf56996046 packages: Allow store paths as inputs.
* guix/packages.scm (package-derivation): Allow non-derivation store
  paths as inputs.
2012-08-16 18:48:03 +02:00
Ludovic Courtès b86b00567c build: Pass $(NIX_INSTANTIATE) to the build and test environments.
* Makefile.am (.scm.go): Define $NIX_INSTANTIATE.
  (TESTS_ENVIRONMENT): Likewise, and define $NIX_HASH.
* guix/utils.scm (nixpkgs-derivation): Use $NIX_INSTANTIATE when
  defined.

* tests/utils.scm (%nix-hash): New variable.
  ("sha256 & bytevector->nix-base32-string"): Use it.
2012-08-14 18:42:46 +02:00
Ludovic Courtès ce5d658c5c Add `nixpkgs-derivation*'; use it in the distro.
* guix/utils.scm (nixpkgs-derivation*): New macro.

* distro/base.scm: Use it instead of `nixpkgs-derivation'.
2012-07-11 17:26:43 +02:00
Ludovic Courtès d44bc84b15 Unset `LD_LIBRARY_PATH' in `build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation)[prolog]: Unset
  `LD_LIBRARY_PATH'.
2012-07-07 22:38:08 +02:00
Ludovic Courtès da62d3e5ae build-system/gnu: Add dependency on GNU Findutils.
* guix/build-system/gnu.scm (%standard-inputs): Add "findutils".
2012-07-07 22:08:35 +02:00
Ludovic Courtès a3d73f59e3 Add `package-transitive-inputs'; use it to honor propagated inputs.
* guix/packages.scm (package-transitive-inputs): New procedure.
  (package-derivation): Use it to compute INPUTS.

* tests/packages.scm (dummy-package): New macro.
  ("package-transitive-inputs"): New test.
2012-07-07 20:14:31 +02:00
Ludovic Courtès c51e6ea2d8 build-system/gnu: Set $PKG_CONFIG_PATH.
* guix/build/gnu-build-system.scm (set-paths): Add `PKG_CONFIG_PATH'.
2012-07-07 18:40:39 +02:00
Ludovic Courtès c3c7eb4194 build-system/gnu: Add `tests?' parameter.
* guix/build-system/gnu.scm (gnu-build): Add `tests?' parameter.
  [builder]: Inherit it.
2012-07-07 18:12:20 +02:00
Ludovic Courtès d9dbab18e2 utils: Have `substitute' restore the file's permission bits.
* guix/build/utils.scm (substitute): Restore FILE's mode before renaming
  TEMPLATE.
2012-07-07 18:11:52 +02:00