Commit graph

2897 commits

Author SHA1 Message Date
Roel Janssen 7c3e4660a5
import: Update Bioconductor release to 3.5.
* guix/import/cran.scm: Change Bioconductor release to 3.5.
2017-04-28 11:02:26 +02:00
Ludovic Courtès 25a49294ca
cache: Work around 'time-monotonic' bug in Guile 2.2.2.
* guix/cache.scm (time-monotonic) [guile-2.2]: New variable.
* tests/cache.scm (time-monotonic) [guile-2.2]: Likewise.
* guix/build/download.scm (time-monotonic) [guile-2.2]: Adjust comment:
it's a 2.2.2 bug.
2017-04-22 14:42:15 +02:00
Ludovic Courtès 1fe958d62a
download: Work around Guile 2.2 bug with 'time-monotonic' objects.
* guix/build/download.scm (time-monotonic) [guile-2.2]: New variable.
2017-04-22 01:25:22 +02:00
Ludovic Courtès 9231ef12f2
derivations: Restore UTF-8 encoding of build scripts.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00457.html>.

* guix/derivations.scm (build-expression->derivation): Use a string
output port for the expression.  This reverts part of
2dce88d5bb.
* tests/derivations.scm ("build-expression->derivation and builder
encoding"): New test.
2017-04-21 22:45:29 +02:00
Ludovic Courtès 285f63e805
store: Support 'ssh://' URIs in 'GUIX_DAEMON_SOCKET'.
This allows 'guix' commands to talk to a remote store over SSH.

* guix/store.scm (connect-to-daemon)[connect]: Call 'resolve-interface'
for unknown URI schemes.
* guix/store/ssh.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (The Store): Document it.  Mark remote access as
experimental.
2017-04-21 19:17:36 +02:00
Ludovic Courtès e537833726
ssh: Decompose 'connect-to-remote-daemon'.
* guix/ssh.scm (remote-daemon-channel): New procedure.
(connect-to-remote-daemon): Implement in terms of it.
2017-04-21 19:17:36 +02:00
Ludovic Courtès 615c5298f7
ssh: Move 'open-ssh-session' to (guix ssh).
* guix/scripts/copy.scm (%compression, open-ssh-session): Move to...
* guix/ssh.scm: ... here.  Use '&message' conditions instead of calling
'leave'.
2017-04-21 19:17:34 +02:00
Ludovic Courtès ba97e454bf
offload: Avoid using '_' as a 'match' pattern.
* guix/scripts/offload.scm (host-key->type+key, machine-load)
(process-request, guix-offload): Do not use '_' as a 'match' pattern.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 3dff90ce34
store: Add support for remote connections via 'guix://' URIs.
* guix/store.scm (open-inet-socket): New procedure.
(connect-to-daemon): Support the 'guix' URI scheme.
* doc/guix.texi (The Store): Document it.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 3b5cd17a97
store: Add 'system-error-to-connection-error' macro.
* guix/store.scm (system-error-to-connection-error): New macro.
(open-unix-domain-socket): Use it instead of 'catch'.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 1397b422e2
store: 'GUIX_DAEMON_SOCKET' can now be a URI.
* guix/store.scm (%daemon-socket-file): Rename to...
(%daemon-socket-uri): ... this.
(connect-to-daemon): New procedure.
(open-connection): Rename 'file' to 'uri'.  Use 'connect-to-daemon'
instead of 'open-unix-domain-socket'.
* guix/tests.scm (open-connection-for-tests): Rename 'file' to 'uri'.
* tests/guix-build.sh: Add tests.
* tests/store.scm ("open-connection with file:// URI"): New tests.
2017-04-21 17:23:37 +02:00
Ludovic Courtès 2dce88d5bb
derivations: Avoid string-to-bytevector conversions.
On Guile 2.2.1, this yields a 5% speedup on:

  guix build libreoffice xmonad certbot -n --no-substitutes --no-build-hook

* guix/derivations.scm (derivation->string): Rename to...
(derivation->bytevector): ... this.  Use 'open-bytevector-output-port'
instead of 'call-with-output-string'.
(derivation-hash): Remove string-to-bytevector conversion before
'sha256' call.
(build-expression->derivation): Use 'add-data-to-store' and an
bytevector port instead of a string port for the expression.
2017-04-20 23:35:55 +02:00
Ludovic Courtès e1bbc0e38d
publish: Add a handler for / and /index.html.
Suggested by Quiliro <quiliro@riseup.net>
in <https://bugs.gnu.org/26567>.

* guix/scripts/publish.scm (render-home-page): New procedure.
(make-request-handler): Handle it.
2017-04-19 23:43:51 +02:00
Ludovic Courtès 2363bdd707
gexp: 'gexp-modules' accepts plain Scheme objects.
* guix/gexp.scm (gexp-modules): Return '() when not (gexp? GEXP).
* tests/gexp.scm ("gexp-modules and literal Scheme object"): New test.
2017-04-19 17:51:39 +02:00
Ludovic Courtès d72b42064b
publish: Remove expired cache entries when '--ttl' is used.
* guix/scripts/publish.scm (narinfo-files): New procedure.
(render-narinfo/cached)[delete-file]: New procedure.  Add call to
'maybe-remove-expired-cache-entries'.
* doc/guix.texi (Invoking guix publish): Document the interation between
--cache and --ttl.
2017-04-18 23:19:30 +02:00
Ludovic Courtès 2ea2aac6e9
Add (guix cache) and use it in (guix scripts substitute).
* guix/cache.scm, tests/cache.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* guix/scripts/substitute.scm (obsolete?): Remove.
(remove-expired-cached-narinfos): Rename to...
(cached-narinfo-expiration-time): ... this.  Remove the removal part and
only keep the expiration time part.
(narinfo-cache-directories): Add optional 'directory' parameter and
honor it.
(maybe-remove-expired-cached-narinfo): Remove.
(cached-narinfo-files): New procedure.
(guix-substitute): Use 'maybe-remove-expired-cache-entries' instead of
'maybe-remove-expired-cached-narinfo'.
2017-04-18 23:19:30 +02:00
Ludovic Courtès 00753f7038
publish: Add '--cache' and '--workers'.
Fixes <http://bugs.gnu.org/26201>.
Reported by <dian_cecht@zoho.com>.

These options allow nars to be "baked" off-line and cached instead of
being compressed on the fly.  As a side-effect, this allows us to
provide a 'Content-Length' header for nars.

* guix/scripts/publish.scm (show-help, %options): Add '--cache' and
'--workers'.
(%default-options): Add 'workers'.
(nar-cache-file, narinfo-cache-file, run-single-baker): New procedures.
(single-baker): New macro.
(render-narinfo/cached, bake-narinfo+nar)
(render-nar/cached): New procedures.
(make-request-handler): Add #:cache and #:pool parameters and honor
them.
(run-publish-server): Likewise.
(guix-publish): Honor '--cache' and '--workers'.
* tests/publish.scm ("with cache"): New test.
* doc/guix.texi (Invoking guix publish): Document it.
2017-04-18 23:18:41 +02:00
Ludovic Courtès 339a79fd6a
publish: Use 'sendfile' when possible.
* guix/scripts/publish.scm (http-write): In the
'application/octet-stream' case, use 'sendfile' when OUTPUT is a file
port.
2017-04-18 23:17:18 +02:00
Ludovic Courtès 905ae5276d
publish: Introduce 'actual-compression'.
* guix/scripts/publish.scm (actual-compression): New procedure.
(narinfo-string): Use it.
2017-04-18 23:17:18 +02:00
Ludovic Courtès 1563d6c79f
Add (guix workers).
* guix/workers.scm, tests/workers.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* .dir-locals.el: Add rule for 'eventually'.
2017-04-18 23:17:17 +02:00
Ludovic Courtès e16c823f80
serialization: Remove Guile < 2.0.9 workaround.
* guix/serialization.scm (write-contents): Assume 'sendfile' is always
defined.
2017-04-17 23:31:28 +02:00
Ludovic Courtès 94df39cc08
records: Slight simplification.
* guix/records.scm (make-syntactic-constructor): Simplify 'find' expression.
2017-04-17 23:31:28 +02:00
Marius Bakke 7c7b802cce
download: Add netfilter mirror.
* guix/download.scm (%mirrors): Add mirrors for www.netfilter.org.
2017-04-17 23:05:46 +02:00
Mathieu Othacehe a9eadc06ac
scripts: system: Rename --no-grub option to --no-bootloader.
* guix/scripts/system.scm (%options, show-help): Adjust accordingly.
Keep "--no-grub" for compatibility reasons, but do not mention it in the help.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-17 17:41:54 +02:00
Ludovic Courtès 1730c5b509
lint: Avoid non-literal format strings.
Reported by Mathieu Othacehe <m.othacehe@gmail.com>
at <http://bugs.gnu.org/26498>.

* guix/scripts/lint.scm (warn-if-package-has-input): Rename to...
(package-input-intersection): ... this.  Remove 'linted' and 'message'
parameters.  Return a list of inputs.
(check-inputs-should-be-native): Adjust accordingly.
(check-inputs-should-not-be-an-input-at-all): Likewise.
2017-04-16 12:08:30 +02:00
Ludovic Courtès f816dba680
ui: Gracefully report '&message' conditions.
* guix/ui.scm (report-load-error, warn-about-load-error)
(read/eval): Add special-case for SRFI-35 &message conditions.
2017-04-16 00:48:07 +02:00
Ludovic Courtès efe7d19a9e
services: 'service-parameters' becomes 'service-value'.
* gnu/services.scm (<service>)[parameters]: Rename to...
[value]: ... this.
Change calls to 'service-parameters' to 'service-value'.
* gnu/system.scm, gnu/tests/base.scm,
guix/scripts/system.scm, tests/services.scm: Likewise.
* doc/guix.texi (Service Reference): Adjust accordingly.
2017-04-16 00:48:07 +02:00
Danny Milosavljevic 958a1fda9e
system: Make grub use <menu-entry> instead of <boot-parameters> again.
* gnu/system/grub.scm: Remove boot-parameters->menu-entry.
(grub-configuration): Don't use boot-parameters->menu-entry.
* gnu/system.scm (operating-system-bootcfg): Use menu-entry.
* guix/scripts/system.scm (reinstall-grub): Use profile-grub-entries.
(perform-action): Use profile-grub-entries.
2017-04-15 22:02:38 +02:00
Danny Milosavljevic abae042ea4
scripts: system: Introduce profile-boot-parameters.
* guix/scripts/system.scm (profile-boot-parameters): New variable.
(reinstall-grub): Use profile-boot-parameters.
(perform-action): Use profile-boot-parameters.

Follow-up to 2e58e05bb6.
2017-04-15 19:34:00 +02:00
Mathieu Othacehe e61519ab9c
scripts: system: Rename grub? and install-grub? to bootloader? and install-bootloader?.
* guix/scripts/system.scm (perform-action): Rename grub? to bootloader,
(%options): rename install-grub? to install-bootloader?,
(%default-options): ditto,
(process-action): reindent and rename grub? to bootloader?.
2017-04-15 15:22:47 +02:00
Mathieu Othacehe c76b3046f6
system: Rename operating-system-grub.cfg to operating-system-bootcfg.
* gnu/system.scm (operating-system-grub.cfg): Rename to...
(operating-system-bootcfg): ... this.
* gnu/system/vm.scm (system-disk-image): Use operating-system-bootcfg.
(system-qemu-image): Use operating-system-bootcfg.
(system-qemu-image/shared-store): Use operating-system-bootcfg.
* guix/scripts/system.scm (perform-action): Use operating-system-bootcfg.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 14:41:10 +02:00
Danny Milosavljevic 03daeaa70f
scripts: system: Back out operating-system-bootcfg change.
Follow-up to 475e2ce211.

* guix/scripts/system.scm (perform-action): Back out operating-system-bootcfg
change.
2017-04-15 14:41:10 +02:00
Danny Milosavljevic 475e2ce211
scripts: system: Move save-load-path-excursion and save-environment-excursion macros to the top.
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 13:28:25 +02:00
Mathieu Othacehe a41134b442
scripts: system: Move save-load-path-excursion and save-environment-excursion macros to the top.
* guix/scripts/system.scm (save-load-path-excursion,
save-environment-excursion): Move definitions to the top of the file.
It allows to use them in the whole file.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 12:33:56 +02:00
Mathieu Othacehe e60ee79040
build-system/cargo: Remove store reference.
* guix/build/cargo-build-system.scm (generate-checksums): Remove store
  reference from comment. This comment was matching
  assert-no-store-file-names regexp in Makefile.am.
  Also, edit procedure docstring to precise that DIR-NAME is a store
  directory.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-14 12:29:20 +02:00
Mathieu Othacehe 23e525e109
syscalls: Add load-linux-module.
* guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented
from guile-linux-syscalls.patch.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:26 +02:00
Mathieu Othacehe c5cd4fad09
syscalls: Use define-as-needed for network-interface syscalls.
* guix/build/syscalls.scm (network-interface-flags): Use define-as-needed macro
and remove from export list.
(set-network-interface-flags): Ditto.
(set-network-interface-address): Ditto.
(IFF_UP, IFF_BROADCAST and IFF_LOOPBACK): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Mathieu Othacehe 7df4d3465d
syscalls: Use define-as-needed for mount and umount.
* guix/build/syscalls.scm (mount): Use define-as-needed macro
and remove from export list.
(umount): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Mathieu Othacehe 8336df0668
syscalls: Add reboot.
* guix/build/syscalls.scm (define-as-needed): New macro.
(reboot): New procedure. Reimplemented from guile-linux-syscalls.patch.
(RB_AUTOBOOT, ..., RB_KEXEC): New flags copied from static Guile patch.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:25 +02:00
Chris Marusich 8bc2183fe5
monads: Improve mlet, mlet*, and mbegin documentation.
* doc/guix.texi (The Store Monad) <mlet, mlet*, mbegin>: Clarify
their intended usage.
* guix/monads.scm (mbegin): Update docstring accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:51 +02:00
Chris Marusich 60a9fcb137
monads, doc: Improve mwhen and munless documentation.
* doc/guix.texi (The Store Monad) <mwhen, munless>: Document them.
* guix/monads.scm (mwhen, munless): Clarify their intended use.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:51 +02:00
Chris Marusich d922c8e4b7
monads: Use intent-revealing parameter names.
* guix/monads.scm (mwhen, munless): Rename parameters from 'exp0' and 'exp' to
  'mexp0' and 'mexp', respectively.  This makes it more obvious that these
  expressions must be monadic expressions.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-08 14:40:50 +02:00
Mathieu Othacehe f91fcd9c42
syscalls: Allow mount and umount use from static Guile.
* guix/build/syscalls.scm (mount): Use Guile core mount if called from
  static Guile, otherwise use FFI based mount implementation.
  (umount): Ditto.
  This allows to use (guix build syscalls) from a module independently
  of calling context.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-07 23:30:39 +02:00
Ludovic Courtès 5537f2d279
profiles: Slightly improve the instructions in 'etc/profile'.
* guix/build/profiles.scm (build-etc/profile): Fix typo in comment.
Add backslash in the generated shell comment.
2017-04-07 23:30:38 +02:00
Ludovic Courtès 83cfa0247b
pack: Add '--expression'.
* guix/scripts/pack.scm (%options, show-help): Add '--expression'.
(guix-pack)[maybe-package-argument]: New procedure.
Use it, and remove variable 'specs'.
* doc/guix.texi (Invoking guix pack): Document '--expression'.
2017-04-07 23:30:38 +02:00
Ludovic Courtès 9a3762a768
size: Avoid '_' as a pattern variable in 'match'.
* guix/scripts/size.scm (display-profile, profile->page-map): Don't use
'_' as a 'match' pattern variable.
2017-04-07 00:17:16 +02:00
Chris Marusich 5ea69d9a56
system: Support the --root option in 'guix system'.
Fixes <https://bugs.gnu.org/26271>.

* guix/scripts/system.scm (perform-action): Add #:gc-root parameter and
honor it.
(show-help): Document the --root option.
(%options): Add 'root'.
(process-action): Pass 'root' option to perform-action as #:gc-root.
* doc/guix.texi (Invoking guix system): Document '--root'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-06 10:24:32 +02:00
Chris Marusich a09b45da6f
build: Add and export procedure 'register-root*'.
* guix/scripts/build.scm (register-root*): Add and export it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-06 10:11:26 +02:00
Ludovic Courtès 50f4ea18c4
environment: Deal with single-entry search paths.
This is a followup to fcd75bdbfa.

* guix/scripts/environment.scm (create-environment): Check whether
SEPARATOR is #f.
2017-04-05 22:50:21 +02:00
Maxim Cournoyer a0b87ef8ec
profiles: Generate database file for man pages.
The mandb database file (index.db) is used by the "apropos" (whatis) or
"man -k" commands.  This change introduces a profile hook to generate
such database file.

* guix/profiles.scm (manual-database): New procedure.
(%default-profile-hooks): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-04-05 22:45:41 +02:00
Ludovic Courtès 1618006d0b
build-system/python: 'package-with-explicit-python' uses 'package-mapping'.
* guix/build-system/python.scm (package-with-explicit-python)
[package-variant, cut?]: New procedures.
[transform]: Remove 'mlambdaq' form and input tuple handling.
Use 'package-mapping'.
2017-04-05 22:45:41 +02:00
Ludovic Courtès f37f2b83fa
packages: Add 'package-mapping' and base 'package-input-rewriting' on it.
* guix/packages.scm (package-mapping): New procedure.
(package-input-rewriting): Rewrite in terms of 'package-mapping'.
* tests/packages.scm ("package-mapping"): New test.
* doc/guix.texi (Defining Packages): Document it.
2017-04-05 22:45:41 +02:00
Ricardo Wurmus 5ae63362ae
import cran: Distinguish Bioconductor data packages.
* guix/import/cran.scm (bioconductor-package?): Exclude Bioconductor
data packages.
(bioconductor-data-package?): New procedure.
2017-04-05 18:38:51 +02:00
Leo Famulari b23c1a71be
download: Update the GnuPG mirror list.
* guix/download.scm (%mirrors) <gnupg>: Use HTTP for TU Wien mirror.
2017-04-05 07:07:35 -04:00
Chris Marusich 1c6b2d3f98
build: Export register-root procedure.
* guix/scripts/build.scm: Export register-root procedure.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-05 00:53:03 +02:00
Leo Famulari 6c17422eac
utils: Fix handling of shell arguments for xz compression.
Fixes test failures related to xz compression in tests/utils.scm.

This is a followup to commit 63102406f2.

* guix/utils.scm (decompressed-port, compressed-port, compressed-output-port):
Split each shell argument into its own list element.
2017-04-03 23:23:39 -04:00
Ludovic Courtès 76c486196f
packages: Catch invalid input errors for structs.
Reported by Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
at <https://lists.gnu.org/archive/html/help-guix/2017-04/msg00007.html>.

* guix/packages.scm (expand-input): Add 'guard' form around call to
'package-source-derivation'.
* tests/packages.scm (dummy): New test.
2017-04-04 00:10:00 +02:00
Ludovic Courtès 3e43166ffc
gexp: 'lower-object' raises an exception when passed an invalid object.
* guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions.
(lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f.
* tests/gexp.scm ("lower-object & gexp-input-error?"): New test.
* guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'.
2017-04-04 00:10:00 +02:00
Ludovic Courtès 2a0d5de5a9
Merge branch 'core-updates' 2017-04-03 00:13:06 +02:00
Efraim Flashner 63102406f2
guix: Compress and decompress xz archives in parallel.
* guix/scripts/pack.scm (%compressors): Add flag '-T0' when calling "xz".
* guix/utils.scm (decompressed-port, compressed-port,
compressed-output-port): Same.
2017-04-02 14:42:20 +03:00
Tobias Geerinckx-Rice f264e838c0
substitute: Send ‘User-Agent’ header.
* guix/scripts/substitute.scm (narinfo-request): Pass ‘User-Agent’ #:headers
to ‘build-request’.
2017-03-31 15:33:16 +02:00
Marius Bakke 84157bb8bf
Merge branch 'master' into core-updates
Most conflicts are from 6fd52309b8.
2017-03-30 22:59:53 +02:00
Ludovic Courtès cdb3f734cf
packages: Remove "mips64el-linux" from '%hydra-supported-systems'.
* guix/packages.scm (%hydra-supported-systems): Remove "mips64el-linux".
2017-03-29 22:50:42 +02:00
Ludovic Courtès e1f02f92e9
Replace (compose not PROC) with simpler idioms.
* gnu/packages/bioinformatics.scm (python-pysam)[arguments] <check>:
Use (negate proc) instead of (compose not proc).
* guix/import/cran.scm (recursive-import): Likewise.
* guix/import/elpa.scm (filter-dependencies): Use 'remove' instead of
'(filter (compose not proc) ...)'.
2017-03-28 22:15:44 +02:00
Ricardo Wurmus 1a75083b0d
import cran: Print package stream in the expected order.
* guix/scripts/import/cran.scm (guix-import-cran): Reverse list of packages.
2017-03-28 15:54:10 +02:00
Ricardo Wurmus 2dca8b2d51
import cran: Automatically add gfortran and zlib when needed.
* guix/import/cran.scm (needs-fortran?, needs-zlib?): New procedures.
(description->package): Use them.
2017-03-28 15:37:47 +02:00
Ludovic Courtès 6dfd683dc7
download: Properly parse ftp:// URLs that lack user info.
Fixes a regression introduced in
a4f5423415.

Reported by Hartmut Goebel.

* guix/build/download.scm (ftp-fetch): Account for the case where
'uri-userinfo' returns #f.  Remove the case where it returns "" since
that cannot happen.
2017-03-28 13:30:09 +02:00
Ludovic Courtès bdb59b331b
derivations: Do not fetch narinfos for non-substitutable items.
This avoids connections to substitute servers for derivations that are
not substitutable anyway, such as profiles.

Reported by Andy Wingo.

* guix/derivations.scm (substitution-oracle): Skip derivations that do
not pass 'substitutable-derivation?'.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
New test.
2017-03-28 10:00:05 +02:00
Leo Famulari c17383f400
Merge branch 'master' into core-updates 2017-03-27 21:19:38 -04:00
Alex Kost 689db38e34
ui: Support Texinfo markup in package synopses.
* guix/ui.scm (package-field-string): New procedure.
(package-description-string): Use it.
(package-synopsis-string): New procedure.
(package->recutils): Use it.
* guix/scripts/lint.scm (check-synopsis-style)[check-texinfo-markup]:
New procedure.  Use it in checks.
* tests/lint.scm: Test it.
* gnu/packages/perl.scm (perl-try-tiny)[synopsis]: Adjust for the
Texinfo markup.
2017-03-27 10:55:16 +03:00
Huang Ying 0a5ce0d1df
profiles: Create fonts.dir/scale for all fonts directories.
* guix/profiles.scm (fonts-dir-file): Create fonts.dir/scale files for all
fonts directories.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:52 +02:00
Huang Ying addce19e2d
union: Add create-all-directories? parameter to 'union-build'.
* guix/build/union.scm (union-build): Add create-all-directories? keyword
parameter.
* tests/union.scm ("union-build #:create-all-directories? #t"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-03-26 12:53:48 +02:00
Efraim Flashner 0371b345e8
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-23 14:53:33 +02:00
Ludovic Courtès 4bb5e0aeb3
publish: Add '--nar-path'.
* guix/scripts/publish.scm (show-help, %options): Add '--nar-path'.
(%default-options): Add 'nar-path'.
(guix-publish): Honor it.
2017-03-22 14:05:59 +01:00
Ludovic Courtès cdd7a7d210
publish: Make the nar URL prefix a parameter.
* guix/scripts/publish.scm (narinfo-string): Add #:nar-path and honor it.
(render-narinfo): Likewise.
(make-request-handler): Likewise.
(run-publish-server): Likewise.
* tests/publish.scm ("custom nar path"): New test.
2017-03-22 14:05:59 +01:00
Ludovic Courtès 46f58390cb
publish: Add '--public-key' and '--private-key'.
* guix/scripts/publish.scm (show-help, %options): Add --public-key and
--private-key.
* doc/guix.texi (Invoking guix publish): Document it.
2017-03-22 14:05:59 +01:00
Ludovic Courtès ab2a74e4db
publish: The public and private keys are now SRFI-39 parameters.
* guix/scripts/publish.scm (%default-options): Add 'public-key-file' and
'private-key-file'.
(lazy-read-file-sexp): Remove.
(%private-key, %public-key): Turn into SRFI-39 parameters.
(signed-string, render-narinfo): Adjust accordingly.
(guix-publish): Honor 'public-key-file' and 'private-key-file' from
OPTS.  Use 'parameterize'.
* guix/pk-crypto.scm (read-file-sexp): New procedure.
* tests/publish.scm: Initialize '%public-key' and '%private-key'.
2017-03-22 14:05:59 +01:00
Efraim Flashner 378de69c59
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-22 12:57:37 +02:00
Roel Janssen a4f5423415
download: Handle username and password properties for FTP URIs.
* guix/build/download.scm (ftp-fetch): Process username and password from a URI.
2017-03-21 12:15:14 +01:00
Roel Janssen 193420a803
ftp-client: Allow custom username and password for FTP servers.
* guix/ftp-client.scm (ftp-open): Add username and password arguments.
2017-03-21 12:14:05 +01:00
Mark H Weaver d67f972bd7
download: Remove non-existent kernel mirror.
* guix/download.scm (%mirrors) <kernel.org>: Remove www.all.kernel.org.
2017-03-19 21:18:46 -04:00
Mark H Weaver f67337e23e
Merge branch 'master' into core-updates 2017-03-19 18:52:12 -04:00
Ludovic Courtès 4fd06a4dd1
http-client: Avoid name clash with 'open-connection-for-uri' in 2.2.0.
* guix/build/download.scm (open-connection-for-uri): Add note about
same-named binding in Guile 2.2.0.
* guix/http-client.scm: Use 'guix:open-connection-for-uri' for the
procedure coming from (guix build download).
* guix/scripts/lint.scm: Likewise.
* guix/scripts/substitute.scm: Likewise.
2017-03-18 00:39:50 +01:00
Ludovic Courtès 36626c556e
build: Require Guile >= 2.0.9.
* configure.ac: Bump requirement to 2.0.9.
* doc/guix.texi (Requirements): Adjust accordingly.
* README (Requirements): Likewise.
* build-aux/download.scm: Remove workaround for <http://bugs.gnu.org/13095>.
* guix/build/download.scm: Likewise.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/http-client.scm:  Remove workaround for <http://bugs.gnu.org/13095>.
(http-fetch)[post-2.0.7?]: Remove.  Remove conditional code for not
POST-2.0.7?.
* guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9.
* tests/nar.scm: Use (ice-9 control).
(let/ec): Remove.
2017-03-18 00:39:49 +01:00
Ludovic Courtès 5461115e8f
pack: Add '--target'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:target.
(docker-image): Add #:target.
[build]: Pass it to 'build-docker-image'.
(%options, show-help): Add '--target'.
(guix-pack): Pass TARGET to 'profile-derivation' and to 'build-image'.
* guix/docker.scm (build-docker-image): Add #:system parameter and honor it.
* doc/guix.texi (Invoking guix pack): Document '--target'.
(Additional Build Options): Refer to the Autoconf manual instead of the
obsolete 'configure.info' for cross-compilation.
2017-03-18 00:38:41 +01:00
Ludovic Courtès 176febe377
profiles: Packages in a profile can be cross-compiled.
* guix/profiles.scm (profile-derivation): Add #:target parameter; pass
it to 'gexp->derivation'.
* tests/profiles.scm ("profile-derivation, cross-compilation"): New test.
2017-03-17 23:25:53 +01:00
Ludovic Courtès 48b444304e
pack: Move absolute file name to <compressor>.
* guix/scripts/pack.scm (<compressor>)[package]: Remove.
[command]: Document as being a gexp with an absolute file name.
(%compressors): Adjust accordingly.
(self-contained-tarball): Simplify PATH expression.  Move 'string-join'
for the compressor command on the build side.
(docker-image): Simplify PATH expression.
* tests/pack.scm (%gzip-compressor): Adjust accordingly.
2017-03-17 23:25:53 +01:00
Danny Milosavljevic 4ed64c534a
build/cargo-build-system: Make cargo-build-system install working packages.
* guix/build/cargo-build-system.scm (configure): Remove proprietary
dependencies. Add rust dependencies and configure Cargo to find them.
(build): Also build libraries, not just applications.
(file-sha256): New variable.
(generate-checksums): New variable. Export it.
(touch): New variable.
(install): Generate checksums so Cargo accepts the package.
2017-03-17 16:48:09 +01:00
Danny Milosavljevic 25fb58a3be
build-system/cargo (cargo-build): Add cargo-build-flags, remove configure-flags.
* guix/build-system/cargo.scm (cargo-build): Add cargo-build-flags,
remove configure-flags.
2017-03-17 16:48:08 +01:00
Ricardo Wurmus 2d7c4ae3ee
gnu: r: Rename to r-minimal.
* gnu/packages/statistics.scm (r): Rename to...
(r-minimal): ...this new variable.
(r-with-recommended-packages): Rename to...
(r): ...this.
* guix/build-system/r.scm (default-r): Reference r-minimal.
* gnu/packages/emacs.scm (emacs-ess)[inputs],
gnu/packages/machine-learning.scm (shogun)[inputs],
gnu/packages/python.scm (python-rpy2)[inputs],
gnu/packages/bioinformatics.scm (ribotaper)[inputs],
(couger)[propagated-inputs],
(roary)[inputs],
(rsem)[inputs],
(rcas-web)[inputs]: Change "r" to "r-minimal".
2017-03-17 10:14:02 +01:00
Ricardo Wurmus aeb64f3cb2
gnu: r: Do not build recommended packages.
* gnu/packages/statistics.scm (r)[arguments]: Rename phase
"build-recommended-packages-reproducibly" to "build-reproducibly"; add
configure flag "--without-recommended-packages".
* guix/import/cran.scm (default-r-packages): Remove recommended packages.
* gnu/packages/python.scm (python-rpy2)[inputs]: Add r-survival.
* gnu/packages/bioinformatics.scm (r-ape)[propagated-inputs]: Add r-lattice
and r-nlme.
(r-vegan)[propagated-inputs]: Add r-mass.
(r-genefilter)[propagated-inputs]: Add r-survival.
(r-grohmm)[propagated-inputs]: Add r-mass.
(r-bioccheck)[propagated-inputs]: Add r-codetools.
(r-summarizedexperiment)[propagated-inputs]: Add r-matrix.
(r-topgo)[propagated-inputs]: Add r-lattice.
(r-sva)[propagated-inputs]: Add r-mgcv.
(r-raremetals2)[propagated-inputs]: Add r-mass.
(r-vsn)[propagated-inputs]: Add r-lattice.
(r-pcamethods)[propagated-inputs]: Add r-mass.
* gnu/packages/bioinformatics.scm (r-ggplot2)[propagated-inputs]: Add r-mass.
(r-locfit)[propagated-inputs]: Add r-lattice.
(r-coda)[propagated-inputs]: Add r-lattice.
(r-irlba)[propagated-inputs]: Add r-matrix.
(r-glmnet)[propagated-inputs]: Add r-matrix.
(r-e1071)[propagated-inputs]: Add r-class.
(r-spams)[propagated-inputs]: Add r-lattice and r-matrix.
(r-hmisc)[propagated-inputs]: Add r-cluster, r-foreign, r-lattice, r-nnet, and
r-rpart.
(r-zoo)[propagated-inputs]: Add r-lattice.
(r-mixtools)[propagated-inputs]: Add r-boot and r-mass.
(r-flexmix)[propagated-inputs]: Add r-lattice and r-nnet.
(r-prabclus)[propagated-inputs]: Add r-mass.
(r-fpc)[propagated-inputs]: Add r-class, r-cluster, and r-mass.
(r-rcppeigen)[propagated-inputs]: Add r-matrix.
(r-matrixmodels)[propagated-inputs]: Add r-matrix.
(r-lme4)[propagated-inputs]: Add r-mass and r-nlme.
(r-pbkrtest)[propagated-inputs]: Add r-mass and r-matrix.
(r-car)[propagated-inputs]: Add r-mass, r-mgcv, and r-nnet.
(r-tclust)[propagated-inputs]: Add r-cluster.
2017-03-17 10:14:02 +01:00
Ludovic Courtès db3f2b61ad
pack: Allow for "-S /opt/foo=".
Reported by Andy Wingo.

* guix/scripts/pack.scm (%options): Use 'string-split' instead of
'string-tokenize'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 9e84ea3673
pack: Honor symlinks in the Docker back-end.
* guix/docker.scm (symlink-source, topmost-component): New procedures.
(build-docker-image): Add #:symlinks parameter and honor it.  Remove
hard-coded /bin symlink.
* guix/scripts/pack.scm (docker-image): Pass #:symlinks to
'build-docker-image'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 54241dc8e6
docker: Build images in a reproducible fashion.
* guix/docker.scm (%tar-determinism-options): New variable.
(build-docker-image): Use it on the two 'tar' invocations.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 84dda5a9c0
pack: Use a fixed timestamp in Docker images.
* guix/docker.scm (build-docker-image): Add #:creation-time parameter.
Use SRFI-19 'date->string' instead of 'strftime' et al.
* guix/scripts/pack.scm (docker-image)[build]: Pass #:creation-time to
'build-docker-image'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès b1edfbc37f
pack: Add '--format' option and Docker output support.
* guix/docker.scm: Remove dependency on (guix store) and (guix utils).
Use (guix build store-copy).  Load (json) lazily.
(build-docker-image): Remove #:system.  Add #:closure, #:compressor, and
'image' parameters.  Use 'uname' to determine the architecture.  Remove
use of 'call-with-temporary-directory'.  Use 'read-reference-graph' to
compute ITEMS.  Honor #:compressor.
* guix/scripts/pack.scm (docker-image): New procedure.
(%default-options): Add 'format'.
(%formats): New variable.
(%options, show-help): Add '--format'.
(guix-pack): Honor '--format'.
* guix/scripts/archive.scm: Remove '--format' option.  This reverts
commits 1545a012cb,
01445711db, and
03476a23ff.
* doc/guix.texi (Invoking guix pack): Document '--format'.
(Invoking guix archive): Remove documentation of '--format'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 2971f39c33
pack: Honor command-line options related to the store.
* guix/scripts/pack.scm (guix-pack): Call
'set-build-options-from-command-line'.
2017-03-16 22:50:15 +01:00
Ludovic Courtès 146db52a18
memoization: Micro-optimize code produced by 'define-cache-procedure'.
* guix/memoization.scm (%nothing): Remove.
(define-cache-procedure): Make '%nothing' a local variable, with a
literal list.
2017-03-16 22:50:15 +01:00
Ludovic Courtès d938a58bee
gexp: Add '=>' syntax to import computed modules.
* guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where
the cdr is not a string.
(imported-modules): Support '=>' syntax in MODULES.
* tests/gexp.scm ("imported-files with file-like objects")
("gexp->derivation & with-imported-module & computed module"): New tests.
* doc/guix.texi (G-Expressions): Document '=>' syntax for
'with-imported-modules'.
2017-03-16 22:50:14 +01:00
Ludovic Courtès 4c0c4db070
utils: Move base16 procedures to (guix base16).
* guix/utils.scm (bytevector->base16-string, base16-string->bytevector):
Move to...
* guix/base16.scm: ... here.  New file.
* tests/utils.scm ("bytevector->base16-string->bytevector"): Move to...
* tests/base16.scm: ... here.  New file.
* Makefile.am (MODULES): Add guix/base16.scm.
(SCM_TESTS): Add tests/base16.scm.
* build-aux/download.scm, guix/derivations.scm,
guix/docker.scm, guix/import/snix.scm, guix/pk-crypto.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/store.scm, tests/hash.scm,
tests/pk-crypto.scm: Adjust imports accordingly.
2017-03-16 22:50:14 +01:00
Marius Bakke 4b7e5c1131
Merge branch 'master' into core-updates 2017-03-15 17:52:26 +01:00
Ludovic Courtès 70dfdd501a
syscalls: Adjust 'clone' to Guile 2.2.
Before that, something like:

  (call-with-container
    (lambda ()
      (match (primitive-fork)
        …)))

would hang in 'primitive-fork' as the child process (the one started in
the container) would try to pthread_join the finalization thread in
'stop_finalization_thread' in libguile, not knowing that this thread is
nonexistent.

* guix/build/syscalls.scm (%set-automatic-finalization-enabled?!): New
procedure.
(without-automatic-finalization): New macro.
(clone): Wrap PROC call in 'without-automatic-finalization'.
2017-03-15 15:19:53 +01:00
Ludovic Courtès 81a0f1cdf1
zlib: Don't rely on EBADF being ignored by 'fport_close'.
In 2.2, 'fport_close' no longer swallows EBADF and instead raises a
'system-error' for this.  This commit adjusts for 2.2.

* guix/zlib.scm (close-procedure): Remove.
(make-gzip-input-port): Use 'port->fdes' instead of 'fileno'.
Use 'gzclose' instead of 'close-procedure'.
(make-gzip-output-port): Likewise.
* tests/zlib.scm ("compression/decompression pipe"): Don't check whether
PARENT is closed using 'port-closed?'.  Instead, use 'seek' on the
underlying FD and check for EBADF.
2017-03-15 15:19:53 +01:00
Ludovic Courtès 850edd77f9
pack: Add unit test.
* guix/scripts/pack.scm (self-contained-tarball): Add #:tar option.
[build](tar-supports-sort?): New variable.  Use it.
* tests/pack.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2017-03-14 23:18:32 +01:00
Ludovic Courtès 36f213fb70
pack: Use maximum compression; use '-n' for gzip.
* guix/scripts/pack.scm (<compressor>)[tar-option]: Remove.
[command]: New field.
(%compressors): Provide complete commands.  Use '-9' or equivalent for
each compressor; use '-n' for gzip.
(self-contained-tarball)[build]: Adjust accordingly.
2017-03-14 23:18:32 +01:00
Ludovic Courtès 5895ec8aa2
pack: Add '--symlink'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:symlinks
parameter.
[build](symlink->directives): New procedure
(directives): New variable.
Add call to 'evaluate-populate-directive'.  Pass the directories among
DIRECTIVES to 'tar'.
(%default-options): Add 'symlinks'.
(%options, show-help): Add '--symlink'.
(guix-pack): Honor it.
* gnu/build/install.scm (evaluate-populate-directive): Export.
* doc/guix.texi (Invoking guix pack): Document it.
2017-03-14 17:57:27 +01:00
Ludovic Courtès 6b63c43e06
pack: Add '--localstatedir' option.
* guix/scripts/pack.scm (self-contained-tarball): Add #:localstatedir?
parameter and honor it.
(%options, show-help): Add '--localstatedir'.
(guix-pack): Honor it.
* gnu/build/install.scm (populate-single-profile-directory): Add
 #:register? parameter and honor it.
* doc/guix.texi (Binary Installation): Use '--localstatedir' in
example.
(Invoking guix pack): Document it.
2017-03-14 17:57:27 +01:00
Ludovic Courtès 3b2dc9edcd
upstream: Avoid '_' as a pattern variable in 'match'.
* guix/upstream.scm (lookup-updater): Don't use '_' as a pattern
variable.
2017-03-14 11:19:21 +01:00
Efraim Flashner 3f9543aee1
Merge remote-tracking branch 'origin/master' into core-updates 2017-03-13 23:08:49 +02:00
Ludovic Courtès b111bceecc
download: Export '%x509-certificate-directory'.
* guix/build/download.scm (%x509-certificate-directory): Export, as
expected by (guix scripts pull) since commit
7e81d699de.
2017-03-13 21:52:38 +01:00
Marius Bakke 7e81d699de
pull: Default to HTTPS.
* guix/scripts/pull.scm (%snapshot-url): Use HTTPS.
(guix-pull): Authenticate against LE-CERTS when URL is from Savannah.
2017-03-12 19:39:32 +01:00
Ludovic Courtès 334c95306a
syscalls: Adjust 'define-bits' to macro literal semantics of 2.2.
* guix/build/syscalls.scm (define-bits): Do not define NAMES... as
top-level variables since that prevents literal matches in 2.2.
Instead, determine constant values at expansion time.
2017-03-12 17:47:25 +01:00
Ludovic Courtès 239c22663a
Add 'guix pack'.
* gnu/system/install.scm (self-contained-tarball): Move to...
* guix/scripts/pack.scm: ... here.  New file.
* doc/guix.texi (Binary Installation): Mention 'guix pack'.
(Invoking guix pack): New node.
* build-aux/make-binary-tarball.scm: Remove.
* Makefile.am (MODULES): Add guix/scripts/pack.scm.
(EXTRA_DIST): Remove build-aux/make-binary-tarball.scm.
(guix-binary.%.tar.xz): Rewrite using 'guix pack'.
* build-aux/hydra/gnu-system.scm (tarball-jobs): Adjust accordingly.
2017-03-12 17:47:25 +01:00
Ludovic Courtès e90e0fad1b
Merge branch 'master' into core-updates 2017-03-09 16:35:41 +01:00
Roel Janssen 64fc9f65f1
gexp: Expose functions to allow creating derivation builders.
* guix/gexp.scm: Add load-path-expression and gexp-modules to the public
  interface of the module.  See <http://bugs.gnu.org/26023>.
2017-03-09 12:39:05 +01:00
Ludovic Courtès 3104475148
utils: Use an idiom compatible with both 2.0 and 2.2.
Fixes a regression introduced in 7447aa36e1.
Reported by Ricardo Wurmus.

* guix/utils.scm: Revert 7447aa36e1.  Use
  #:prefix for (ice-9 iconv) to support both 2.0 and 2.2.
2017-03-09 09:48:33 +01:00
Ludovic Courtès 7447aa36e1
utils: Make sure to use the right 'bytevector->string'.
In Guile 2.2, (rnrs io ports) exports 'bytevector->string', which
conflicts with that of (ice-9 iconv).

* guix/utils.scm: Hide 'bytevector->string' from (rnrs io ports).
2017-03-08 23:42:53 +01:00
Ludovic Courtès 1062063a65
ui: Don't use '%default-port-encoding' to set the encoding of string ports.
* guix/ui.scm (right-arrow): Call 'set-port-encoding!' to set PORT's
encoding; remove use of 'with-fluids'.  This is for compatibility with
Guile 2.2 where the encoding of string ports is not influenced by
%DEFAULT-PORT-ENCODING.
* tests/ui.scm ("show-manifest-transaction"): Likewise.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 30906825cb
ui: Avoid '_' as a pattern variable in 'match'.
* guix/ui.scm (fill-paragraph): Don't use '_' as a pattern variable
since that is shadowed by the top-level '_' binding on Guile 2.2.
(show-manifest-transaction): Likewise.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 3f6d5b8a69
download: Update the Savannah mirror list.
* guix/download.scm (%mirrors) <savannah>: Remove centervenus.com, which
seems to be broken.  Add download-mirror.sv.gnu.org as a last resort.
2017-03-08 23:42:53 +01:00
Ludovic Courtès 6aa9d63c92
guix archive: Allow compilation with Guile 2.2.
* guix/scripts/archive.scm (export-from-store): Avoid shadowing the
top-level '_'.
2017-03-08 23:42:52 +01:00
Ludovic Courtès 6c5b56f9fa
gnu: bash: Use the bootstrap Guile in 'url-fetch/reset-patch-level'.
Fixes <http://bugs.gnu.org/25775>.
Reported by Sirgazil, Ricardo Wurmus, Andy Wingo, and others.

* guix/download.scm (in-band-download): Always use GUILE.  This reverts
9f05908fb1.
* gnu/packages/bash.scm (url-fetch/reset-patch-level): Remove #:guile.
Pass %BOOTSTRAP-GUILE as #:guile to 'url-fetch'.  Remove #:guile-for-build
argument in 'gexp->derivation' call.
2017-03-07 23:58:08 +01:00
Marius Bakke 3f98071ac5
Merge branch 'python-tests' 2017-03-03 16:55:43 +01:00
Danny Milosavljevic 7109e0fff8
build-system/cargo: Export %cargo-build-system-modules.
* guix/build-system/cargo.scm (%cargo-build-system-modules): Export.
2017-03-03 12:06:11 +01:00
Manolis Ragkousis 751702676e
guix: build: make-bootstrap: Copy "falloc.h" to the new system.
In glibc-2.25 a dependency on "linux/falloc.h" was added.
This also reverts commit 8f8f250bdc
which is no longer needed. This commit was not compatible with
the glibc version Hurd is using. See
<https://lists.gnu.org/archive/html/guix-devel/2017-02/msg01046.html>

* guix/build/make-bootstrap.scm (make-stripped-libc): Copy "falloc.h"
to the new system.
* gnu/packages/patches/glibc-bootstrap-system.patch: Remove part
that touches fcntl-linux.h.

Problem reported by Andreas Enge <andreas@enge.fr>.
2017-02-27 15:31:06 +02:00
Marius Bakke 8779987bba
Merge branch 'master' into python-tests 2017-02-27 12:42:22 +01:00
Leo Famulari 9f05908fb1
download: Provide a fall-back guile for older daemons.
Fixes <http://bugs.gnu.org/25775>.

* guix/download.scm (in-band-download): Use %bootstrap-guile as a
fall-back when using older daemons that do not have a built-in
downloader.

Written-by: Ricardo Wurmus <rekado@elephly.net>
2017-02-23 14:27:35 -05:00
Efraim Flashner d15432ca9e
Merge remote-tracking branch 'origin/master' into core-updates 2017-02-20 12:56:14 +02:00
Danny Milosavljevic 80345600fa
build: dub-build-system: Don't use "dub run" at all.
It doesn't make sense to run non-test executables (which is what "dub run"
would do).

The "check" function already invokes "dub test" and that's enough.

* guix/build/dub-build-system.scm (build): Remove "dub run" invocation.
2017-02-14 10:18:35 +01:00
Federico Beffa 57075ade97
import: stackage: Avoid using (guix ui) in importer code.
* guix/import/stackage.scm (stackage->guix-package, stackage-lts-info-fetch):
  Raise 'message' condition instead of using 'leave' from (guix ui).
* guix/scripts/import/stackage.scm (guix-import-stackage): Handle conditions.
2017-02-14 08:38:45 +01:00
Marius Bakke 424b1ae769
Merge branch 'master' into python-tests 2017-02-13 22:35:05 +01:00
Ludovic Courtès 768f0ac9dd
Merge branch 'master' into core-updates 2017-02-10 17:40:25 +01:00
Danny Milosavljevic 65e862d1a2
gnu: Add dub-build-system.
* guix/build-system/dub.scm: New file.
* guix/build/dub-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi: Add section for dub-build-system.
2017-02-10 16:21:50 +01:00
Mathieu Lirzin 6554be68b4
git-download: Add 'git-predicate'.
* guix/git-download.scm (git-predicate): New procedure.
* gnu/packages/package-management.scm (current-guix): Use it.
(make-git-predicate): Remove.
2017-02-09 13:56:54 -06:00
Federico Beffa a4824c60ef
import: hackage: Handle unknown packages gracefully.
* guix/import/hackage.scm (hackage-fetch): Add 'guard'.
2017-02-09 19:36:08 +01:00
Federico Beffa bc5844d149
import: Add stackage importer and updater.
* guix/import/stackage.scm: New file.
* guix/scripts/import/stackage.scm: New file.
* Makefile.am (MODULES): Add new files.
* guix/scripts/import.scm (importers): Add "stackage".
* guix/scripts/refresh.scm (%updaters): Add %stackage-updater.
* doc/guix.texi (Invoking 'guix import'): Document the importer.
  (Invoking 'guix refresh'): Add stackage to option --type valid values.
* guix/import/hackage.scm (guix-package->hackage-name, hackage-fetch,
  hackage-source-url, hackage-cabal-url, hackage-package?): Export them.
2017-02-09 19:36:08 +01:00
Federico Beffa 81e0bc1834
import: json: Explicitly ask for JSON data.
* guix/import/json.scm (json-fetch): Add #:headers to http-fetch call.
2017-02-09 19:36:04 +01:00
Ludovic Courtès 4eaac4b722
import: pypi: Correctly handle multiple-URL origins.
Fixes <https://bugs.gnu.org/25635>.
Reported by Sergei Trofimovich <slyfox@inbox.ru>.

* guix/import/pypi.scm (guix-package->pypi-name)[url->pypi-name]: New
procedure.
Rewrite body to match lists in addition to strings.
* tests/pypi.scm ("guix-package->pypi-name, several URLs"): New test.
2017-02-08 16:17:05 +01:00
Ying Huang 06d7d1190e
profiles: gtk-im-modules: Fix for gtk3.
Gtk+3 now have multiple outputs, so the gtk-query-immodules-3.0 should be find
in output "bin" instead of "out".

* guix/profiles.scm (gtk-im-modules): Pass the path of gtk-query-immodules-x.x
as 'query' argument to the 'build' procedure.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2017-02-08 20:12:20 +08:00
Ludovic Courtès 7597478e2e
file-systems: Add '%network-configuration-files' and '%network-file-mappings'.
* gnu/system/file-systems.scm (%network-configuration-files)
(%network-file-mappings): New variables.
* guix/scripts/environment.scm (%network-configuration-files): Remove.
(launch-environment/container): Refer to '%network-file-mappings'
instead of calling 'filter-map'.
2017-02-07 00:08:10 +01:00
Ludovic Courtès d2a5e6982d
file-systems: Add 'file-system-mapping->bind-mount'.
* gnu/system/file-systems.scm (file-system-mapping->bind-mount): New
procedure.
* gnu/system/linux-container.scm (mapping->file-system): Remove.
(containerized-operating-system)[mapping->fs]: Use
'file-system-mapping->bind-mount' instead of 'mapping->file-system'.
* guix/scripts/environment.scm (launch-environment/container): Likewise.
2017-02-03 00:23:28 +01:00
Leo Famulari e8c83d04e1
Merge branch 'master' into core-updates 2017-02-02 10:52:24 -05:00
Ricardo Wurmus de643f0c15
build: r-build-system: Use deterministic built date.
Fixes <http://bugs.gnu.org/25598>.

* guix/build/r-build-system.scm (install): Pass "--built-timestamp" option to
make build deterministic.
2017-02-02 15:20:50 +01:00
Ludovic Courtès 93897a4538
download: Add GNOME mirror.
* guix/download.scm (%mirrors): Add "https://download.gnome.org".
2017-02-01 23:53:35 +01:00
Tobias Geerinckx-Rice 814b099a20
download: Add ‘url-fetch/zipbomb’.
From this suggestion by Ludovic Courtès:
<http://lists.gnu.org/archive/html/guix-devel/2016-09/msg01983.html>

* guix/download.scm (url-fetch/zipbomb): New procedure.
2017-02-01 15:53:33 +01:00
Tobias Geerinckx-Rice 58f91e4d03
download: url-fetch/tarball: Make ‘name’ truly optional.
* guix/download.scm (url-fetch/tarbomb): Fall back to ‘file-name’ if
‘name’ is #f, like the regular ‘url-fetch’ does.
* gnu/packages/bioinformatics.scm (muscle)[source]: Remove ‘file-name’.
* gnu/packages/engineering.scm (fastcap)[source]: Likewise.
* gnu/packages/scheme.scm (scmutils)[source]: Likewise.
2017-02-01 15:53:32 +01:00
Ludovic Courtès f1a892c96f
lint: Use the "@" syntax for versioned packages in warnings.
* guix/scripts/lint.scm (emit-warning): Use the "@" syntax.
2017-01-31 23:51:09 +01:00
Christopher Baines c003546b0c
environment: Fix setting writable? on networking related files
* guix/scripts/environment.scm (launch-environment/container): Include the
  file name in the call to string=? when deciding if the file should be
  writable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-30 10:52:45 +01:00
Ludovic Courtès 0d268c5d70
store: Add 'add-data-to-store'.
* guix/serialization.scm (write-bytevector): New procedure.
(write-string): Rewrite in terms of 'write-bytevector'.
* guix/store.scm (write-arg): Add 'bytevector' case.
(add-data-to-store): New procedure, from former 'add-text-to-store'.
(add-text-to-store): Rewrite in terms of 'add-data-to-store'.
* tests/store.scm ("add-data-to-store"): New test.
2017-01-30 10:52:45 +01:00
Ludovic Courtès 86a6ff4bb0
build-system/python: 'package-with-explicit-python' uses 'eq?' memoization.
* guix/build-system/python.scm (package-with-explicit-python): Use
'mlambdaq' instead of 'mlambda'.  This does not change the <package>
graph and has no visible impact on performance.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3d520b5428
gnu-maintenance: 'gnu-package?' uses 'eq?' memoization.
* guix/gnu-maintenance.scm (gnu-package?): Use 'mlambdaq' instead of
'mlambda'.
2017-01-28 18:55:20 +01:00
Ludovic Courtès c9134e82fe
packages: Remove 'define-memoized/v' and use 'mlambdaq' instead.
* guix/packages.scm (define-memoized/v): Remove.
(package-transitive-supported-systems): Use 'mlambdaq' instead of
'define-memoized/v'.
(package-input-rewriting)[replace]: Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 55b2d92145
Use 'mlambda' instead of 'memoize'.
* gnu/packages.scm (find-newest-available-packages): Use 'mlambda'
instead of (memoize (lambda ...) ...).
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Likewise.
* guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]:
Likewise.
* guix/build-system/python.scm (package-with-explicit-python)[transform]:
Likewise.
* guix/derivations.scm (derivation->string): Likewise.
* guix/gnu-maintenance.scm (gnu-package?): Likewise.
* guix/modules.scm (module-file-dependencies): Likewise.
* guix/scripts/graph.scm (standard-package-set): Likewise.
* guix/scripts/lint.scm (official-gnu-packages*): Likewise.
* guix/store.scm (store-regexp*): Likewise.
* guix/utils.scm (location): Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès f9704f179a
Add (guix memoization).
* guix/combinators.scm (memoize): Remove.
* guix/memoization.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm, gnu/packages/bootstrap.scm,
guix/build-system/gnu.scm, guix/build-system/python.scm,
guix/derivations.scm, guix/gnu-maintenance.scm,
guix/import/cran.scm, guix/import/elpa.scm,
guix/modules.scm, guix/scripts/build.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/store.scm, guix/utils.scm: Adjust imports accordingly.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3b0fcc672d
packages: Add 'package-upstream-name' and use it.
* guix/packages.scm (package-upstream-name): New procedure.
* guix/gnu-maintenance.scm (gnu-package?, ftp-server/directory)
(latest-release*, latest-gnome-release)
(latest-kde-release): Use it instead of the inline expression.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 21f4a7c116
import: github: Better tolerate unexpected file extensions.
* guix/import/github.scm (find-extension): Add ".tbz".
(updated-github-url): When 'find-extension' returns #f, use "" for EXT.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 6715e1ff2e
gnu-maintenance: 'gnu-package?' ignores invalid URLs.
* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: Add '>>'
threading macro and use it.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 2e2cf9a3bd
gnu-maintenance: GNU updater handles gnu.org-hosted Emacs packages.
* guix/gnu-maintenance.scm (pure-gnu-package?): If an "emacs-" package
matches 'gnu-hosted?', return true.
(gnu-hosted?): New procedure.
2017-01-28 00:38:20 +01:00
Ludovic Courtès b03218d532
gnu-maintenance: Honor 'upstream-name' property in GNU updater.
* guix/gnu-maintenance.scm (gnu-package?): Honor the 'usptream-name'
property of PACKAGE.
(ftp-server/directory): Likewise.
2017-01-28 00:38:19 +01:00
Marius Bakke 5a64a79131
utils: Add helper method to make files writable.
* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
2017-01-26 22:19:16 +01:00
Ludovic Courtès 1d636d6319
build-system/gnu: Add 'reset-gzip-timestamps' phase.
* guix/build/gnu-build-system.scm (reset-gzip-timestamps): New
procedure.
(%standard-phases): Add it.
2017-01-26 22:05:49 +01:00
Ludovic Courtès 95e7be9728
utils: Add 'gzip-file?' and 'reset-gzip-timestamp'.
* guix/build/utils.scm (%gzip-magic-bytes): New variable.
(gzip-file?, reset-gzip-timestamp): New procedures.
2017-01-26 21:58:37 +01:00
Ricardo Wurmus 0db2ff65e7
bournish: Extend 'rm' command.
* guix/build/bournish.scm (rm-command): New procedure.
(%commands): Use it.
* tests/bournish.scm: Add tests for "rm" and "rm -r".
2017-01-26 13:49:56 +01:00
Carlo Zancanaro 2f977d92d3
import: pypi: Don't add setuptools to propagated-inputs.
* guix/import/pypi.scm (compute-inputs): Don't add setuptools to the imported
  package's propagated-inputs.
2017-01-26 13:44:31 +01:00
Ludovic Courtès 0363474a0b
build-system/gnu: 'strip' phase now skips symlinks.
This avoids a situation where the "debug" output would contain separate
(and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
though "libfoo.so" is actually a symlink to "libfoo.so.0.0".

* guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
'for-each' lambda.  Pass a predicate to 'find-files' to restrict the
result to regular files.
2017-01-26 11:29:38 +01:00
Mathieu Othacehe db6afe387a
copy: Use userauth-public-key/auto! for ssh authentification.
* guix/scripts/copy.scm (open-ssh-session): Replace userauth-agent! by
  userauth-public-key/auto!. This way, if ssh-agent is not run,
  default ssh key (~/.ssh/id_rsa) will be used as a fallback.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-26 11:26:24 +01:00
Leo Famulari d123f2f991
Merge branch 'master' into core-updates 2017-01-25 12:42:39 -05:00
Christopher Baines 0ca575f3bb
container: Pass through TERM when calling exec.
* guix/scripts/container/exec.scm (guix-container-exec): Capture the value of
  the TERM environment variable, and pass it through to the container.  This
  means some applications now work where they did not before (e.g. htop), and
  others have more functionality, providing that the terminal was capable of
  enabling that functionality in the first place.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-01-25 14:27:31 +01:00
Ludovic Courtès 482fda2729
grafts: Do not pull derivation outputs not depended on.
Fixes <http://bugs.gnu.org/24886>.

Previously, the grafting derivation of, say, brdf-explorer would pull in
qt:doc even though brdf-explorer depends only on qt:out, not qt:doc.

* guix/grafts.scm (with-cache): Use 'vhash-assoc' and 'vhash-cons'
instead of 'vhash-assq' and 'vhash-consq'.
(cumulative-grafts): Pass #:outputs to 'graft-derivation/shallow'.  Use
OUTPUTS instead of (derivation-output-names drv).
(graft-derivation): Add #:outputs parameter; pass it to
'cumulative-grafts'.
* tests/grafts.scm (make-derivation-input): New variable.
("graft-derivation, replaced derivation has multiple outputs"): Make
sure P2:zzz is not part of the outputs of P3D.
("graft-derivation with #:outputs")
("graft-derivation, unused outputs not depended on"): New tests.
2017-01-25 11:04:25 +01:00
Ludovic Courtès fd7d1235f1
grafts: Shallow grafting can be performed on a subset of the outputs.
* guix/grafts.scm (graft-derivation/shallow): Add #:outputs parameter.
[outputs]: Rename to...
[output-pairs]: ... this.  Adjust 'build-expression->derivation' call
accordingly.
2017-01-24 23:09:06 +01:00
Ludovic Courtès 3483f004a9
syscalls: Export 'read-utmpx'.
* guix/build/syscalls.scm (read-utmpx-from-port): New procedure.
* tests/syscalls.scm ("read-utmpx, EOF")
("read-utmpx"): New tests.
2017-01-24 00:46:37 +01:00
Ludovic Courtès 58ea4d407c
Merge branch 'master' into core-updates 2017-01-23 22:33:10 +01:00
Ludovic Courtès fcd75bdbfa
search-paths: Allow specs with #f as their separator.
This adds support for single-entry search paths.
Fixes <http://bugs.gnu.org/25422>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/search-paths.scm (<search-path-specification>)[separator]:
Document as string or #f.
(evaluate-search-paths): Add case for SEPARATOR as #f.
(environment-variable-definition): Handle SEPARATOR being #f.
* guix/build/utils.scm (list->search-path-as-string): Add case for
SEPARATOR as #f.
(search-path-as-string->list): Likewise.
* guix/build/profiles.scm (abstract-profile): Likewise.
* tests/search-paths.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* tests/packages.scm ("--search-paths with single-item search path"):
New test.
* gnu/packages/version-control.scm (git)[native-search-paths](separator):
New field.
2017-01-23 22:23:41 +01:00
Ludovic Courtès c5746f2399
guix package: Honor the order of profiles when -p appears multiple times.
* guix/scripts/package.scm (process-query): Reverse the order of
PROFILES.
* tests/guix-package-net.sh: Test it with '--search-paths'.
2017-01-23 22:21:23 +01:00
Ludovic Courtès ac080e296e
lint: Display PACKAGE@VERSION.
* guix/scripts/lint.scm (run-checkers): Remove 'name' variable.  Display
PACKAGE@VERSION instead of PACKAGE-VERSION.
2017-01-21 16:43:26 +01:00
Ludovic Courtès 150309726f
syscalls: Add utmpx procedures and data structure.
* guix/build/syscalls.scm (<utmpx-entry>): New record type.
(%utmpx): New C struct.
(login-type): New bits.
(setutxent, endutxent, getutxent, utmpx-entries): New procedures.
2017-01-19 23:21:25 +01:00
Ludovic Courtès 57f068bec5
syscalls: Extract 'bytes->string'.
* guix/build/syscalls.scm (bytes->string): New procedure.
(bytevector->string-list): Use it.
2017-01-19 23:20:57 +01:00
Mathieu OTHACEHE d18b79fed8
import: github: Catch HTTP 403 error during fetch.
* guix/import/github.scm (json-fetch*): Catch 403 HTTP error that may be
  raised if a github token has not been set.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-19 17:17:16 +01:00
Ludovic Courtès 840f38ba37
guix environment, build: Allow absolute file names with '--root'.
Reported by Chris Webber.

* guix/scripts/build.scm (register-root): If ROOT is absolute, keep it
as is.
* guix/scripts/environment.scm (register-gc-root): Likewise.
* tests/guix-environment.sh (expected): Add test.
2017-01-19 00:11:15 +01:00
Ludovic Courtès 0aeed5e310
grafts: Preserve the cache across recursive calls.
Before this commit, we'd lose the cache across recursive calls to
'cumulative-grafts', which isn't great performance-wise.

This bug was already present before
d38bc9a9f6.

* guix/grafts.scm (with-cache): In the miss case, call 'current-state'
after EXP has been evaluated.
2017-01-16 22:13:21 +01:00
Ludovic Courtès 90ad5c8836
grafts: Actually cache grafts during the derivation DAG traversal.
This fixes a regression introduced in
d38bc9a9f6 whereby the cache was
effectively disabled.

Reported by Thomas Danckaert <thomas.danckaert@gmail.com>.

* guix/grafts.scm (with-cache): In the cache miss case, wrap body in
'mbegin'.
2017-01-16 22:13:21 +01:00
Christopher Baines 849a1b8133
profiles: Export 'ca-certificate-bundle'.
* guix/profiles.scm: Export ca-certificate-bundle, such that it can be used in
other G-expressions.  This is useful where these G-expressions run programs
that require a ca-certificate-bundle, e.g. git.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-16 11:03:42 +01:00
Ludovic Courtès 6da5bb7b1b
guix build: Add '--repair'.
* guix/scripts/build.scm (show-help, %options): Add '--repair'.
* doc/guix.texi (Invoking guix gc): Mention 'guix build --repair'.
(Additional Build Options): Document it.
2017-01-15 22:47:25 +01:00
Ludovic Courtès d9da3a757d
guix build: Do not force 'build-cores', 'max-build-jobs', and 'max-silent-time'.
This lets the daemon use its own default settings unless otherwise
specified.

* guix/scripts/build.scm (set-build-options-from-command-line): Do not
provide default values for #:build-cores and #:max-build-jobs.
(%default-options): Remove 'max-silent-time'.
2017-01-15 15:43:22 +01:00
Ludovic Courtès deac976d3d
daemon: Client settings no longer override daemon settings.
Fixes <http://bugs.gnu.org/20217>.

* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x161.
* nix/nix-daemon/nix-daemon.cc (performOp): "build-max-jobs",
"build-max-silent-time", and "build-cores" are no longer read upfront;
instead, read them from the key/value list at the end.
* nix/nix-daemon/guix-daemon.cc (main): Explicitly set
'settings.maxBuildJobs'.
* guix/store.scm (%protocol-version): Bump to #x161.
(set-build-options): #:max-build-jobs, #:max-silent-time, and
 #:build-cores now default to #f.  Adjust handshake to new protocol.
* tests/store.scm ("build-cores"): New test.
* tests/guix-daemon.sh: Add test for default "build-cores" value.
2017-01-15 15:43:22 +01:00
Ludovic Courtès 153b62957c
challenge: Add '--verbose'.
* guix/scripts/challenge.scm (summarize-report): Add #:verbose?
parameter.
[report-hashes]: New procedure.  Use it.
Honor VERBOSE? in the 'match case.
(show-help, %options): Add '--verbose'.
(guix-challenge): Honor it.
2017-01-14 00:57:51 +01:00
Ludovic Courtès 4d8e95097e
challenge: Return comparison reports instead of just discrepancies.
This makes it easier to distinguish between matches, mismatches, and the
various cases of inconclusive reports.

* guix/scripts/challenge.scm (<discrepancy>): Rename to...
(<comparison-report>): ... this.  Add 'result' field.
(comparison-report): New macro.
(comparison-report-predicate, comparison-report-mismatch?)
(comparison-report-match?)
(comparison-report-inconclusive?): New procedures.
(discrepancies): Rename to...
(compare-contents): ... this.  Change to return a list of
<comparison-report>.  Remove calls to 'warning'.
(summarize-discrepancy): Rename to...
(summarize-report): ... this.  Adjust to <comparison-report>.
(guix-challenge): Likewise.
* tests/challenge.scm ("no discrepancies")
("one discrepancy"): Adjust to new API.
("inconclusive: no substitutes")
("inconclusive: no local build"): New tests.
2017-01-14 00:57:51 +01:00
ng0 d8c8e423ed
licenses: Add wtfpl2.
* guix/licenses.scm (wtfpl2): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
2017-01-13 14:13:01 -05:00
Ludovic Courtès 608a50b66c
http-client: Provide 'User-Agent' header by default.
* guix/http-client.scm (http-fetch): Add #:headers parameter and honor
it.  Rename 'auth-header' to 'headers'.
* guix/import/github.scm (json-fetch*): Add comment about required
User-Agent.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 4cd5ec801b
import: github: Fix regression on the /releases retrieval.
Fixes a regression introduced in
62bd24db39, which introduced a call to
'hash-table->alist'.

* guix/import/github.scm (json-fetch*): New procedure.
(latest-released-version): Use it.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 6d30b1b2ca
ui: Wrap 'canonicalize-path' for better error reporting.
Reported by Christopher Baines.

* guix/ui.scm (canonicalize-path): New procedure.
2017-01-13 18:24:19 +01:00
Ludovic Courtès e7ff05438f
ui: Factorize error-reporting wrapper code.
* guix/ui.scm (augmented-system-error-handler): New procedure.
(error-reporting-wrapper): New macro.
(symlink, copy-file): Define using 'error-reporting-wrapper'.
2017-01-13 18:24:19 +01:00
Leo Famulari cc0725914e
Merge branch 'master' into python-tests 2017-01-13 10:21:17 -05:00
Ludovic Courtès 4cdff6ae37
challenge: Use a warning when substitutes are lacking.
* guix/scripts/challenge.scm (discrepancies): Use 'warning' instead of
'leave'.
2017-01-12 23:28:45 +01:00
Ludovic Courtès 26ab00a0a9
perform-download: Add backward-compatible case.
This is meant to ease transition for people running an older guix-daemon
invoking a recent 'guix perform-download' with only one argument.

This is a followup to 9b5364a3af.

* guix/scripts/perform-download.scm (perform-download): Make 'output'
optional.  Bind 'output*' from DRV's "out" and honor it.
(guix-perform-download): Add clause with one argument.
2017-01-11 23:01:54 +01:00
Mathieu Lirzin dc673fa113
derivations: Make <derivation> record datatype immutable.
* guix/derivations.scm (<derivation>): Make it immutable.
(derivation): Use generic 'set-field' instead of ad-hoc functional setter.
2017-01-11 18:55:31 +01:00
Mathieu Lirzin 5c6a30c511
git download: Remove redundant argument in 'gexp->derivation' call.
* guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
'#:local-build?' keyword argument.
2017-01-11 18:55:26 +01:00
Ludovic Courtès 9b5364a3af
daemon: Allow check builds of 'builtin:download' derivations.
Fixes <http://bugs.gnu.org/25089>.
Reported by Leo Famulari <leo@famulari.name>.

* nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin'
case, check whether DRV's output is in 'redirectedOutputs', and pass an
'output' argument to the built-in builder.
(DerivationGoal::addHashRewrite): Add 'printMsg' call.
* nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter.
* nix/libstore/builtins.cc (builtinDownload): Likewise.
Add OUTPUT to ARGV.
* guix/scripts/perform-download.scm (perform-download): Add 'output'
parameter.
(guix-perform-download): Adjust 'match' clauses accordingly.
* tests/derivations.scm ("'download' built-in builder, check mode"): New
test.
2017-01-11 17:06:31 +01:00
Ludovic Courtès aa042770da
guix package: Fix version and output for 'guix package -i /gnu/store/…'.
* guix/utils.scm (package-name->name+version): Add optional 'delimiter'
parameter.
* guix/scripts/package.scm (store-item->manifest-entry): Pass #\- as the
delimiter for 'package-name->name+version'.  Use "out" instead of #f for
the 'output' field.
* tests/guix-package.sh: Add test.
2017-01-11 11:58:21 +01:00
Ludovic Courtès 1545a012cb
guix archive: Allow compilation in the absence of Guile-JSON.
Fixes <http://bugs.gnu.org/25409>.
Reported by Ben Woodcroft <b.woodcroft@uq.edu.au>.

* guix/scripts/archive.scm: Use 'module-autoload!' instead of #:use-module
to (guix docker).
2017-01-10 15:56:49 +01:00
Ludovic Courtès dd1141eba2
http-client: Improve error reporting.
* guix/http-client.scm (http-fetch): Change message in &message
condition to include URI, CODE, and the reason phrase.
2017-01-10 15:34:11 +01:00
Ludovic Courtès 01445711db
guix archive: '-f docker' supports package names as arguments.
This allows users to type:

  guix archive -f docker emacs

as was already the case for the 'nar' format.

Reported by David Thompson.

* guix/scripts/archive.scm (%default-options): Add 'format'.
(export-from-store): Dispatch based on the 'format' key in OPTS.
(guix-archive): Call 'export-from-store' in all cases when the 'export'
key is in OPTS.
2017-01-07 22:55:40 +01:00
Leo Famulari 74288230ea
Merge branch 'master' into core-updates 2017-01-06 17:14:41 -05:00
Ricardo Wurmus 03476a23ff
guix: Add Docker image export.
* guix/docker.scm: New file.
* Makefile.am (MODULES): Register it.
* guix/scripts/archive.scm (show-help, %options, guix-archive): Add
support for "--format".
* doc/guix.texi (Invoking guix archive): Document it.
2017-01-06 16:44:00 +01:00
Ludovic Courtès 76c31074c8
derivations: Share a cache between 'derivation' and 'read-derivation'.
This leads a 13% speedup on 'guix build libreoffice -d' and 18% on
'guix build gnome -d'.

* guix/derivations.scm (%derivation-cache): New variable.
(read-derivation): Use it instead of the private 'cache' variable.
(derivation): Populate %DERIVATION-CACHE before returning.
2017-01-05 23:45:39 +01:00
Ludovic Courtès 6d943e553d
derivations: Micro-optimize 'write-derivation'.
* guix/derivations.scm (write-derivation)[write-input]: Use 'display'
instead of 'write' for PATH.
Use 'simple-format' instead of 'format', and '~a' instead of '~s' for
SYSTEM and BUILDER.
2017-01-05 23:45:38 +01:00
Ludovic Courtès b96a0640a3
graph: Add '%reverse-package-node-type'.
* guix/scripts/graph.scm (%reverse-package-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("reverse package DAG"): New test.
* doc/guix.texi (Invoking guix refresh): Add cross-reference to
"Invoking guix graph".
(Invoking guix graph): Document 'reverse-package'.
2017-01-04 16:18:53 +01:00
Ludovic Courtès d38bc9a9f6
grafts: Move caching to a new 'with-cache' macro.
* guix/grafts.scm (with-cache): New macro.
(cumulative-grafts)[return/cache]: Remove.
Use 'with-cache' instead.
2017-01-04 16:18:52 +01:00
Julien Lepiller e6876cb9dc
gnu: Add ocaml-build-system.
* guix/build/ocaml-build-system.scm: New file.
* guix/build-system/ocaml.scm: New file.
* Makefile.am (MODULES): Add them.
* gnu/packages/ocaml.scm (ocaml)[native-search-paths]: Adjuste OCAMLPATH.

Signed-off-by: David Craven <david@craven.ch>
2017-01-04 16:03:39 +01:00
David Craven ee17a9e06e
git-download: Add some helpers.
* guix/git-download.scm (git-version, git-file-name): New variables.
2017-01-04 11:44:07 +01:00
David Craven 3b7ccbe94c
build-system: cargo: Use correct cargo.
* gnu/packages/rust.scm (cargo-bootstrap): Make private.
* guix/build-system/cargo.scm (default-cargo): Use cargo.
2017-01-04 11:29:15 +01:00
Manolis Ragkousis 484437bd43
guix: build: make-bootstrap: Copy libpthread_nonshared.a to the new system.
* guix/build/make-bootstrap.scm (%libc-object-files-rx): Update regexp.
2017-01-03 16:00:43 +02:00
Ludovic Courtès d925cdc35f
ui: Keep the word "Copyright" untranslated.
Suggested by John Darrington <john@darrington.wattle.id.au>.

* guix/ui.scm (show-version-and-exit): Make "Copyright (C) 2017"
untranslatable, except "(C)" itself, like Gnulib's version-etc does.
2017-01-02 23:14:36 +01:00
Ludovic Courtès eeb05e87d3
guix hash: '-x' excludes '.git' even when it is a regular file.
* guix/scripts/hash.scm (guix-hash)[vcs-file?]: Add case for '.git'
regular files.
2017-01-02 15:23:21 +01:00
Ludovic Courtès 74d862e8a2
ui: It's 2017 now!
* guix/ui.scm (show-version-and-exit): Change year to 2017.
2017-01-01 23:38:52 +01:00
Ludovic Courtès a6e0ae4046
syscalls: 'terminal-columns' swallows ENOSYS.
* guix/build/syscalls.scm (terminal-columns): Catch ENOSYS.
2017-01-01 23:38:07 +01:00
Ludovic Courtès fef494d27d
gnu-maintenance: Update ViewVC URLs.
* guix/gnu-maintenance.scm (%gnumaint-base-url): Change "/gnumaint" to
"/womb/gnumaint".
(%package-list-url, %package-description-url): Adjust accordingly.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 5e2e4a51f9
gexp: Support 'ungexp' forms in improper lists.
* guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace
the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists.
Adjust clause bodies accordingly.
* tests/gexp.scm ("one input package, dotted list"): New test.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 4a6e889feb
gexp: Properly report substitution errors.
* guix/gexp.scm (gexp)[substitute-ungexp]: Wrap body in 'with-syntax'
and pass EXP as the last argument to 'syntax-error'.
[substitute-ungexp-splicing]: Pass EXP as the last argument to
'syntax-error'.
2017-01-01 23:30:30 +01:00
David Craven f1d136957d
build-system: cargo: Handle Cargo.lock file not present.
* guix/build-system/cargo.scm (cargo-build): Add src output.
  (private-keywords): Add #:outputs.
* guix/build/cargo-build-system.scm (configure): Use /share/rust-source
  when replacing inputs.
  (build, check): Don't do anything when there isn't a Cargo.lock file
  present.
  (install): Install sources to src output. When a Cargo.lock file is
  present use cargo install to install binaries to out.
* guix/import/crate.scm (make-crate-sexp): Importer uses the src output
  for crate inputs by default.
* guix/import/utils.scm (package-names->package-inputs, maybe-inputs,
  maybe-native-inputs): Take an optional output argument.
* tests/crate.scm (crate->guix-package test): Update.

Problem reported by Francisco Gómez García <espectalll@kydara.com>.
2017-01-01 18:20:52 +01:00
David Craven f53a5514e0
import: crate: Provide a default home-page value.
* guix/import/crate.scm (make-crate-sexp): Provide a default home-page
  value.
* tests/crate.scm (test-crate): Add repository field.

Problem reported by ng0 <ng0@libertad.pw>.
2017-01-01 18:12:06 +01:00
David Craven dc77498c1c
build-system: cargo: Make Cargo.toml writeable.
* guix/build/cargo-build-system.scm (configure): Make sure Cargo.toml
  is writeable before attempting modification.

Problem reported by Danny Milosavljevic <dannym@scratchpost.org>.
2017-01-01 18:11:57 +01:00
Ludovic Courtès f11c444d44
Add 'guix copy'.
* guix/scripts/copy.scm: New file.
* guix/scripts/archive.scm (options->derivations+files): Export.
* doc/guix.texi (Invoking guix copy): New node.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/scripts/copy.scm.
* po/guix/POTFILES.in: Likewise.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 13164a2102
ssh: 'retrieve-files' detects remote export failures.
* guix/ssh.scm (retrieve-files): Call 'lookahead-u8' and raise a
'&message' condition when it returns EOF.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 23973e4fbf
ssh: 'send-files' returns the list of items sent.
* guix/ssh.scm (send-files): Return MISSING.
2016-12-31 18:35:29 +01:00
Ludovic Courtès e9629e8221
ssh: Allow transfers of complete closures.
* guix/ssh.scm (store-export-channel, send-files)
(file-retrieval-port, retrieve-files): Add #:recursive? parameter and
honor it.
2016-12-31 18:35:29 +01:00
Ludovic Courtès c0b2d08bf4
git-download: Use a single download script for all derivations.
That way, we have only one /gnu/store/…-git-download instead of one
/gnu/store/…-PACKAGE-checkout-builder for each package.

This is a followup to ced200328c.

* guix/git-download.scm (git-fetch)[build]: Get the URL, commit, and
recursive parameter using 'getenv'.  Pass #:script-name and #:env-vars
arguments to 'gexp->derivation'.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 987a29ba43
Add (guix ssh) module.
* guix/scripts/offload.scm (connect-to-remote-daemon)
(store-import-channel, store-export-channel, send-files)
(retrieve-files): Move to (guix ssh).
(nonce): Add optional 'name' parameter and use it.
(retrieve-files*): New procedure.
(transfer-and-offload): Use it instead of 'retrieve-files', and add
first parameter to 'send-files'.
(assert-node-can-import): Likewise.
(assert-node-can-export): Use 'retrieve-files' instead of
'store-export-channel'.
* guix/ssh.scm: New file.
* configure.ac: Use 'GUIX_CHECK_GUILE_SSH' and define 'HAVE_GUILE_SSH'
Automake conditional.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/ssh.scm.
2016-12-31 01:44:04 +01:00
Carlo Zancanaro 681a555b83
import: elpa: Import dependencies as propagated-inputs
* guix/import/elpa.scm (elpa-package->sexp): Import dependencies as
propagated-inputs.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Carlo Zancanaro 36225d4fef
import: elpa: Fix call-with-downloaded-file
* guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour
match documentation string.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Ludovic Courtès 7c247809ef
guix build: '--with-source' overrides the 'replacement' of a package.
* guix/scripts/build.scm (package-with-source): Set 'replacement' to #f.
* tests/scripts-build.scm ("options->transformation, with-source,
replacement"): New test.
2016-12-21 23:48:14 +01:00
Ludovic Courtès 62bd24db39
import: github: Use 'json-fetch'.
* guix/import/github.scm (json-fetch*): Remove.
(latest-released-version): Adjust accordingly.
2016-12-20 19:14:41 +01:00
Ludovic Courtès f943c317fb
environment: Add '--root' option.
* guix/scripts/environment.scm (show-help, %options): Add --root.
(register-gc-root): New procedure.
(guix-environment): Call 'register-gc-root' when OPTS has a 'gc-root'
option.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add tests.
2016-12-20 19:14:41 +01:00
Marius Bakke 4cb7786eff
import: pypi: Match new 'pypi-uri' domain in updater.
* guix/import/pypi.scm (pypi-package?): Match pypi.io domain.
2016-12-20 12:57:26 +01:00
Ludovic Courtès d343a60f93
gexp: Slightly simplify 'gexp-inputs'.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove unneeded
'if' in the non-native nested gexp case.
2016-12-19 17:51:00 +01:00
Ludovic Courtès 5b14a7902c
gexp: Native inputs of nested gexps are properly accounted for.
Previously, 'gexp-native-inputs' would not return the native inputs of
nested gexps.  For example, this:

  (gexp-native-inputs #~(foo #$#~(bar #+coreutils)))

would return '().

* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the
non-recursive cases, check whether N? and NATIVE? are the same, and act
accordingly.
[native-input?]: Remove.
Fold over all of (gexp-references exp).
* tests/gexp.scm ("ungexp + ungexp-native, nested, special mixture"):
New test.
* tests/gexp.scm ("input list splicing + ungexp-native-splicing"): Pass
 #:native? #t to 'gexp-input'.
2016-12-19 17:51:00 +01:00
Ricardo Wurmus fdbc84b056
import cran: Handle HTTP errors.
Fixes <http://bugs.gnu.org/23479>.

* guix/import/cran.scm (fetch-description): Return #f in case of HTTP
errors.
2016-12-17 19:13:42 +01:00
Ricardo Wurmus d68ba5f483
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 64ce53eb5e
import cran: Add "recursive" option.
* guix/scripts/import/cran.scm: (%options): Add "recursive" option.
(guix-import-cran): Handle "recursive" option.
* doc/guix.texi (Invoking guix import): Document it.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 94e907b962
import cran: Add recursive importer.
* guix/import/cran.scm (recursive-import): New variable.
(cran->guix-package): Memoize the procedure.
2016-12-17 19:12:55 +01:00
Ricardo Wurmus b26abe4f14
import cran: Ignore default R packages.
* guix/import/cran.scm (default-r-packages): New variable.
(description->package): Drop default R packages from list of inputs.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus ad68f7fa58
import cran: description->package: Also return package dependencies.
* guix/import/cran.scm (description->package): Return package
  dependencies in addition to generated package expression.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus bfa0c752bc
import cran: Move guix-name to top-level.
* guix/import/cran.scm (guix-name): Move to top-level.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus 2e5f32ce1b
import cran: Remove more invalid characters from package names.
* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 576eda6d02
import cran: Handle BSD licenses with LICENSE file.
* guix/import/cran.scm (string->license): Add cases for BSD licenses
with LICENSE file.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 741d68c20d
import cran: Translate MIT to the Expat license.
* guix/import/cran.scm (string->license): Translate "MIT" license to
Expat license.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 13f54d081b
import cran: Do not use "or later" licenses by default.
* guix/import/cran.scm (string->license): Use exact license versions.
2016-12-17 15:56:39 +01:00
Ludovic Courtès a6562c7e20
profiles: Remove dependency on 'glibc-utf8-locales' for tests.
Commit 1af0860e8b added a mandatory
dependency on 'glibc-utf8-locales', which entails long rebuilds for
tests.

* guix/profiles.scm (profile-derivation): Add #:locales? parameter.
Add 'set-utf8-locale' variable.  Use it when LOCALES? is true.
(link-to-empty-profile): Pass #:locales? #f.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
  #:locales?.
* guix/scripts/package.scm (build-and-use-profile): Likewise.
* tests/packages.scm ("--search-paths with pattern"): Pass #:locales? #f.
* tests/profiles.scm ("profile-derivation")
("profile-derivation, inputs", "profile-manifest, search-paths")
("etc/profile", "etc/profile when etc/ already exists"):
("etc/profile when etc/ is a symlink"): Likewise.
2016-12-17 14:46:42 +01:00
Ludovic Courtès 1af0860e8b
profiles: Build profiles in a UTF-8 locale.
Fixes <http://bugs.gnu.org/25213>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/profiles.scm (profile-derivation)[glibc-utf8-locales]: New
variable.
[builder]: Use it to set 'LOCPATH'.
2016-12-16 18:01:08 +01:00
Ludovic Courtès 580deec5b4
download: Protect against dangling symlinks in $SSL_CERT_DIR.
Reported by Christopher Baines <mail@cbaines.net>
in <https://bugs.gnu.org/25213>.

* guix/build/download.scm (make-credendials-with-ca-trust-files): Check
whether FILE exists before calling
'set-certificate-credentials-x509-trust-file!'.
2016-12-16 18:00:01 +01:00