diff --git a/Makefile.am b/Makefile.am
index 165dfe9727..43a33c80ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,6 +41,7 @@ MODULES = \
guix/combinators.scm \
guix/utils.scm \
guix/sets.scm \
+ guix/modules.scm \
guix/download.scm \
guix/git-download.scm \
guix/hg-download.scm \
@@ -207,6 +208,12 @@ endif INSTALL_SRFI_37
# Handy way to remove the .go files without removing all the rest.
clean-go:
-$(RM) -f $(GOBJECTS)
+ @find . -name '*.go' -print | \
+ if test -t 1; then \
+ xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
+ else \
+ xargs -r echo "warning: stray .go files:"; \
+ fi
# Test extensions; has to be unconditional.
@@ -222,6 +229,7 @@ SCM_TESTS = \
tests/pk-crypto.scm \
tests/pki.scm \
tests/sets.scm \
+ tests/modules.scm \
tests/gnu-maintenance.scm \
tests/substitute.scm \
tests/builders.scm \
@@ -342,6 +350,9 @@ dist_pkgdata_DATA = hydra.gnu.org.pub
# Bash completion file.
dist_bashcompletion_DATA = etc/completion/bash/guix
+# Zsh completion file.
+dist_zshcompletion_DATA = etc/completion/zsh/_guix
+
EXTRA_DIST = \
HACKING \
ROADMAP \
diff --git a/configure.ac b/configure.ac
index 13a9b6e19f..3b33f851e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,13 @@ AC_ARG_WITH([bash-completion-dir],
[bashcompletiondir='${sysconfdir}/bash_completion.d'])
AC_SUBST([bashcompletiondir])
+AC_ARG_WITH([zsh-completion-dir],
+ AC_HELP_STRING([--with-zsh-completion-dir=DIR],
+ [name of the Zsh completion directory]),
+ [zshcompletiondir="$withval"],
+ [zshcompletiondir='${datadir}/zsh/site-functions'])
+AC_SUBST([zshcompletiondir])
+
dnl Better be verbose.
AC_MSG_CHECKING([for the store directory])
AC_MSG_RESULT([$storedir])
@@ -67,14 +74,22 @@ dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
dnl Make sure they are available.
m4_pattern_forbid([PKG_CHECK_MODULES])
m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
+m4_pattern_forbid([^GUILE_P$])
-PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7])
-AC_PATH_PROG([GUILE], [guile])
-AC_PATH_PROG([GUILD], [guild])
+dnl Search for 'guile' and 'guild'. Prefer 2.0 until the 2.2 upgrade is
+dnl complete.
+GUILE_PKG([2.0 2.2])
+GUILE_PROGS
if test "x$GUILD" = "x"; then
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
fi
+if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
+ PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7])
+else
+ AC_MSG_WARN([Guile $GUILE_EFFECTIVE_VERSION is not fully supported!])
+fi
+
dnl guile-json is used for the PyPI package importer
GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"])
diff --git a/doc/emacs.texi b/doc/emacs.texi
index d124eca3cb..c7a8881ef5 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -225,7 +225,7 @@ guix pull}) from Emacs using:
With @kbd{C-u}, make it verbose.
@end table
-Once @command{guix pull} has succeeded, the Guix REPL is restared. This
+Once @command{guix pull} has succeeded, the Guix REPL is restarted. This
allows you to keep using the Emacs interface with the updated Guix.
@@ -266,7 +266,7 @@ Describe current mode to see all available bindings.
@end table
@emph{Hint:} If you need several ``list'' or ``info'' buffers, you can
-simlpy @kbd{M-x clone-buffer} them, and each buffer will have its own
+simply @kbd{M-x clone-buffer} them, and each buffer will have its own
history.
@emph{Warning:} Name/version pairs cannot be used to identify packages
@@ -310,7 +310,7 @@ Mark the current package for upgrading.
@item ^
Mark all obsolete packages for upgrading.
@item e
-Edit the definition of the curent package (go to its location). This is
+Edit the definition of the current package (go to its location). This is
similar to @command{guix edit} command (@pxref{Invoking guix edit}), but
for opening a package recipe in the current Emacs instance.
@item x
diff --git a/doc/guix.texi b/doc/guix.texi
index 2a7fd4d041..f5bbb92c7c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10,7 +10,7 @@
@include version.texi
@c Identifier of the OpenPGP key used to sign tarballs and such.
-@set OPENPGP-SIGNING-KEY-ID 090B11993D9AEBB5
+@set OPENPGP-SIGNING-KEY-ID 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
@copying
Copyright @copyright{} 2012, 2013, 2014, 2015, 2016 Ludovic Courtès@*
@@ -25,6 +25,7 @@ Copyright @copyright{} 2015, 2016 Ricardo Wurmus@*
Copyright @copyright{} 2016 Ben Woodcroft@*
Copyright @copyright{} 2016 Chris Marusich@*
Copyright @copyright{} 2016 Efraim Flashner@*
+Copyright @copyright{} 2016 John Darrington@*
Copyright @copyright{} 2016 ng0
Permission is granted to copy, distribute and/or modify this document
@@ -218,7 +219,7 @@ Services
* Database Services:: SQL databases.
* Mail Services:: IMAP, POP3, SMTP, and all that.
* Web Services:: Web servers.
-* Various Services:: Other services.
+* Miscellaneous Services:: Other services.
Defining Services
@@ -3793,7 +3794,7 @@ native package build:
"-s"
(string-append #$emacs "/bin/emacs")
(string-append #$output "/bin/vi")))
- #:target "mips64el-linux")
+ #:target "mips64el-linux-gnu")
@end example
@noindent
@@ -3825,6 +3826,28 @@ In this example, the @code{(guix build utils)} module is automatically
pulled into the isolated build environment of our gexp, such that
@code{(use-modules (guix build utils))} works as expected.
+@cindex module closure
+@findex source-module-closure
+Usually you want the @emph{closure} of the module to be imported---i.e.,
+the module itself and all the modules it depends on---rather than just
+the module; failing to do that, attempts to use the module will fail
+because of missing dependent modules. The @code{source-module-closure}
+procedure computes the closure of a module by looking at its source file
+headers, which comes in handy in this case:
+
+@example
+(use-modules (guix modules)) ;for 'source-module-closure'
+
+(with-imported-modules (source-module-closure
+ '((guix build utils)
+ (gnu build vm)))
+ (gexp->derivation "something-with-vms"
+ #~(begin
+ (use-modules (guix build utils)
+ (gnu build vm))
+ @dots{})))
+@end example
+
The syntactic form to construct gexps is summarized below.
@deffn {Scheme Syntax} #~@var{exp}
@@ -3962,7 +3985,7 @@ The @code{local-file}, @code{plain-file}, @code{computed-file},
these objects lead to a file in the store. Consider this G-expression:
@example
-#~(system* (string-append #$glibc "/sbin/nscd") "-f"
+#~(system* #$(file-append glibc "/sbin/nscd") "-f"
#$(local-file "/tmp/my-nscd.conf"))
@end example
@@ -4021,7 +4044,7 @@ command:
(use-modules (guix gexp) (gnu packages base))
(gexp->script "list-files"
- #~(execl (string-append #$coreutils "/bin/ls")
+ #~(execl #$(file-append coreutils "/bin/ls")
"ls"))
@end example
@@ -4032,8 +4055,7 @@ executable file @file{/gnu/store/@dots{}-list-files} along these lines:
@example
#!/gnu/store/@dots{}-guile-2.0.11/bin/guile -ds
!#
-(execl (string-append "/gnu/store/@dots{}-coreutils-8.22"/bin/ls")
- "ls")
+(execl "/gnu/store/@dots{}-coreutils-8.22"/bin/ls" "ls")
@end example
@end deffn
@@ -4103,6 +4125,34 @@ as in:
This is the declarative counterpart of @code{text-file*}.
@end deffn
+@deffn {Scheme Procedure} file-append @var{obj} @var{suffix} @dots{}
+Return a file-like object that expands to the concatenation of @var{obj}
+and @var{suffix}, where @var{obj} is a lowerable object and each
+@var{suffix} is a string.
+
+As an example, consider this gexp:
+
+@example
+(gexp->script "run-uname"
+ #~(system* #$(file-append coreutils
+ "/bin/uname")))
+@end example
+
+The same effect could be achieved with:
+
+@example
+(gexp->script "run-uname"
+ #~(system* (string-append #$coreutils
+ "/bin/uname")))
+@end example
+
+There is one difference though: in the @code{file-append} case, the
+resulting script contains the absolute file name as a string, whereas in
+the second case, the resulting script contains a @code{(string-append
+@dots{})} expression to construct the file name @emph{at run time}.
+@end deffn
+
+
Of course, in addition to gexps embedded in ``host'' code, there are
also modules containing build tools. To make it clear that they are
meant to be used in the build stratum, these modules are kept in the
@@ -4656,7 +4706,7 @@ The general syntax is:
guix hash @var{option} @var{file}
@end example
-@command{guix hash} has the following option:
+@command{guix hash} has the following options:
@table @code
@@ -4684,6 +4734,11 @@ hash (@pxref{Invoking guix archive}).
@c FIXME: Replace xref above with xref to an ``Archive'' section when
@c it exists.
+@item --exclude-vcs
+@itemx -x
+When combined with @option{--recursive}, exclude version control system
+directories (@file{.bzr}, @file{.git}, @file{.hg}, etc.)
+
@vindex git-fetch
As an example, here is how you would compute the hash of a Git checkout,
which is useful when using the @code{git-fetch} method (@pxref{origin
@@ -4692,8 +4747,7 @@ Reference}):
@example
$ git clone http://example.org/foo.git
$ cd foo
-$ rm -rf .git
-$ guix hash -r .
+$ guix hash -rx .
@end example
@end table
@@ -6129,7 +6183,7 @@ Few system services are currently supported out-of-the-box
(@pxref{Services}).
@item
-More than 3,200 packages are available, but you may
+More than 4,000 packages are available, but you may
occasionally find that a useful package is missing.
@item
@@ -6699,8 +6753,7 @@ following in your operating system declaration:
(extra-options '("--gc-keep-derivations"))))
(mingetty-service-type config =>
(mingetty-configuration
- (inherit config)
- (motd (plain-file "motd" "Howdy!"))))))
+ (inherit config)))))
(operating-system
;; @dots{}
@@ -7534,7 +7587,7 @@ declaration.
* Database Services:: SQL databases.
* Mail Services:: IMAP, POP3, SMTP, and all that.
* Web Services:: Web servers.
-* Various Services:: Other services.
+* Miscellaneous Services:: Other services.
@end menu
@node Base Services
@@ -7565,6 +7618,27 @@ this:
Return a service that sets the host name to @var{name}.
@end deffn
+@deffn {Scheme Procedure} login-service @var{config}
+Return a service to run login according to @var{config}, a
+@code{