From 7fec52b78b1b5f762a82ef900e0b871da40e7f92 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Sun, 23 Nov 2014 18:23:35 +0100 Subject: doc: Add a section on naming conventions for font packages. * doc/guix.texi (Fonts): New section. (Package naming): Reference the new section. --- doc/guix.texi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index c0b9668760..b5aefc0aa3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4745,6 +4745,7 @@ needed is to review and apply the patch. * Version Numbers:: When the name is not enough. * Python Modules:: Taming the snake. * Perl Modules:: Little pearls. +* Fonts:: Fond of fonts. @end menu @node Software Freedom @@ -4796,6 +4797,8 @@ already part of the official project name. But @pxref{Python Modules} and @ref{Perl Modules} for special rules concerning modules for the Python and Perl languages. +Font package names are handled differently, @pxref {Fonts}. + @node Version Numbers @subsection Version Numbers @@ -4871,6 +4874,43 @@ are also prepended by @code{perl-}. Such modules tend to have the word prefix. For instance, @code{libwww-perl} becomes @code{perl-libwww}. +@node Fonts +@subsection Fonts + +For fonts that are in general not installed by a user for typesetting +purposes, or that are distributed as part of a larger software package, +we rely on the general packaging rules for software; for instance, this +applies to the fonts delivered as part of the X.Org system or fonts that +are part of TeX Live. + +To make it easier for a user to search for fonts, names for other packages +containing only fonts are constructed as follows, independently of the +upstream package name. + +The name of a package containing only one font family starts with +@code{font-}; it is followed by the foundry name and a dash @code{-} +if the foundry is known, and the font family name, in which spaces are +replaced by dashes (and as usual, all upper case letters are transformed +to lower case). +For example, the Gentium font family by SIL is packaged under the name +@code{font-sil-gentium}. + +For a package containing several font families, the name of the collection +is used in the place of the font family name. +For instance, the Liberation fonts consist of three families, +Liberation Sans, Liberation Serif and Liberation Mono. +These could be packaged separately under the names +@code{font-liberation-sans} and so on; but as they are distributed together +under a common name, we prefer to package them together as +@code{font-liberation}. + +In the case where several formats of the same font family or font collection +are packaged separately, a short form of the format, prepended by a dash, +is added to the package name. We use @code{-ttf} for TrueType fonts, +@code {-otf} for OpenType fonts and @code{-type1} for PostScript Type 1 +fonts. + + @node Bootstrapping @section Bootstrapping -- cgit v1.2.3 From 5d1f1177844e7580cc6a2f7b8375bd3388ded003 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 23 Nov 2014 21:18:40 +0100 Subject: doc: Fix erroneous cross-manual references. * doc/guix.texi (User Accounts): Fix cross-references to libc and guile. --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index b5aefc0aa3..4868813876 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3818,8 +3818,8 @@ users change it with @command{passwd}. If you @emph{do} want to have a preset password for an account, then this field must contain the encrypted password, as a string. -@xref{crypt,,, The GNU C Library Reference Manual}, for more information -on password encryption, and @ref{Encryption,,, GNU Guile Reference +@xref{crypt,,, libc, The GNU C Library Reference Manual}, for more information +on password encryption, and @ref{Encryption,,, guile, GNU Guile Reference Manual}, for information on Guile's @code{crypt} procedure. @end table -- cgit v1.2.3 From b419c7f5fb5774b3af201550c11d9c5f867570ae Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 23 Nov 2014 21:53:24 +0100 Subject: install: Add Cryptsetup to the image. Reported by Nikita Karetnikov. * gnu/system/install.scm (installation-os)[packages]: Add CRYPTSETUP. * doc/guix.texi (System Installation): Mention it. --- doc/guix.texi | 5 +++-- gnu/system/install.scm | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 4868813876..a2f881fbe5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3275,8 +3275,9 @@ Systems}). This is typically done using the @code{-L} option of @command{mkfs.ext4} and related commands. The installation image includes Parted (@pxref{Overview,,, parted, GNU -Parted User Manual}), @command{fdisk}, and e2fsprogs, the suite of tools -to manipulate ext2/ext3/ext4 file systems. +Parted User Manual}), @command{fdisk}, Cryptsetup/LUKS for disk +encryption, and e2fsprogs, the suite of tools to manipulate +ext2/ext3/ext4 file systems. @item Once that is done, mount the target root partition under @file{/mnt}. diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 961361b937..dd3a3eb292 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -22,6 +22,7 @@ #:use-module (guix monads) #:use-module ((guix store) #:select (%store-prefix)) #:use-module (gnu packages linux) + #:use-module (gnu packages cryptsetup) #:use-module (gnu packages package-management) #:use-module (gnu packages disk) #:use-module (gnu packages grub) @@ -254,6 +255,7 @@ Use Alt-F2 for documentation. (packages (cons* texinfo-4 ;for the standalone Info reader parted ddrescue grub ;mostly so xrefs to its manual work + cryptsetup wireless-tools ;; XXX: We used to have GNU fdisk here, but as of version ;; 2.0.0a, that pulls Guile 1.8, which takes unreasonable -- cgit v1.2.3 From fa1e31b8a5c0d134020b8d4aa0c2d4ad0dca40da Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 23 Nov 2014 11:46:38 +0300 Subject: doc: Fix typos. * doc/guix.texi (Base Services): Fix 'lsh-service' name. (Networking Services): Fix (gnu services networking) module name. --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index a2f881fbe5..8aa3c6df74 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3905,7 +3905,7 @@ system, you will want to append services to @var{%base-services}, like this: @example -(cons* (avahi-service) (lshd-service) %base-services) +(cons* (avahi-service) (lsh-service) %base-services) @end example @end defvr @@ -3968,7 +3968,7 @@ Run @var{udev}, which populates the @file{/dev} directory dynamically. @node Networking Services @subsubsection Networking Services -The @code{(gnu system networking)} module provides services to configure +The @code{(gnu services networking)} module provides services to configure the network interface. @cindex DHCP, networking service -- cgit v1.2.3 From 20dd519cdbb93799f6e4edc2fb39d6f6aa5b81c0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 24 Nov 2014 21:15:40 +0100 Subject: doc: Add xrefs to the lsh manual. Suggested by Adam Pribyl . * gnu/services/ssh.scm (lsh-service): Update docstring with xrefs to the lsh manual. Fix typos. * doc/guix.texi (Networking Services): Synchronize. --- doc/guix.texi | 9 +++++++-- gnu/services/ssh.scm | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 8aa3c6df74..427e445465 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4033,12 +4033,17 @@ When @var{initialize?} is true, automatically create the seed and host key upon service activation if they do not exist yet. This may take long and require interaction. +When @var{initialize?} is false, it is up to the user to initialize the +randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create +a key pair with the private key stored in file @var{host-key} (@pxref{lshd +basics,,, lsh, LSH Manual}). + When @var{interfaces} is empty, lshd listens for connections on all the network interfaces; otherwise, @var{interfaces} must be a list of host names or addresses. -@var{allow-empty-passwords?} specifies whether to accepts log-ins with empty -passwords, and @var{root-login?} specifies whether to accepts log-ins as +@var{allow-empty-passwords?} specifies whether to accept log-ins with empty +passwords, and @var{root-login?} specifies whether to accept log-ins as root. The other options should be self-descriptive. diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 5fc98e988c..2b52c777b7 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -91,12 +91,17 @@ When @var{initialize?} is true, automatically create the seed and host key upon service activation if they do not exist yet. This may take long and require interaction. +When @var{initialize?} is false, it is up to the user to initialize the +randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create +a key pair with the private key stored in file @var{host-key} (@pxref{lshd +basics,,, lsh, LSH Manual}). + When @var{interfaces} is empty, lshd listens for connections on all the network interfaces; otherwise, @var{interfaces} must be a list of host names or addresses. -@var{allow-empty-passwords?} specifies whether to accepts log-ins with empty -passwords, and @var{root-login?} specifies whether to accepts log-ins as +@var{allow-empty-passwords?} specifies whether to accept log-ins with empty +passwords, and @var{root-login?} specifies whether to accept log-ins as root. The other options should be self-descriptive." -- cgit v1.2.3 From aaa3eaa97e148c2d8df2940e3d5a809f37ac025e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 24 Nov 2014 21:39:04 +0100 Subject: doc: Add detailed node listing. * doc/guix.texi (Top): Add @detailmenu. --- doc/guix.texi | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 427e445465..ec48f4a38d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -76,6 +76,92 @@ package management tool written for the GNU system. * GNU Free Documentation License:: The license of this manual. * Concept Index:: Concepts. * Programming Index:: Data types, functions, and variables. + +@detailmenu + --- The Detailed Node Listing --- + +Installation + +* Requirements:: Software needed to build and run Guix. +* Setting Up the Daemon:: Preparing the build daemon's environment. +* Invoking guix-daemon:: Running the build daemon. + +Setting Up the Daemon + +* Build Environment Setup:: Preparing the isolated build environment. +* Daemon Offload Setup:: Offloading builds to remote machines. + +Package Management + +* Features:: How Guix will make your life brighter. +* Invoking guix package:: Package installation, removal, etc. +* Emacs Interface:: Package management from Emacs. +* Substitutes:: Downloading pre-built binaries. +* Packages with Multiple Outputs:: Single source package, multiple outputs. +* Invoking guix gc:: Running the garbage collector. +* Invoking guix pull:: Fetching the latest Guix and distribution. +* Invoking guix archive:: Exporting and importing store files. + +Programming Interface + +* Defining Packages:: Defining new packages. +* Build Systems:: Specifying how packages are built. +* The Store:: Manipulating the package store. +* Derivations:: Low-level interface to package derivations. +* The Store Monad:: Purely functional interface to the store. +* G-Expressions:: Manipulating build expressions. + +Utilities + +* Invoking guix build:: Building packages from the command line. +* Invoking guix download:: Downloading a file and printing its hash. +* Invoking guix hash:: Computing the cryptographic hash of a file. +* Invoking guix import:: Importing package definitions. +* Invoking guix refresh:: Updating package definitions. +* Invoking guix lint:: Finding errors in package definitions. +* Invoking guix environment:: Setting up development environments. + +GNU Distribution + +* System Installation:: Installing the whole operating system. +* System Configuration:: Configuring a GNU system. +* Installing Debugging Files:: Feeding the debugger. +* Security Updates:: Deploying security fixes quickly. +* Package Modules:: Packages from the programmer's viewpoint. +* Packaging Guidelines:: Growing the distribution. +* Bootstrapping:: GNU/Linux built from scratch. +* Porting:: Targeting another platform or kernel. + +System Configuration + +* Using the Configuration System:: Customizing your GNU system. +* operating-system Reference:: Detail of operating-system declarations. +* File Systems:: Configuring file system mounts. +* Mapped Devices:: Block device extra processing. +* User Accounts:: Specifying user accounts. +* Services:: Specifying system services. +* Setuid Programs:: Programs running with root privileges. +* Initial RAM Disk:: Linux-Libre bootstrapping. +* GRUB Configuration:: Configuring the boot loader. +* Invoking guix system:: Instantiating a system configuration. +* Defining Services:: Adding new service definitions. + +Services + +* Base Services:: Essential system services. +* Networking Services:: Network setup, SSH daemon, etc. +* X Window:: Graphical display. + +Packaging Guidelines + +* Software Freedom:: What may go into the distribution. +* Package Naming:: What's in a name? +* Version Numbers:: When the name is not enough. +* Python Modules:: Taming the snake. +* Perl Modules:: Little pearls. +* Fonts:: Fond of fonts. + +@end detailmenu @end menu @c ********************************************************************* -- cgit v1.2.3 From 1b366ee4f6dff35b3bef259f4a64832b580178c9 Mon Sep 17 00:00:00 2001 From: Taylan Ulrich Bayırlı/Kammer Date: Tue, 25 Nov 2014 14:46:47 +0100 Subject: doc: Fix syntax errors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Package Naming): (Fonts): Remove space between '@foo' and '{'. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index ec48f4a38d..a88b7747fc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4889,7 +4889,7 @@ already part of the official project name. But @pxref{Python Modules} and @ref{Perl Modules} for special rules concerning modules for the Python and Perl languages. -Font package names are handled differently, @pxref {Fonts}. +Font package names are handled differently, @pxref{Fonts}. @node Version Numbers @@ -4999,7 +4999,7 @@ under a common name, we prefer to package them together as In the case where several formats of the same font family or font collection are packaged separately, a short form of the format, prepended by a dash, is added to the package name. We use @code{-ttf} for TrueType fonts, -@code {-otf} for OpenType fonts and @code{-type1} for PostScript Type 1 +@code{-otf} for OpenType fonts and @code{-type1} for PostScript Type 1 fonts. -- cgit v1.2.3 From f6526eb330c6be9c20cf9486b59d7f9ea84ffda3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Nov 2014 22:32:26 +0100 Subject: guix build: Add '--max-jobs' option. Suggested by Deck Pickard . * guix/scripts/build.scm (show-build-options-help): Document --max-jobs. (set-build-options-from-command-line): Pass #:max-build-jobs. (%standard-build-options): Add --max-jobs. * doc/guix.texi (Invoking guix-daemon): Document the meaning of '--max-jobs 0'. (Invoking guix build): Document --max-jobs, with a reference to "Invoking guix-daemon'. --- doc/guix.texi | 10 +++++++++- guix/scripts/build.scm | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index a88b7747fc..fe1f8a8b76 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -596,7 +596,9 @@ parallelism---for instance, by running @code{make -j$NIX_BUILD_CORES}. @item --max-jobs=@var{n} @itemx -M @var{n} Allow at most @var{n} build jobs in parallel. The default value is -@code{1}. +@code{1}. Setting it to @code{0} means that no builds will be performed +locally; instead, the daemon will offload builds (@pxref{Daemon Offload +Setup}), or simply fail. @item --debug Produce debugging output. @@ -2765,6 +2767,12 @@ may be helpful when debugging setup issues with the build daemon. Allow the use of up to @var{n} CPU cores for the build. The special value @code{0} means to use as many CPU cores as available. +@item --max-jobs=@var{n} +@itemx -M @var{n} +Allow at most @var{n} build jobs in parallel. @xref{Invoking +guix-daemon, @code{--max-jobs}}, for details about this option and the +equivalent @command{guix-daemon} option. + @end table Behind the scenes, @command{guix build} is essentially an interface to diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 7b7f419f3a..b4aa33b3a0 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -119,7 +119,9 @@ options handled by 'set-build-options-from-command-line', and listed in (display (_ " --verbosity=LEVEL use the given verbosity LEVEL")) (display (_ " - -c, --cores=N allow the use of up to N CPU cores for the build"))) + -c, --cores=N allow the use of up to N CPU cores for the build")) + (display (_ " + -M, --max-jobs=N allow at most N build jobs"))) (define (set-build-options-from-command-line store opts) "Given OPTS, an alist as returned by 'args-fold' given @@ -128,6 +130,7 @@ options handled by 'set-build-options-from-command-line', and listed in (set-build-options store #:keep-failed? (assoc-ref opts 'keep-failed?) #:build-cores (or (assoc-ref opts 'cores) 0) + #:max-build-jobs (or (assoc-ref opts 'max-jobs) 1) #:fallback? (assoc-ref opts 'fallback?) #:use-substitutes? (assoc-ref opts 'substitutes?) #:use-build-hook? (assoc-ref opts 'build-hook?) @@ -192,7 +195,15 @@ options handled by 'set-build-options-from-command-line', and listed in (let ((c (false-if-exception (string->number arg)))) (if c (apply values (alist-cons 'cores c result) rest) - (leave (_ "~a: not a number~%") arg))))))) + (leave (_ "not a number: '~a' option argument: ~a~%") + name arg))))) + (option '(#\M "max-jobs") #t #f + (lambda (opt name arg result . rest) + (let ((c (false-if-exception (string->number arg)))) + (if c + (apply values (alist-cons 'max-jobs c result) rest) + (leave (_ "not a number: '~a' option argument: ~a~%") + name arg))))))) ;;; -- cgit v1.2.3 From 598e19dca1677aebfe235e974f480b5bdd322694 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Nov 2014 22:49:11 +0100 Subject: system: Build system-wide locale definitions. * gnu/system/locale.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * gnu/system.scm ()[locale]: Change the default to "en_US.utf8". (operating-system-locale-directory): New procecure. (operating-system-derivation): Use it. * doc/guix.texi (Using the Configuration System): Change example locale to "fr_FR.utf8". (operating-system Reference): Add xref to "Locales". Document 'locale-definitions'. (Locales): New section. * po/guix/POTFILES.in: Add gnu/system.scm. --- doc/guix.texi | 86 ++++++++++++++++++++++++++++++++-- gnu-system.am | 1 + gnu/system.scm | 23 ++++++++- gnu/system/locale.scm | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++ po/guix/POTFILES.in | 1 + 5 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 gnu/system/locale.scm (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index fe1f8a8b76..d4bc74f8a4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -139,6 +139,7 @@ System Configuration * File Systems:: Configuring file system mounts. * Mapped Devices:: Block device extra processing. * User Accounts:: Specifying user accounts. +* Locales:: Language and cultural convention settings. * Services:: Specifying system services. * Setuid Programs:: Programs running with root privileges. * Initial RAM Disk:: Linux-Libre bootstrapping. @@ -3470,6 +3471,7 @@ instance to support new system services. * File Systems:: Configuring file system mounts. * Mapped Devices:: Block device extra processing. * User Accounts:: Specifying user accounts. +* Locales:: Language and cultural convention settings. * Services:: Specifying system services. * Setuid Programs:: Programs running with root privileges. * Initial RAM Disk:: Linux-Libre bootstrapping. @@ -3496,7 +3498,7 @@ kernel, initial RAM disk, and boot loader looks like this: (operating-system (host-name "komputilo") (timezone "Europe/Paris") - (locale "fr_FR.UTF-8") + (locale "fr_FR.utf8") (bootloader (grub-configuration (device "/dev/sda"))) (file-systems (cons (file-system @@ -3649,9 +3651,13 @@ package}). @item @code{timezone} A timezone identifying string---e.g., @code{"Europe/Paris"}. -@item @code{locale} (default: @code{"en_US.UTF-8"}) -The name of the default locale (@pxref{Locales,,, libc, The GNU C -Library Reference Manual}). +@item @code{locale} (default: @code{"en_US.utf8"}) +The name of the default locale (@pxref{Locale Names,,, libc, The GNU C +Library Reference Manual}). @xref{Locales}, for more information. + +@item @code{locale-definitions} (default: @var{%default-locale-definitions}) +The list of locale definitions to be compiled and that may be used at +run time. @xref{Locales}. @item @code{services} (default: @var{%base-services}) A list of monadic values denoting system services. @xref{Services}. @@ -3958,6 +3964,78 @@ to be present on the system. This includes groups such as ``root'', specific devices such as ``audio'', ``disk'', and ``cdrom''. @end defvr +@node Locales +@subsection Locales + +@cindex locale +A @dfn{locale} defines cultural conventions for a particular language +and region of the world (@pxref{Locales,,, libc, The GNU C Library +Reference Manual}). Each locale has a name that typically has the form +@code{@var{language}_@var{territory}.@var{charset}}---e.g., +@code{fr_LU.utf8} designates the locale for the French language, with +cultural conventions from Luxembourg, and using the UTF-8 encoding. + +@cindex locale definition +Usually, you will want to specify the default locale for the machine +using the @code{locale} field of the @code{operating-system} declaration +(@pxref{operating-system Reference, @code{locale}}). + +That locale must be among the @dfn{locale definitions} that are known to +the system---and these are specified in the @code{locale-definitions} +slot of @code{operating-system}. The default value includes locale +definition for some widely used locales, but not for all the available +locales, in order to save space. + +If the locale specified in the @code{locale} field is not among the +definitions listed in @code{locale-definitions}, @command{guix system} +raises an error. In that case, you should add the locale definition to +the @code{locale-definitions} field. For instance, to add the North +Frisian locale for Germany, the value of that field may be: + +@example +(cons (locale-definition + (name "fy_DE.utf8") (source "fy_DE")) + %default-locale-definitions) +@end example + +Likewise, to save space, one might want @code{locale-definitions} to +list only the locales that are actually used, as in: + +@example +(list (locale-definition + (name "ja_JP.eucjp") (source "ja_JP") + (charset "EUC-JP"))) +@end example + +The @code{locale-definition} form is provided by the @code{(gnu system +locale)} module. Details are given below. + +@deftp {Data Type} locale-definition +This is the data type of a locale definition. + +@table @asis + +@item @code{name} +The name of the locale. @xref{Locale Names,,, libc, The GNU C Library +Reference Manual}, for more information on locale names. + +@item @code{source} +The name of the source for that locale. This is typically the +@code{@var{language}_@var{territory}} part of the locale name. + +@item @code{charset} (default: @code{"UTF-8"}) +The ``character set'' or ``code set'' for that locale, +@uref{http://www.iana.org/assignments/character-sets, as defined by +IANA}. + +@end table +@end deftp + +@defvr {Scheme Variable} %default-locale-definitions +An arbitrary list of commonly used locales, used as the default value of +the @code{locale-definitions} field of @code{operating-system} +declarations. +@end defvr @node Services @subsection Services diff --git a/gnu-system.am b/gnu-system.am index 4c9fcda8b9..bd1ac5d273 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -294,6 +294,7 @@ GNU_SYSTEM_MODULES = \ gnu/system/install.scm \ gnu/system/linux.scm \ gnu/system/linux-initrd.scm \ + gnu/system/locale.scm \ gnu/system/shadow.scm \ gnu/system/vm.scm \ \ diff --git a/gnu/system.scm b/gnu/system.scm index 5c915d3969..8883d3e752 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -46,12 +46,15 @@ #:use-module (gnu services base) #:use-module (gnu system grub) #:use-module (gnu system shadow) + #:use-module (gnu system locale) #:use-module (gnu system linux) #:use-module (gnu system linux-initrd) #:use-module (gnu system file-systems) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:export (operating-system operating-system? @@ -69,6 +72,7 @@ operating-system-packages operating-system-timezone operating-system-locale + operating-system-locale-definitions operating-system-mapped-devices operating-system-file-systems operating-system-activation-script @@ -129,7 +133,9 @@ (timezone operating-system-timezone) ; string (locale operating-system-locale ; string - (default "en_US.UTF-8")) + (default "en_US.utf8")) + (locale-definitions operating-system-locale-definitions ; list of + (default %default-locale-definitions)) (services operating-system-user-services ; list of monadic services (default %base-services)) @@ -649,6 +655,19 @@ we're running in the final root." #:mapped-devices mapped-devices))) (return #~(string-append #$initrd "/initrd")))) +(define (operating-system-locale-directory os) + "Return the directory containing the locales compiled for the definitions +listed in OS. The C library expects to find it under +/run/current-system/locale." + ;; While we're at it, check whether the locale of OS is defined. + (unless (member (operating-system-locale os) + (map locale-definition-name + (operating-system-locale-definitions os))) + (raise (condition + (&message (message "system locale lacks a definition"))))) + + (locale-directory (operating-system-locale-definitions os))) + (define (kernel->grub-label kernel) "Return a label for the GRUB menu entry that boots KERNEL." (string-append "GNU with " @@ -698,6 +717,7 @@ this file is the reconstruction of GRUB menu entries for old configurations." (boot (operating-system-boot-script os)) (kernel -> (operating-system-kernel os)) (initrd (operating-system-initrd-file os)) + (locale (operating-system-locale-directory os)) (params (operating-system-parameters-file os))) (file-union "system" `(("boot" ,#~#$boot) @@ -705,6 +725,7 @@ this file is the reconstruction of GRUB menu entries for old configurations." ("parameters" ,#~#$params) ("initrd" ,initrd) ("profile" ,#~#$profile) + ("locale" ,#~#$locale) ;used by libc ("etc" ,#~#$etc))))) ;;; system.scm ends here diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm new file mode 100644 index 0000000000..9c5c4d2fd9 --- /dev/null +++ b/gnu/system/locale.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system locale) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (srfi srfi-26) + #:export (locale-definition + locale-definition? + locale-definition-name + locale-definition-source + locale-definition-charset + + locale-directory + + %default-locale-definitions)) + +;;; Commentary: +;;; +;;; Locale definitions, and compilation thereof. +;;; +;;; Code: + +(define-record-type* locale-definition + make-locale-definition + locale-definition? + (name locale-definition-name) ;string--e.g., "fr_FR.utf8" + (source locale-definition-source) ;string--e.g., "fr_FR" + (charset locale-definition-charset ;string--e.g., "UTF-8" + (default "UTF-8"))) + +(define* (localedef-command locale + #:key (libc (canonical-package glibc))) + "Return a gexp that runs 'localdef' from LIBC to build LOCALE." + #~(begin + (format #t "building locale '~a'...~%" + #$(locale-definition-name locale)) + (zero? (system* (string-append #$libc "/bin/localedef") + "--no-archive" "--prefix" #$output + "-i" #$(locale-definition-source locale) + "-f" #$(locale-definition-charset locale) + (string-append #$output "/" + #$(locale-definition-name locale)))))) + +(define* (locale-directory locales + #:key (libc (canonical-package glibc))) + "Return a directory containing all of LOCALES compiled." + (define build + #~(begin + (mkdir #$output) + + ;; 'localedef' executes 'gzip' to access compressed locale sources. + (setenv "PATH" (string-append #$gzip "/bin")) + + (exit + (and #$@(map (cut localedef-command <> #:libc libc) + locales))))) + + (gexp->derivation "locale" build + #:local-build? #t)) + +(define %default-locale-definitions + ;; Arbitrary set of locales that are built by default. They are here mostly + ;; to facilitate first-time use to some people, while others may have to add + ;; a specific . + (letrec-syntax ((utf8-locale (syntax-rules () + ((_ name*) + (locale-definition + (name (string-append name* ".utf8")) + (source name*) + (charset "UTF-8"))))) + (utf8-locales (syntax-rules () + ((_ name ...) + (list (utf8-locale name) ...))))) + (utf8-locales "ca_ES" + "cs_CZ" + "da_DK" + "de_DE" + "el_GR" + "en_AU" + "en_CA" + "en_GB" + "en_US" + "es_AR" + "es_CL" + "es_ES" + "es_MX" + "fi_FI" + "fr_BE" + "fr_CA" + "fr_CH" + "fr_FR" + "ga_IE" + "it_IT" + "ja_JP" + "ko_KR" + "nb_NO" + "nl_NL" + "pl_PL" + "pt_PT" + "ro_RO" + "ru_RU" + "sv_SE" + "tr_TR" + "uk_UA" + "vi_VN" + "zh_CN"))) + +;;; locale.scm ends here diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index 5cc68ff404..591b6a1c9a 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -1,6 +1,7 @@ # List of source files which contain translatable strings. # This should be source files of the various tools, and not package modules. gnu/packages.scm +gnu/system.scm guix/scripts/build.scm guix/scripts/download.scm guix/scripts/package.scm -- cgit v1.2.3 From 1f6f57df7c081f56424bd38cf8a2c16f60f4cd71 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 27 Nov 2014 21:26:40 +0100 Subject: doc: Update stale references in "Bootstrapping". * doc/guix.texi (Bootstrapping): Final definitions are in (gnu packages commencement). Change gnu-build-system xref to "Build Systems". --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index d4bc74f8a4..aad201771a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5173,7 +5173,7 @@ no-dependency requirement is verified by checking whether the files of the final tool chain contain references to the @file{/gnu/store} directories of the bootstrap inputs. The process that leads to this ``final'' tool chain is described by the package definitions found in -the @code{(gnu packages base)} module. +the @code{(gnu packages commencement)} module. @c See . The first tool that gets built with the bootstrap binaries is @@ -5194,7 +5194,7 @@ And voilà! At this point we have the complete set of build tools that the GNU Build System expects. These are in the @code{%final-inputs} variable of the @code{(gnu packages commencement)} module, and are implicitly used by any package that uses @code{gnu-build-system} -(@pxref{Defining Packages}). +(@pxref{Build Systems, @code{gnu-build-system}}). @unnumberedsubsec Building the Bootstrap Binaries -- cgit v1.2.3 From 3b09332adf7ce8e976a4d117a62c586a53af04aa Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 29 Nov 2014 14:40:26 +0100 Subject: system: Add a 'needed-for-boot?' field to 'mapped-device'. * gnu/system/file-systems.scm ()[needed-for-boot?]: New field. * gnu/system.scm (operating-system-user-mapped-devices, operating-system-boot-mapped-devices): Use it instead of trying to guess. Guessing doesn't work when one refers to a partition using its label, for instance. * doc/guix.texi (Mapped Devices): Document 'needed-for-boot?'. --- doc/guix.texi | 16 ++++++++++++---- gnu/system.scm | 17 ++++------------- gnu/system/file-systems.scm | 5 ++++- 3 files changed, 20 insertions(+), 18 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index aad201771a..9aeec41f83 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3837,19 +3837,27 @@ detailed below. Objects of this type represent device mappings that will be made when the system boots up. -@table @code -@item source +@table @asis +@item @code{source} This string specifies the name of the block device to be mapped, such as @code{"/dev/sda3"}. -@item target +@item @code{target} This string specifies the name of the mapping to be established. For example, specifying @code{"my-partition"} will lead to the creation of the @code{"/dev/mapper/my-partition"} device. -@item type +@item @code{type} This must be a @code{mapped-device-kind} object, which specifies how @var{source} is mapped to @var{target}. + +@item @code{needed-for-boot?} (default: @code{#f}) +This Boolean value indicates whether the device mapping must be made at +boot time---i.e., from the initial RAM disk, before any user file +systems are mounted. + +You would set it to @code{#t} for instance when the mapped device is +used by the root file system. @end table @end deftp diff --git a/gnu/system.scm b/gnu/system.scm index e1ed1a2f19..731f9de55f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -250,23 +250,14 @@ as 'needed-for-boot'." (define (operating-system-user-mapped-devices os) "Return the subset of mapped devices that can be installed in user-land--i.e., those not needed during boot." - (let ((devices (operating-system-mapped-devices os)) - (file-systems (operating-system-file-systems os))) - (filter (lambda (md) - (let ((user (mapped-device-user md file-systems))) - (or (not user) - (not (file-system-needed-for-boot? user))))) - devices))) + (remove mapped-device-needed-for-boot? + (operating-system-mapped-devices os))) (define (operating-system-boot-mapped-devices os) "Return the subset of mapped devices that must be installed during boot, from the initrd." - (let ((devices (operating-system-mapped-devices os)) - (file-systems (operating-system-file-systems os))) - (filter (lambda (md) - (let ((user (mapped-device-user md file-systems))) - (and user (file-system-needed-for-boot? user)))) - devices))) + (filter mapped-device-needed-for-boot? + (operating-system-mapped-devices os))) (define (device-mapping-services os) "Return the list of device-mapping services for OS as a monadic list." diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 4760821840..356b4826b4 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -45,6 +45,7 @@ mapped-device-source mapped-device-target mapped-device-type + mapped-device-needed-for-boot? mapped-device-kind mapped-device-kind? @@ -157,7 +158,9 @@ file system." mapped-device? (source mapped-device-source) ;string (target mapped-device-target) ;string - (type mapped-device-type)) ; + (type mapped-device-type) ; + (needed-for-boot? mapped-device-needed-for-boot? ;Boolean + (default #f))) (define-record-type* mapped-device-kind make-mapped-device-kind -- cgit v1.2.3 From 1c0c417d2dd63110e4f6e6891f511cf0ae2c2cb5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 29 Nov 2014 14:59:46 +0100 Subject: doc: Improve porting instructions. * doc/guix.texi (Porting): Move 'glibc-dynamic-linker' paragraph above. Clarify what is meant by updating (gnu packages bootstrap). Mention 'gnu-system.am'. --- doc/guix.texi | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 9aeec41f83..53bfb293b6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5250,12 +5250,20 @@ one: guix build --target=armv5tel-linux-gnueabi bootstrap-tarballs @end example +For this to work, the @code{glibc-dynamic-linker} procedure in +@code{(gnu packages bootstrap)} must be augmented to return the right +file name for libc's dynamic linker on that platform; likewise, +@code{system->linux-architecture} in @code{(gnu packages linux)} must be +taught about the new platform. + Once these are built, the @code{(gnu packages bootstrap)} module needs -to be updated to refer to these binaries on the target platform. In -addition, the @code{glibc-dynamic-linker} procedure in that module must -be augmented to return the right file name for libc's dynamic linker on -that platform; likewise, @code{system->linux-architecture} in @code{(gnu -packages linux)} must be taught about the new platform. +to be updated to refer to these binaries on the target platform. That +is, the hashes and URLs of the bootstrap tarballs for the new platform +must be added alongside those of the currently supported platforms. The +bootstrap Guile tarball is treated specially: it is expected to be +available locally, and @file{gnu-system.am} has rules do download it for +the supported architectures; a rule for the new platform must be added +as well. In practice, there may be some complications. First, it may be that the extended GNU triplet that specifies an ABI (like the @code{eabi} suffix -- cgit v1.2.3 From 9cb426b8bf91830c2df76f9285ed98f45265ecc4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 30 Nov 2014 17:50:07 +0100 Subject: Revert "system: Add a 'needed-for-boot?' field to 'mapped-device'." This reverts commit 3b09332adf7ce8e976a4d117a62c586a53af04aa, which turned out to be a bad idea because we need to have dependency information between the device-mapping service and the file-system service that uses it. --- doc/guix.texi | 16 ++++------------ gnu/system.scm | 17 +++++++++++++---- gnu/system/file-systems.scm | 5 +---- 3 files changed, 18 insertions(+), 20 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 53bfb293b6..7c059b923a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3837,27 +3837,19 @@ detailed below. Objects of this type represent device mappings that will be made when the system boots up. -@table @asis -@item @code{source} +@table @code +@item source This string specifies the name of the block device to be mapped, such as @code{"/dev/sda3"}. -@item @code{target} +@item target This string specifies the name of the mapping to be established. For example, specifying @code{"my-partition"} will lead to the creation of the @code{"/dev/mapper/my-partition"} device. -@item @code{type} +@item type This must be a @code{mapped-device-kind} object, which specifies how @var{source} is mapped to @var{target}. - -@item @code{needed-for-boot?} (default: @code{#f}) -This Boolean value indicates whether the device mapping must be made at -boot time---i.e., from the initial RAM disk, before any user file -systems are mounted. - -You would set it to @code{#t} for instance when the mapped device is -used by the root file system. @end table @end deftp diff --git a/gnu/system.scm b/gnu/system.scm index 731f9de55f..e1ed1a2f19 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -250,14 +250,23 @@ as 'needed-for-boot'." (define (operating-system-user-mapped-devices os) "Return the subset of mapped devices that can be installed in user-land--i.e., those not needed during boot." - (remove mapped-device-needed-for-boot? - (operating-system-mapped-devices os))) + (let ((devices (operating-system-mapped-devices os)) + (file-systems (operating-system-file-systems os))) + (filter (lambda (md) + (let ((user (mapped-device-user md file-systems))) + (or (not user) + (not (file-system-needed-for-boot? user))))) + devices))) (define (operating-system-boot-mapped-devices os) "Return the subset of mapped devices that must be installed during boot, from the initrd." - (filter mapped-device-needed-for-boot? - (operating-system-mapped-devices os))) + (let ((devices (operating-system-mapped-devices os)) + (file-systems (operating-system-file-systems os))) + (filter (lambda (md) + (let ((user (mapped-device-user md file-systems))) + (and user (file-system-needed-for-boot? user)))) + devices))) (define (device-mapping-services os) "Return the list of device-mapping services for OS as a monadic list." diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 356b4826b4..4760821840 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -45,7 +45,6 @@ mapped-device-source mapped-device-target mapped-device-type - mapped-device-needed-for-boot? mapped-device-kind mapped-device-kind? @@ -158,9 +157,7 @@ file system." mapped-device? (source mapped-device-source) ;string (target mapped-device-target) ;string - (type mapped-device-type) ; - (needed-for-boot? mapped-device-needed-for-boot? ;Boolean - (default #f))) + (type mapped-device-type)) ; (define-record-type* mapped-device-kind make-mapped-device-kind -- cgit v1.2.3 From 5f86a66efdd07e1ff43fb280245e0b7f4744cfca Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 30 Nov 2014 18:29:13 +0100 Subject: doc: Explain that 'file-system' must refer to mapped devices by file name. * doc/guix.texi (File Systems): Clarify what to do when mapped devices are used. --- doc/guix.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 7c059b923a..4edaa922e1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3731,6 +3731,13 @@ is interpreted as a partition label name; when it is @code{uuid}, The @code{label} and @code{uuid} options offer a way to refer to disk partitions without having to hard-code their actual device name. +However, when a file system's source is a mapped device (@pxref{Mapped +Devices}), its @code{device} field @emph{must} refer to the mapped +device name---e.g., @file{/dev/mapper/root-partition}---and consequently +@code{title} must be set to @code{'device}. This is required so that +the system knows that mounting the file system depends on having the +corresponding device mapping established. + @item @code{flags} (default: @code{'()}) This is a list of symbols denoting mount flags. Recognized flags include @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow -- cgit v1.2.3 From 6efc160efe6b91dd2ef2b74d551411d290c3b1f6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 30 Nov 2014 18:34:31 +0100 Subject: daemon: Default to '--cores=0'. Suggested by Deck Pickard . * nix/nix-daemon/guix-daemon.cc (main): Set 'settings.buildCores' to 0. * doc/guix.texi (Invoking guix-daemon): Adjust accordingly. --- doc/guix.texi | 2 +- nix/nix-daemon/guix-daemon.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 4edaa922e1..f313ba5db4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -586,7 +586,7 @@ Cache build failures. By default, only successful builds are cached. Use @var{n} CPU cores to build each derivation; @code{0} means as many as available. -The default value is @code{1}, but it may be overridden by clients, such +The default value is @code{0}, but it may be overridden by clients, such as the @code{--cores} option of @command{guix build} (@pxref{Invoking guix build}). diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index d1d4541971..3cca120755 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -264,6 +264,9 @@ main (int argc, char *argv[]) /* Turn automatic deduplication on by default. */ settings.autoOptimiseStore = true; + /* Default to using as many cores as possible. */ + settings.buildCores = 0; + argvSaved = argv; try -- cgit v1.2.3 From 16eb115ef4986f319e6aebb04cefce12bc851e01 Mon Sep 17 00:00:00 2001 From: nebuli Date: Sun, 30 Nov 2014 17:47:22 +0100 Subject: guix: scripts: Add GUIX_BUILD_OPTIONS environment handling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Invoking guix build): Mention 'GUIX_BUILD_OPTIONS'. * guix/scripts/archive.scm: (append args (environment-build-options)). * guix/scripts/build.scm: Ditto. * guix/scripts/environment.scm: Ditto. * guix/scripts/package.scm: Ditto. * guix/scripts/system.scm: Ditto. * guix/ui.scm (environment-build-options): New function. * guix/utils.scm (arguments-from-environment-variable): New function. * tests/guix-build.sh: Add tests. * test-env.in: Unset GUIX_BUILD_OPTIONS. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 18 ++++++++++++++++++ guix/scripts/archive.scm | 3 ++- guix/scripts/build.scm | 3 ++- guix/scripts/environment.scm | 3 ++- guix/scripts/package.scm | 3 ++- guix/scripts/system.scm | 3 ++- guix/ui.scm | 5 +++++ guix/utils.scm | 10 ++++++++++ test-env.in | 4 ++-- tests/guix-build.sh | 10 ++++++++++ 10 files changed, 55 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index f313ba5db4..75ce632602 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2781,6 +2781,24 @@ the @code{package-derivation} procedure of the @code{(guix packages)} module, and to the @code{build-derivations} procedure of the @code{(guix store)} module. +In addition to options explicitly passed on the command line, +@command{guix build} and other @command{guix} commands that support +building honor the @code{GUIX_BUILD_OPTIONS} environment variable. + +@defvr {Environment Variable} GUIX_BUILD_OPTIONS +Users can define this variable to a list of command line options that +will automatically be used by @command{guix build} and other +@command{guix} commands that can perform builds, as in the example +below: + +@example +$ export GUIX_BUILD_OPTIONS="--no-substitutes -c 2 -L /foo/bar" +@end example + +These options are appended to the ones passed on the command line. +@end defvr + + @node Invoking guix download @section Invoking @command{guix download} diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index 84904e29da..29a3ad15a7 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -293,7 +293,8 @@ the input port." (define (guix-archive . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options + (args-fold* (append args (environment-build-options)) + %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index b4aa33b3a0..76a743f0b3 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -401,7 +401,8 @@ arguments with packages that use the specified source." (define (guix-build . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options + (args-fold* (append args (environment-build-options)) + %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 81bad963f6..a309dfa362 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -213,7 +213,8 @@ packages." ;; Entry point. (define (guix-environment . args) (define (parse-options) - (args-fold* args %options + (args-fold* (append args (environment-build-options)) + %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 3a72053766..9ff4d17bf4 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -668,7 +668,8 @@ removed from MANIFEST." (define (guix-package . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options + (args-fold* (append args (environment-build-options)) + %options (lambda (opt name arg result arg-handler) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result arg-handler) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 398a5a371b..8ea77e4f3c 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -467,7 +467,8 @@ Build the operating system declared in FILE according to ACTION.\n")) (define (guix-system . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* args %options + (args-fold* (append args (environment-build-options)) + %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/ui.scm b/guix/ui.scm index 69b073da50..c77e04172e 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -64,6 +64,7 @@ string->generations string->duration args-fold* + environment-build-options run-guix-command program-name guix-warning-port @@ -712,6 +713,10 @@ reporting." (leave (_ "invalid argument: ~a~%") (apply format #f msg args))))) +(define (environment-build-options) + "Return additional build options passed as environment variables." + (arguments-from-environment-variable "GUIX_BUILD_OPTIONS")) + (define (show-guix-usage) (format (current-error-port) (_ "Try `guix --help' for more information.~%")) diff --git a/guix/utils.scm b/guix/utils.scm index 9b802b6fb3..d0d2e8a3d4 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -72,6 +72,7 @@ package-name->name+version string-tokenize* string-replace-substring + arguments-from-environment-variable file-extension file-sans-extension call-with-temporary-output-file @@ -627,6 +628,15 @@ REPLACEMENT." (substring str start index) pieces)))))))) +(define (arguments-from-environment-variable variable) + "Retrieve value of environment variable denoted by string VARIABLE in the +form of a list of strings (`char-set:graphic' tokens) suitable for consumption +by `args-fold', if VARIABLE is defined, otherwise return an empty list." + (let ((env (getenv variable))) + (if env + (string-tokenize env char-set:graphic) + '()))) + (define (call-with-temporary-output-file proc) "Call PROC with a name of a temporary file and open output port to that file; close the file and delete it when leaving the dynamic extent of this diff --git a/test-env.in b/test-env.in index 39b205dc8a..f66a0db555 100644 --- a/test-env.in +++ b/test-env.in @@ -99,8 +99,8 @@ unset LANGUAGE LC_MESSAGES=C export LC_MESSAGES -# Ignore user modules. -unset GUIX_PACKAGE_PATH +# Ignore user settings. +unset GUIX_PACKAGE_PATH GUIX_BUILD_OPTIONS storedir="@storedir@" prefix="@prefix@" diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 27b3fdc39e..836c45e776 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -84,3 +84,13 @@ guix build -e "(begin # Running a gexp. guix build -e '#~(mkdir #$output)' -d guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv' + +# Using 'GUIX_BUILD_OPTIONS'. +GUIX_BUILD_OPTIONS="--dry-run" +export GUIX_BUILD_OPTIONS + +guix build emacs + +GUIX_BUILD_OPTIONS="--something-completely-crazy" +if guix build emacs; +then false; else true; fi -- cgit v1.2.3 From 73aa8ddb75bf143ae21e383118ae69582a0d93b5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Dec 2014 22:39:05 +0100 Subject: build-system/glib-or-gtk: Allow specific outputs to be excluded from wrapping. * guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Add #:glib-or-gtk-wrap-excluded-outputs parameter and honor it. * guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Add #:glib-or-gtk-wrap-excluded-outputs parameter and pass it in BUILDER. * doc/guix.texi (Build Systems): Mention it. --- doc/guix.texi | 7 ++++ guix/build-system/glib-or-gtk.scm | 3 ++ guix/build/glib-or-gtk-build-system.scm | 60 +++++++++++++++++++-------------- 3 files changed, 44 insertions(+), 26 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 75ce632602..157aecbe33 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1808,6 +1808,13 @@ modules}. This is achieved by wrapping the programs in launch scripts that appropriately set the @code{XDG_DATA_DIRS} and @code{GTK_PATH} environment variables. +It is possible to exclude specific package outputs from that wrapping +process by listing their names in the +@code{#:glib-or-gtk-wrap-excluded-outputs} parameter. This is useful +when an output is known not to contain any GLib or GTK+ binaries, and +where wrapping would gratuitously add a dependency of that output on +GLib and GTK+. + @item glib-or-gtk-compile-schemas The phase @code{glib-or-gtk-compile-schemas} makes sure that all GLib's @uref{https://developer.gnome.org/gio/stable/glib-compile-schemas.html, diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index 51e0c419e3..039bfb948c 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm @@ -122,6 +122,7 @@ "bin" "sbin")) (phases '(@ (guix build glib-or-gtk-build-system) %standard-phases)) + (glib-or-gtk-wrap-excluded-outputs '()) (system (%current-system)) (imported-modules %default-imported-modules) (modules %default-modules) @@ -153,6 +154,8 @@ #:search-paths ',(map search-path-specification->sexp search-paths) #:phases ,phases + #:glib-or-gtk-wrap-excluded-outputs + ,glib-or-gtk-wrap-excluded-outputs #:configure-flags ,configure-flags #:make-flags ,make-flags #:out-of-source? ,out-of-source? diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm index 5fc3b7c003..9351a70a0e 100644 --- a/guix/build/glib-or-gtk-build-system.scm +++ b/guix/build/glib-or-gtk-build-system.scm @@ -79,37 +79,45 @@ a list with all found directories." (fold glib-schemas '() inputs)) -(define* (wrap-all-programs #:key inputs outputs #:allow-other-keys) +(define* (wrap-all-programs #:key inputs outputs + (glib-or-gtk-wrap-excluded-outputs '()) + #:allow-other-keys) "Implement phase \"glib-or-gtk-wrap\": look for GSettings schemas and gtk+-v.0 libraries and create wrappers with suitably set environment variables -if found." +if found. + +Wrapping is not applied to outputs whose name is listed in +GLIB-OR-GTK-WRAP-EXCLUDED-OUTPUTS. This is useful when an output is known not +to contain any GLib or GTK+ binaries, and where wrapping would gratuitously +add a dependency of that output on GLib and GTK+." (define handle-output (match-lambda ((output . directory) - (let* ((bindir (string-append directory "/bin")) - (bin-list (find-files bindir ".*")) - (schemas (schemas-directories - (alist-cons output directory inputs))) - (gtk-mod-dirs (gtk-module-directories - (alist-cons output directory inputs))) - (schemas-env-var - (if (not (null? schemas)) - `("XDG_DATA_DIRS" ":" prefix ,schemas) - #f)) - (gtk-mod-env-var - (if (not (null? gtk-mod-dirs)) - `("GTK_PATH" ":" prefix ,gtk-mod-dirs) - #f))) - (cond - ((and schemas-env-var gtk-mod-env-var) - (for-each (cut wrap-program <> schemas-env-var gtk-mod-env-var) - bin-list)) - (schemas-env-var - (for-each (cut wrap-program <> schemas-env-var) - bin-list)) - (gtk-mod-env-var - (for-each (cut wrap-program <> gtk-mod-env-var) - bin-list))))))) + (unless (member output glib-or-gtk-wrap-excluded-outputs) + (let* ((bindir (string-append directory "/bin")) + (bin-list (find-files bindir ".*")) + (schemas (schemas-directories + (alist-cons output directory inputs))) + (gtk-mod-dirs (gtk-module-directories + (alist-cons output directory inputs))) + (schemas-env-var + (if (not (null? schemas)) + `("XDG_DATA_DIRS" ":" prefix ,schemas) + #f)) + (gtk-mod-env-var + (if (not (null? gtk-mod-dirs)) + `("GTK_PATH" ":" prefix ,gtk-mod-dirs) + #f))) + (cond + ((and schemas-env-var gtk-mod-env-var) + (for-each (cut wrap-program <> schemas-env-var gtk-mod-env-var) + bin-list)) + (schemas-env-var + (for-each (cut wrap-program <> schemas-env-var) + bin-list)) + (gtk-mod-env-var + (for-each (cut wrap-program <> gtk-mod-env-var) + bin-list)))))))) (for-each handle-output outputs) #t) -- cgit v1.2.3 From bc73aa439fea24a84777a0e764b7bd377684bbf1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 Dec 2014 14:03:33 +0100 Subject: doc: Adjust misleading 'user-account' example. Reported by Sleep_Walker on #guix. * doc/guix.texi (Using the Configuration System): Remove numeric UID and GID from example. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 157aecbe33..e804d79ed0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3533,7 +3533,7 @@ kernel, initial RAM disk, and boot loader looks like this: %base-file-systems)) (users (list (user-account (name "alice") - (uid 1000) (group 100) + (group "users") (comment "Bob's sister") (home-directory "/home/alice")))) (packages (cons emacs %base-packages)) -- cgit v1.2.3 From a7f862e4dade6942bb67322a97d733e7f89f564f Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Tue, 2 Dec 2014 10:36:25 +0300 Subject: doc: emacs: Document autoloading Emacs packages. * doc/emacs.texi (Emacs Initial Setup): Describe how Emacs packages installed in a user profile are autoloaded by "guix.el" --- doc/emacs.texi | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/emacs.texi b/doc/emacs.texi index ad2dcd8f65..a9f706e11c 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi @@ -56,11 +56,21 @@ Manual}): (require 'guix-init) @end example -Do not worry about the efficiency of that @code{require} thing. It will -not load the whole ``guix.el'' package, it will just autoload the main -interactive commands (@pxref{Autoload,,, elisp, The GNU Emacs Lisp -Reference Manual}). - +By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU +Emacs Lisp Reference Manual}) the main interactive commands for +``guix.el'' (@pxref{Emacs Commands}), requiring @code{guix-init} will +also autoload commands for the Emacs packages installed in your user +profile. + +To disable automatic loading of installed Emacs packages, set +@code{guix-package-enable-at-startup} variable to @code{nil} before +requiring @code{guix-init}. This variable has the same meaning for +Emacs packages installed with Guix, as @code{package-enable-at-startup} +for the inbuilt Emacs package system (@pxref{Package Installation,,, +emacs, The GNU Emacs Manual}). + +You can activate Emacs packages installed in your profile whenever you +want using @kbd{M-x@tie{}guix-emacs-load-autoloads}. @node Emacs Usage @subsection Usage -- cgit v1.2.3 From 5ec98c3de5600a915ffe5908a97f12d09968ba5a Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 3 Dec 2014 20:25:27 +0300 Subject: doc: emacs: Fix typo. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Ludovic Courtès . * doc/emacs.texi (Emacs Initial Setup): Replace "inbuilt" with "built-in". --- doc/emacs.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/emacs.texi b/doc/emacs.texi index a9f706e11c..86e0048538 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi @@ -66,7 +66,7 @@ To disable automatic loading of installed Emacs packages, set @code{guix-package-enable-at-startup} variable to @code{nil} before requiring @code{guix-init}. This variable has the same meaning for Emacs packages installed with Guix, as @code{package-enable-at-startup} -for the inbuilt Emacs package system (@pxref{Package Installation,,, +for the built-in Emacs package system (@pxref{Package Installation,,, emacs, The GNU Emacs Manual}). You can activate Emacs packages installed in your profile whenever you -- cgit v1.2.3 From 847391fe6229bc9b989939470b4a84bd82c75088 Mon Sep 17 00:00:00 2001 From: nebuli Date: Fri, 5 Dec 2014 01:28:12 +0100 Subject: guix: scripts: Parse $GUIX_BUILD_OPTIONS separately. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Appending to "raw" args broke optional parameters in 'guix package -I' and 'guix package -A', and possibly other places. Therefore, switch to parsing each set of options on its own and append resulting alists together afterwards. * guix/scripts/archive.scm (parse-options-from): Rename from (parse-options) and add explicit argument. New form of (parse-options) using its old algorithm via -from function. * guix/scripts/build.scm: Ditto. * guix/scripts/environment.scm: Ditto. * guix/scripts/package.scm: Ditto. * guix/scripts/system.scm: Ditto. * tests/guix-package.sh: Add test. * doc/guix.texi (Invoking guix build): Make it clear that the options are parsed independently. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 3 ++- guix/scripts/archive.scm | 8 ++++++-- guix/scripts/build.scm | 8 ++++++-- guix/scripts/environment.scm | 9 +++++++-- guix/scripts/package.scm | 8 ++++++-- guix/scripts/system.scm | 8 ++++++-- tests/guix-package.sh | 13 +++++++++++++ 7 files changed, 46 insertions(+), 11 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index e804d79ed0..1d4a012b16 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2802,7 +2802,8 @@ below: $ export GUIX_BUILD_OPTIONS="--no-substitutes -c 2 -L /foo/bar" @end example -These options are appended to the ones passed on the command line. +These options are parsed independently, and the result is appended to +the parsed command-line options. @end defvr diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index 29a3ad15a7..781ffc5f58 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -293,8 +293,12 @@ the input port." (define (guix-archive . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* (append args (environment-build-options)) - %options + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 76a743f0b3..26e9f42774 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -401,8 +401,12 @@ arguments with packages that use the specified source." (define (guix-build . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* (append args (environment-build-options)) - %options + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index a309dfa362..c388b0c52c 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -213,8 +213,13 @@ packages." ;; Entry point. (define (guix-environment . args) (define (parse-options) - (args-fold* (append args (environment-build-options)) - %options + ;; Return the alist of option values. + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 9ff4d17bf4..21dc66cb75 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -668,8 +668,12 @@ removed from MANIFEST." (define (guix-package . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* (append args (environment-build-options)) - %options + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result arg-handler) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result arg-handler) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index f2a25dd65a..56228601cc 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -477,8 +477,12 @@ Build the operating system declared in FILE according to ACTION.\n")) (define (guix-system . args) (define (parse-options) ;; Return the alist of option values. - (args-fold* (append args (environment-build-options)) - %options + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 3e0e36fa23..f4e091a5a2 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -289,3 +289,16 @@ GUIX_PACKAGE_PATH="$module_dir" export GUIX_PACKAGE_PATH guix package -A emacs-foo-bar | grep 42 guix package -i emacs-foo-bar-42 -n +unset GUIX_PACKAGE_PATH + +# Using 'GUIX_BUILD_OPTIONS'. + +available="`guix package -A | sort`" +GUIX_BUILD_OPTIONS="--dry-run" +export GUIX_BUILD_OPTIONS + +# Make sure $GUIX_BUILD_OPTIONS is not simply appended to the command-line, +# which would break 'guix package -A' and similar. +available2="`guix package -A | sort`" +test "$available2" = "$available" +guix package -I -- cgit v1.2.3 From d8b94dbd76101f9090d2ffc60125dbcca6ff029b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 7 Dec 2014 22:55:06 +0100 Subject: doc: Give example uses of 'deco'. Suggested by Sleep_Walker on #guix. * doc/guix.texi (Services): Add 'deco' examples. --- doc/guix.texi | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 1d4a012b16..22f248481f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4078,11 +4078,42 @@ An important part of preparing an @code{operating-system} declaration is listing @dfn{system services} and their configuration (@pxref{Using the Configuration System}). System services are typically daemons launched when the system boots, or other actions needed at that time---e.g., -configuring network access. They are managed by GNU@tie{}dmd -(@pxref{Introduction,,, dmd, GNU dmd Manual}). +configuring network access. + +Services are managed by GNU@tie{}dmd (@pxref{Introduction,,, dmd, GNU +dmd Manual}). On a running system, the @command{deco} command allows +you to list the available services, show their status, start and stop +them, or do other specific operations (@pxref{Jump Start,,, dmd, GNU dmd +Manual}). For example: + +@example +# deco status dmd +@end example + +The above command, run as @code{root}, lists the currently defined +services. The @command{deco doc} command shows a synopsis of the given +service: + +@example +# deco doc nscd +Run libc's name service cache daemon (nscd). +@end example + +The @command{start}, @command{stop}, and @command{restart} sub-commands +have the effect you would expect. For instance, the commands below stop +the nscd service and restart the Xorg display server: + +@example +# deco stop nscd +Service nscd has been stopped. +# deco restart xorg-server +Service xorg-server has been stopped. +Service xorg-server has been started. +@end example The following sections document the available services, starting with -the core services. +the core services, that may be used in an @code{operating-system} +declaration. @menu * Base Services:: Essential system services. -- cgit v1.2.3 From 659a92fc7b99e1fdf153e469ea2471c5e143fdf9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 9 Dec 2014 11:30:26 +0100 Subject: doc: Explain how to set the ownership and permissions of /gnu/store. Fixes . Reported by rekado . * doc/guix.texi (Build Environment Setup): Show commands to set the ownership and permissions of /gnu/store. --- doc/guix.texi | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 22f248481f..bb52cf713f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -347,6 +347,15 @@ Bash syntax and the @code{shadow} commands): done @end example +The @file{/gnu/store} directory (or whichever was specified with the +@code{--with-store-dir} option) must have ownership and permissions as +follows: + +@example +# chgrp guix-builder /gnu/store +# chmod 1775 /gnu/store +@end example + @noindent The @code{guix-daemon} program may then be run as @code{root} with: -- cgit v1.2.3