From c08ea55e7ec25261e4596bf6726a83c1ed056b94 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 11 Jun 2017 23:05:23 +0200 Subject: packages: Add 'specifications->manifest'. * gnu/packages.scm (specifications->manifest): New procedure. * doc/guix.texi (Invoking guix package): Change example from using '(compose list specification->package+output)' to using 'specifications->manifest'. --- doc/guix.texi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 87aaae8545..83f20c8598 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1742,18 +1742,17 @@ of packages: (list guile-2.0 "debug"))) @end example -@findex specification->package+output +@findex specifications->manifest In this example we have to know which modules define the @code{emacs} and @code{guile-2.0} variables to provide the right @code{use-package-modules} line, which can be cumbersome. We can instead provide regular package specifications and let -@code{specification->package-output} look up the corresponding package +@code{specifications->manifest} look up the corresponding package objects, like this: @example -(packages->manifest - (map (compose list specification->package+output) - '("emacs" "guile@@2.0" "guile@@2.0:debug"))) +(specifications->manifest + '("emacs" "guile@@2.2" "guile@@2.2:debug")) @end example @item --roll-back -- cgit v1.2.3 From 81fa2229ecb80a8ae90c8e24771e1df880e75383 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 8 Jun 2017 20:12:38 +0200 Subject: services: rottlog: Define objects. * gnu/services/admin.scm (): New record type. (syslog-rotation-config, simple-rotation-config): Remove. (%default-rotations): Define as a list of objects. (log-rotation->config, log-rotations->/etc-entries): New procedures. ()[periodic-rotations]: Remove. [rotations]: New field. (rottlog-etc): Use 'log-rotations->/etc-entries'. * doc/guix.texi (Log Rotation): Update accordingly. --- doc/guix.texi | 56 +++++++++++++++++-------- gnu/services/admin.scm | 110 +++++++++++++++++++++++++++++++++++-------------- 2 files changed, 117 insertions(+), 49 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 83f20c8598..b8675bde2a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9543,7 +9543,7 @@ services admin)} module provides an interface to GNU@tie{}Rot[t]log, a log rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}). The example below defines an operating system that provides log rotation -with the default settings. +with the default settings, for commonly encountered log files. @lisp (use-modules (guix) (gnu)) @@ -9576,33 +9576,53 @@ The Rottlog package to use. The Rottlog configuration file to use (@pxref{Mandatory RC Variables,,, rottlog, GNU Rot[t]log Manual}). -@item @code{periodic-rotations} (default: @code{`(("weekly" %default-rotations))}) -A list of Rottlog period-name/period-config tuples. +@item @code{rotations} (default: @code{%default-rotations}) +A list of @code{log-rotation} objects as defined below. -For example, taking an example from the Rottlog manual (@pxref{Period -Related File Examples,,, rottlog, GNU Rot[t]log Manual}), a valid tuple -might be: +@item @code{jobs} +This is a list of gexps where each gexp corresponds to an mcron job +specification (@pxref{Scheduled Job Execution}). +@end table +@end deftp + +@deftp {Data Type} log-rotation +Data type representing the rotation of a group of log files. + +Taking an example from the Rottlog manual (@pxref{Period Related File +Examples,,, rottlog, GNU Rot[t]log Manual}), a log rotation might be +defined like this: @example -("daily" ,(plain-file "daily" - "\ - /var/log/apache/* @{ - storedir apache-archives - rotate 6 - notifempty - nocompress - @}")) +(log-rotation + (frequency 'daily) + (files '("/var/log/apache/*")) + (options '("storedir apache-archives" + "rotate 6" + "notifempty" + "nocompress"))) @end example -@item @code{jobs} -This is a list of gexps where each gexp corresponds to an mcron job -specification (@pxref{Scheduled Job Execution}). +The list of fields is as follows: + +@table @asis +@item @code{frequency} (default: @code{'weekly}) +The log rotation frequency, a symbol. + +@item @code{files} +The list of files or file glob patterns to rotate. + +@item @code{options} (default: @code{'()}) +The list of rottlog options for this rotation (@pxref{Configuration +parameters,,, rottlog, GNU Rot[t]lg Manual}). + +@item @code{post-rotate} (default: @code{#f}) +Either @code{#f} or a gexp to execute once the rotation has completed. @end table @end deftp @defvr {Scheme Variable} %default-rotations Specifies weekly rotation of @var{%rotated-files} and -@code{"/var/log/shepherd.log"}. +a couple of other files. @end defvr @defvr {Scheme Variable} %rotated-files diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 6ac24e32b0..99f3b1da16 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -27,8 +27,17 @@ (define-module (gnu services admin) #:use-module (guix packages) #:use-module (guix records) #:use-module (srfi srfi-1) + #:use-module (ice-9 vlist) #:export (%default-rotations %rotated-files + + log-rotation + log-rotation? + log-rotation-frequency + log-rotation-files + log-rotation-options + log-rotation-post-rotate + rottlog-configuration rottlog-configuration? rottlog-service @@ -40,41 +49,78 @@ (define-module (gnu services admin) ;;; /etc/rottlog/{rc,hourly|daily|weekly}. Example usage ;;; ;;; (mcron-service) -;;; (service rottlog-service-type (rottlog-configuration)) +;;; (service rottlog-service-type) ;;; ;;; Code: +(define-record-type* log-rotation make-log-rotation + log-rotation? + (files log-rotation-files) ;list of strings + (frequency log-rotation-frequency ;symbol + (default 'weekly)) + (post-rotate log-rotation-post-rotate ;#f | gexp + (default #f)) + (options log-rotation-options ;list of strings + (default '()))) + (define %rotated-files ;; Syslog files subject to rotation. '("/var/log/messages" "/var/log/secure" "/var/log/maillog")) -(define (syslog-rotation-config files) - #~(string-append #$(string-join files ",") - " { - sharedscripts - postrotate - " #$coreutils "/bin/kill -HUP $(cat /var/run/syslog.pid) 2> /dev/null - endscript -} -")) - -(define (simple-rotation-config files) - #~(string-append #$(string-join files ",") " { - sharedscripts -} -")) - (define %default-rotations - `(("weekly" - ,(computed-file "rottlog.weekly" - #~(call-with-output-file #$output - (lambda (port) - (display #$(syslog-rotation-config %rotated-files) - port) - (display #$(simple-rotation-config - '("/var/log/shepherd.log" - "/var/log/guix-daemon.log")) - port))))))) + (list (log-rotation ;syslog files + (files %rotated-files) + + ;; Restart syslogd after rotation. + (options '("sharedscripts")) + (post-rotate #~(let ((pid (call-with-input-file "/var/run/syslog.pid" + read))) + (kill pid SIGHUP)))) + (log-rotation + (files '("/var/log/shepherd.log" "/var/log/guix-daemon.log"))))) + +(define (log-rotation->config rotation) + "Return a string-valued gexp representing the rottlog configuration snippet +for ROTATION." + (define post-rotate + (let ((post (log-rotation-post-rotate rotation))) + (and post + (program-file "rottlog-post-rotate.scm" post)))) + + #~(let ((post #$post-rotate)) + (string-append (string-join '#$(log-rotation-files rotation) ",") + " {" + #$(string-join (log-rotation-options rotation) + "\n " 'prefix) + (if post + (string-append "\n postrotate\n " post + "\n endscript\n") + "") + "\n}\n"))) + +(define (log-rotations->/etc-entries rotations) + "Return the list of /etc entries for ROTATIONS, a list of ." + (define (frequency-file frequency rotations) + (computed-file (string-append "rottlog." (symbol->string frequency)) + #~(call-with-output-file #$output + (lambda (port) + (for-each (lambda (str) + (display str port)) + (list #$@(map log-rotation->config + rotations))))))) + + (let* ((frequencies (delete-duplicates + (map log-rotation-frequency rotations))) + (table (fold (lambda (rotation table) + (vhash-consq (log-rotation-frequency rotation) + rotation table)) + vlist-null + rotations))) + (map (lambda (frequency) + `(,(symbol->string frequency) + ,(frequency-file frequency + (vhash-foldq* cons '() frequency table)))) + frequencies))) (define (default-jobs rottlog) (list #~(job '(next-hour '(0)) ;midnight @@ -91,15 +137,17 @@ (define-record-type* (default rottlog)) (rc-file rottlog-rc-file ;file-like (default (file-append rottlog "/etc/rc"))) - (periodic-rotations rottlog-periodic-rotations ;list of (name file) tuples + (rotations rottlog-rotations ;list of (default %default-rotations)) (jobs rottlog-jobs ;list of (default #f))) (define (rottlog-etc config) - `(("rottlog" ,(file-union "rottlog" - (cons `("rc" ,(rottlog-rc-file config)) - (rottlog-periodic-rotations config)))))) + `(("rottlog" + ,(file-union "rottlog" + (cons `("rc" ,(rottlog-rc-file config)) + (log-rotations->/etc-entries + (rottlog-rotations config))))))) (define (rottlog-jobs-or-default config) (or (rottlog-jobs config) -- cgit v1.2.3 From 254ea3f945e8bc44f8c3a4159302f24f4fe5f216 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 8 Jun 2017 20:23:08 +0200 Subject: services: rottlog: Make extensible. * gnu/services/admin.scm (rottlog-service-type)[compose, extend]: New fields. * doc/guix.texi (Log Rotation): Mention extension. --- doc/guix.texi | 3 +++ gnu/services/admin.scm | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index b8675bde2a..ffd2028de9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9561,6 +9561,9 @@ with the default settings, for commonly encountered log files. This is the type of the Rottlog service, whose value is a @code{rottlog-configuration} object. +Other services can extend this one with new @code{log-rotation} objects +(see below), thereby augmenting the set of files to be rotated. + This service type can define mcron jobs (@pxref{Scheduled Job Execution}) to run the rottlog service. @end defvr diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 99f3b1da16..b9e3fa70a4 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -164,6 +164,12 @@ (define rottlog-service-type ;; the documentation. (service-extension profile-service-type (compose list rottlog-rottlog)))) + (compose concatenate) + (extend (lambda (config rotations) + (rottlog-configuration + (inherit config) + (rotations (append (rottlog-rotations config) + rotations))))) (default-value (rottlog-configuration)))) ;;; admin.scm ends here -- cgit v1.2.3 From 4e863eb35fd8337eab48928e7733b7f6b7b2c242 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 13 Jun 2017 23:04:05 +0200 Subject: guix package: '--search' sorts by relevance. * guix/scripts/package.scm (find-packages-by-description): Rewrite to compute a score based on the number of regexps matched and the number of matches for each regexp. Sort according to this score and return it as a second value. (process-query) <'search>: Capture the two return values of 'find-packages-by-description'. Pass #:extra-fields to 'package->recutils'. * doc/guix.texi (Invoking guix package): Mention relevance, give an example. --- doc/guix.texi | 14 ++++++--- guix/scripts/package.scm | 76 ++++++++++++++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 32 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index ffd2028de9..b5538e0195 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1854,7 +1854,7 @@ availability of packages: @itemx -s @var{regexp} @cindex searching for packages List the available packages whose name, synopsis, or description matches -@var{regexp}. Print all the metadata of matching packages in +@var{regexp}, sorted by relevance. Print all the metadata of matching packages in @code{recutils} format (@pxref{Top, GNU recutils databases,, recutils, GNU recutils manual}). @@ -1862,12 +1862,18 @@ This allows specific fields to be extracted using the @command{recsel} command, for instance: @example -$ guix package -s malloc | recsel -p name,version +$ guix package -s malloc | recsel -p name,version,relevance +name: jemalloc +version: 4.5.0 +relevance: 6 + name: glibc -version: 2.17 +version: 2.25 +relevance: 1 name: libgc -version: 7.2alpha6 +version: 7.6.0 +relevance: 1 @end example Similarly, to show the name of all the packages available under the diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index f050fad976..a6bfb03ae4 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -39,6 +39,7 @@ (define-module (guix scripts package) #:select (directory-exists? mkdir-p)) #:use-module (ice-9 format) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 vlist) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -238,32 +239,45 @@ (define* (build-and-use-profile store profile manifest ;;; (define (find-packages-by-description regexps) - "Return the list of packages whose name matches one of REGEXPS, or whose -synopsis or description matches all of REGEXPS." - (define version=?)) - - (define (matches-all? str) - (every (cut regexp-exec <> str) regexps)) - - (define (matches-one? str) - (find (cut regexp-exec <> str) regexps)) - - (sort - (fold-packages (lambda (package result) - (if (or (matches-one? (package-name package)) - (and=> (package-synopsis package) - (compose matches-all? P_)) - (and=> (package-description package) - (compose matches-all? P_))) - (cons package result) - result)) - '()) - (lambda (p1 p2) - (case (string-compare (package-name p1) (package-name p2) - (const '<) (const '=) (const '>)) - ((=) (version? (package-full-name package1) + (package-full-name package2)) + (> score1 score2))))))))))) (define (transaction-upgrade-entry entry transaction) "Return a variant of TRANSACTION that accounts for the upgrade of ENTRY, a @@ -752,8 +766,14 @@ (define (diff-profiles profile numbers) opts)) (regexps (map (cut make-regexp* <> regexp/icase) patterns))) (leave-on-EPIPE - (for-each (cute package->recutils <> (current-output-port)) - (find-packages-by-description regexps))) + (let-values (((packages scores) + (find-packages-by-description regexps))) + (for-each (lambda (package score) + (package->recutils package (current-output-port) + #:extra-fields + `((relevance . ,score)))) + packages + scores))) #t)) (('show requested-name) -- cgit v1.2.3 From 205794c8684076696a3e474a6c9f6d53460b744d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 9 Jun 2017 11:46:14 +0200 Subject: build-system: Add 'texlive-build-system'. * guix/build-system/texlive.scm: New file. * guix/build/texlive-build-system.scm: New file. * Makefile.am (MODULES): Add them. * doc/guix.texi (Build Systems): Document it. * gnu/packages/tex.scm (%texlive-tag, %texlive-revision): Remove variables. (texlife-ref): Remove procedure. --- Makefile.am | 3 + doc/guix.texi | 19 +++++ gnu/packages/tex.scm | 14 +-- guix/build-system/texlive.scm | 164 ++++++++++++++++++++++++++++++++++++ guix/build/texlive-build-system.scm | 89 +++++++++++++++++++ 5 files changed, 276 insertions(+), 13 deletions(-) create mode 100644 guix/build-system/texlive.scm create mode 100644 guix/build/texlive-build-system.scm (limited to 'doc') diff --git a/Makefile.am b/Makefile.am index 1be09d7637..436a003411 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ # Copyright © 2016, 2017 Mark H Weaver # Copyright © 2017 Mathieu Othacehe # Copyright © 2017 Leo Famulari +# Copyright © 2017 Ricardo Wurmus # # This file is part of GNU Guix. # @@ -87,6 +88,7 @@ MODULES = \ guix/build-system/waf.scm \ guix/build-system/r.scm \ guix/build-system/ruby.scm \ + guix/build-system/texlive.scm \ guix/build-system/trivial.scm \ guix/ftp-client.scm \ guix/http-client.scm \ @@ -114,6 +116,7 @@ MODULES = \ guix/build/ocaml-build-system.scm \ guix/build/r-build-system.scm \ guix/build/ruby-build-system.scm \ + guix/build/texlive-build-system.scm \ guix/build/waf-build-system.scm \ guix/build/haskell-build-system.scm \ guix/build/store-copy.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index b5538e0195..056059d04b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3580,6 +3580,25 @@ are run after installation using the R function @code{tools::testInstalledPackage}. @end defvr +@defvr {Scheme Variable} texlive-build-system +This variable is exported by @code{(guix build-system texlive)}. It is +used to build TeX packages in batch mode with a specified engine. The +build system sets the @code{TEXINPUTS} variable to find all TeX source +files in the inputs. + +By default it runs @code{luatex} on all files ending on @code{ins}. A +different engine and format can be specified with the +@code{#:tex-format} argument. Different build targets can be specified +with the @code{#:build-targets} argument, which expects a list of file +names. The build system adds only @code{texlive-bin} and +@code{texlive-latex-base} (both from @code{(gnu packages tex}) to the +inputs. Both can be overridden with the arguments @code{#:texlive-bin} +and @code{#:texlive-latex-base}, respectively. + +The @code{#:tex-directory} parameter tells the build system where to +install the built files under the texmf tree. +@end defvr + @defvr {Scheme Variable} ruby-build-system This variable is exported by @code{(guix build-system ruby)}. It implements the RubyGems build procedure used by Ruby packages, which diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 9c791ffa10..faf949862f 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -30,6 +30,7 @@ (define-module (gnu packages tex) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (guix build-system trivial) + #:use-module (guix build-system texlive) #:use-module (guix utils) #:use-module (guix git-download) #:use-module (guix svn-download) @@ -180,10 +181,6 @@ (define texlive-bin (license (license:fsf-free "https://www.tug.org/texlive/copying.html")) (home-page "https://www.tug.org/texlive/"))) -;; These variables specify the SVN tag and the matching SVN revision. -(define %texlive-tag "texlive-2017.0") -(define %texlive-revision 44445) - (define-public texlive-dvips (package (name "texlive-dvips") @@ -672,15 +669,6 @@ (define-public texlive-tex-plain book).") (license license:knuth))) -(define (texlive-ref component id) - "Return a object for the package ID, which is part of the -given Texlive COMPONENT." - (svn-reference - (url (string-append "svn://www.tug.org/texlive/tags/" - %texlive-tag "/Master/texmf-dist/" - "source/" component "/" id)) - (revision %texlive-revision))) - (define-public texlive-latex-base (let ((texlive-dir (lambda (dir hash) diff --git a/guix/build-system/texlive.scm b/guix/build-system/texlive.scm new file mode 100644 index 0000000000..d4085ea7e8 --- /dev/null +++ b/guix/build-system/texlive.scm @@ -0,0 +1,164 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ricardo Wurmus +;;; +;;; 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 (guix build-system texlive) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix packages) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix svn-download) + #:use-module (ice-9 match) + #:export (%texlive-build-system-modules + texlive-build + texlive-build-system + texlive-ref + %texlive-tag + %texlive-revision)) + +;; Commentary: +;; +;; Standard build procedure for Texlive packages. +;; +;; Code: + +;; These variables specify the SVN tag and the matching SVN revision. +(define %texlive-tag "texlive-2017.0") +(define %texlive-revision 44445) + +(define (texlive-ref component id) + "Return a object for the package ID, which is part of the +given Texlive COMPONENT." + (svn-reference + (url (string-append "svn://www.tug.org/texlive/tags/" + %texlive-tag "/Master/texmf-dist/" + "source/" component "/" id)) + (revision %texlive-revision))) + +(define %texlive-build-system-modules + ;; Build-side modules imported by default. + `((guix build texlive-build-system) + ,@%gnu-build-system-modules)) + +(define (default-texlive-bin) + "Return the default texlive-bin package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((tex-mod (resolve-interface '(gnu packages tex)))) + (module-ref tex-mod 'texlive-bin))) + +(define (default-texlive-latex-base) + "Return the default texlive-latex-base package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((tex-mod (resolve-interface '(gnu packages tex)))) + (module-ref tex-mod 'texlive-latex-base))) + +(define* (lower name + #:key + source inputs native-inputs outputs + system target + (texlive-latex-base (default-texlive-latex-base)) + (texlive-bin (default-texlive-bin)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:source #:target #:inputs #:native-inputs + #:texlive-latex-base #:texlive-bin)) + + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("texlive-bin" ,texlive-bin) + ("texlive-latex-base" ,texlive-latex-base) + ,@native-inputs)) + (outputs outputs) + (build texlive-build) + (arguments (strip-keyword-arguments private-keywords arguments)))) + +(define* (texlive-build store name inputs + #:key + (tests? #f) + tex-directory + (build-targets #f) + (tex-format "luatex") + (phases '(@ (guix build texlive-build-system) + %standard-phases)) + (outputs '("out")) + (search-paths '()) + (system (%current-system)) + (guile #f) + (substitutable? #t) + (imported-modules %texlive-build-system-modules) + (modules '((guix build texlive-build-system) + (guix build utils)))) + "Build SOURCE with INPUTS." + (define builder + `(begin + (use-modules ,@modules) + (texlive-build #:name ,name + #:source ,(match (assoc-ref inputs "source") + (((? derivation? source)) + (derivation->output-path source)) + ((source) + source) + (source + source)) + #:tex-directory ,tex-directory + #:build-targets ,build-targets + #:tex-format ,tex-format + #:system ,system + #:tests? ,tests? + #:phases ,phases + #:outputs %outputs + #:search-paths ',(map search-path-specification->sexp + search-paths) + #:inputs %build-inputs))) + + (define guile-for-build + (match guile + ((? package?) + (package-derivation store guile system #:graft? #f)) + (#f ; the default + (let* ((distro (resolve-interface '(gnu packages commencement))) + (guile (module-ref distro 'guile-final))) + (package-derivation store guile system #:graft? #f))))) + + (build-expression->derivation store name builder + #:inputs inputs + #:system system + #:modules imported-modules + #:outputs outputs + #:guile-for-build guile-for-build + #:substitutable? substitutable?)) + +(define texlive-build-system + (build-system + (name 'texlive) + (description "The build system for TeX Live packages") + (lower lower))) + +;;; texlive.scm ends here diff --git a/guix/build/texlive-build-system.scm b/guix/build/texlive-build-system.scm new file mode 100644 index 0000000000..c1fd9fd9af --- /dev/null +++ b/guix/build/texlive-build-system.scm @@ -0,0 +1,89 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ricardo Wurmus +;;; +;;; 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 (guix build texlive-build-system) + #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (%standard-phases + texlive-build)) + +;; Commentary: +;; +;; Builder-side code of the standard build procedure for TeX Live packages. +;; +;; Code: + +(define (compile-with-latex format file) + (zero? (system* format + "-interaction=batchmode" + "-output-directory=build" + (string-append "&" format) + file))) + +(define* (build #:key inputs build-targets tex-format #:allow-other-keys) + ;; Find additional tex and sty files + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" (getcwd) "/build:" + (string-join + (append-map (match-lambda + ((_ . dir) + (find-files dir + (lambda (_ stat) + (eq? 'directory (stat:type stat))) + #:directories? #t + #:stat stat))) + inputs) + ":"))) + (setenv "TEXFORMATS" + (string-append (assoc-ref inputs "texlive-latex-base") + "/share/texmf-dist/web2c/")) + (setenv "LUAINPUTS" + (string-append (assoc-ref inputs "texlive-latex-base") + "/share/texmf-dist/tex/latex/base/")) + (mkdir "build") + (every (cut compile-with-latex tex-format <>) + (if build-targets build-targets + (find-files "." "\\.ins$")))) + +(define* (install #:key outputs tex-directory #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (target (string-append + out "/share/texmf-dist/tex/" tex-directory))) + (mkdir-p target) + (for-each delete-file (find-files "." "\\.(log|aux)$")) + (for-each (cut install-file <> target) + (find-files "build" ".*")) + #t)) + +(define %standard-phases + (modify-phases gnu:%standard-phases + (delete 'configure) + (replace 'build build) + (delete 'check) + (replace 'install install))) + +(define* (texlive-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given TeX Live package, applying all of PHASES in order." + (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; texlive-build-system.scm ends here -- cgit v1.2.3 From afbc94194e223378dd3aece6e2330015e5e57a1e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 9 Jun 2017 12:35:50 +0200 Subject: guix: Add texlive importer. * guix/import/texlive.scm: New file. * guix/scripts/import/texlive.scm: New file. * Makefile.am (MODULES): Add them. * tests/texlive.scm: New file. * Makefile.am (SCM_TESTS): Add it. * guix/scripts/import.scm (importers): Add texlive importer. * doc/guix.texi (Invoking guix import): Document it. --- Makefile.am | 3 + doc/guix.texi | 34 +++++++- guix/import/texlive.scm | 182 ++++++++++++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/texlive.scm | 101 ++++++++++++++++++++++ tests/texlive.scm | 115 +++++++++++++++++++++++++ 6 files changed, 435 insertions(+), 2 deletions(-) create mode 100644 guix/import/texlive.scm create mode 100644 guix/scripts/import/texlive.scm create mode 100644 tests/texlive.scm (limited to 'doc') diff --git a/Makefile.am b/Makefile.am index 436a003411..4dfcd06d0b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -145,6 +145,7 @@ MODULES = \ guix/import/cran.scm \ guix/import/hackage.scm \ guix/import/elpa.scm \ + guix/import/texlive.scm \ guix/scripts.scm \ guix/scripts/download.scm \ guix/scripts/perform-download.scm \ @@ -167,6 +168,7 @@ MODULES = \ guix/scripts/import/nix.scm \ guix/scripts/import/hackage.scm \ guix/scripts/import/elpa.scm \ + guix/scripts/import/texlive.scm \ guix/scripts/environment.scm \ guix/scripts/publish.scm \ guix/scripts/edit.scm \ @@ -303,6 +305,7 @@ SCM_TESTS = \ tests/hackage.scm \ tests/cran.scm \ tests/elpa.scm \ + tests/texlive.scm \ tests/store.scm \ tests/monads.scm \ tests/gexp.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 056059d04b..97fa1b7864 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21,7 +21,7 @@ Copyright @copyright{} 2015, 2016 Mathieu Lirzin@* Copyright @copyright{} 2014 Pierre-Antoine Rault@* Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer@* Copyright @copyright{} 2015, 2016, 2017 Leo Famulari@* -Copyright @copyright{} 2015, 2016 Ricardo Wurmus@* +Copyright @copyright{} 2015, 2016, 2017 Ricardo Wurmus@* Copyright @copyright{} 2016 Ben Woodcroft@* Copyright @copyright{} 2016 Chris Marusich@* Copyright @copyright{} 2016, 2017 Efraim Flashner@* @@ -5671,6 +5671,38 @@ R package: guix import cran --archive=bioconductor GenomicRanges @end example +@item texlive +@cindex TeX Live +@cindex CTAN +Import metadata from @uref{http://www.ctan.org/, CTAN}, the +comprehensive TeX archive network for TeX packages that are part of the +@uref{https://www.tug.org/texlive/, TeX Live distribution}. + +Information about the package is obtained through the XML API provided +by CTAN, while the source code is downloaded from the SVN repository of +the Tex Live project. This is done because the CTAN does not keep +versioned archives. + +The command command below imports metadata for the @code{fontspec} +TeX package: + +@example +guix import texlive fontspec +@end example + +When @code{--archive=DIRECTORY} is added, the source code is downloaded +not from the @file{latex} sub-directory of the @file{texmf-dist/source} +tree in the TeX Live SVN repository, but from the specified sibling +directory under the same root. + +The command below imports metadata for the @code{ifxetex} package from +CTAN while fetching the sources from the directory +@file{texmf/source/generic}: + +@example +guix import texlive --archive=generic ifxetex +@end example + @item nix Import metadata from a local copy of the source of the @uref{http://nixos.org/nixpkgs/, Nixpkgs distribution}@footnote{This diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm new file mode 100644 index 0000000000..d4c3714364 --- /dev/null +++ b/guix/import/texlive.scm @@ -0,0 +1,182 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ricardo Wurmus +;;; +;;; 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 (guix import texlive) + #:use-module (ice-9 match) + #:use-module (sxml simple) + #:use-module (sxml xpath) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (web uri) + #:use-module (guix http-client) + #:use-module (guix hash) + #:use-module (guix memoization) + #:use-module (guix store) + #:use-module (guix base32) + #:use-module (guix serialization) + #:use-module (guix svn-download) + #:use-module (guix import utils) + #:use-module (guix utils) + #:use-module (guix upstream) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (guix build-system texlive) + #:export (texlive->guix-package)) + +;;; Commentary: +;;; +;;; Generate a package declaration template for the latest version of a +;;; package on CTAN, using the XML output produced by the XML API to the CTAN +;;; database at http://www.ctan.org/xml/1.2/ +;;; +;;; Instead of taking the packages from CTAN, however, we fetch the sources +;;; from the SVN repository of the Texlive project. We do this because CTAN +;;; only keeps a single version of each package whereas we can access any +;;; version via SVN. Unfortunately, this means that the importer is really +;;; just a Texlive importer, not a generic CTAN importer. +;;; +;;; Code: + +(define string->license + (match-lambda + ("artistic2" 'gpl3+) + ("gpl" 'gpl3+) + ("gpl1" 'gpl1) + ("gpl1+" 'gpl1+) + ("gpl2" 'gpl2) + ("gpl2+" 'gpl2+) + ("gpl3" 'gpl3) + ("gpl3+" 'gpl3+) + ("lgpl2.1" 'lgpl2.1) + ("lgpl3" 'lgpl3) + ("knuth" 'knuth) + ("pd" 'public-domain) + ("bsd2" 'bsd-2) + ("bsd3" 'bsd-3) + ("bsd4" 'bsd-4) + ("opl" 'opl1.0+) + ("ofl" 'silofl1.1) + ("lppl" 'lppl) + ("lppl1" 'lppl1.0+) ; usually means "or later" + ("lppl1.2" 'lppl1.2+) ; usually means "or later" + ("lppl1.3" 'lppl1.3+) ; usually means "or later" + ("lppl1.3a" 'lppl1.3a) + ("lppl1.3b" 'lppl1.3b) + ("lppl1.3c" 'lppl1.3c) + ("cc-by-2" 'cc-by-2.0) + ("cc-by-3" 'cc-by-3.0) + ("cc-by-sa-2" 'cc-by-sa2.0) + ("cc-by-sa-3" 'cc-by-sa3.0) + ("mit" 'expat) + ("fdl" 'fdl1.3+) + ("gfl" 'gfl1.0) + + ;; These are known non-free licenses + ("noinfo" 'unknown) + ("nosell" 'non-free) + ("shareware" 'non-free) + ("nosource" 'non-free) + ("nocommercial" 'non-free) + ("cc-by-nc-nd-1" 'non-free) + ("cc-by-nc-nd-2" 'non-free) + ("cc-by-nc-nd-2.5" 'non-free) + ("cc-by-nc-nd-3" 'non-free) + ("cc-by-nc-nd-4" 'non-free) + ((x) (string->license x)) + ((lst ...) `(list ,@(map string->license lst))) + (_ #f))) + +(define (fetch-sxml name) + "Return an sxml representation of the package information contained in the +XML description of the CTAN package or #f in case of failure." + ;; This API always returns the latest release of the module. + (let ((url (string-append "http://www.ctan.org/xml/1.2/pkg/" name))) + (guard (c ((http-get-error? c) + (format (current-error-port) + "error: failed to retrieve package information \ +from ~s: ~a (~s)~%" + (uri->string (http-get-error-uri c)) + (http-get-error-code c) + (http-get-error-reason c)) + #f)) + (xml->sxml (http-fetch url) + #:trim-whitespace? #t)))) + +(define (guix-name component name) + "Return a Guix package name for a given Texlive package NAME." + (string-append "texlive-" component "-" + (string-map (match-lambda + (#\_ #\-) + (#\. #\-) + (chr (char-downcase chr))) + name))) + +(define* (sxml->package sxml #:optional (component "latex")) + "Return the `package' s-expression for a Texlive package from the SXML +expression describing it." + (define (sxml-value path) + (match ((sxpath path) sxml) + (() #f) + ((val) val))) + (with-store store + (let* ((id (sxml-value '(entry @ id *text*))) + (synopsis (sxml-value '(entry caption *text*))) + (version (or (sxml-value '(entry version @ number *text*)) + (sxml-value '(entry version @ date *text*)))) + (license (string->license (sxml-value '(entry license @ type *text*)))) + (home-page (string-append "http://www.ctan.org/pkg/" id)) + (ref (texlive-ref component id)) + (checkout (download-svn-to-store store ref))) + `(package + (name ,(guix-name component id)) + (version ,version) + (source (origin + (method svn-fetch) + (uri (texlive-ref ,component ,id)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (let-values (((port get-hash) (open-sha256-port))) + (write-file checkout port) + (force-output port) + (get-hash))))))) + (build-system texlive-build-system) + (arguments ,`(,'quote (#:tex-directory ,(string-join (list component id) "/")))) + (home-page ,home-page) + (synopsis ,synopsis) + (description ,(string-trim-both + (string-join + (map string-trim-both + (string-split + (beautify-description + (sxml->string (or (sxml-value '(entry description)) + '()))) + #\newline))))) + (license ,license))))) + +(define texlive->guix-package + (memoize + (lambda* (package-name #:optional (component "latex")) + "Fetch the metadata for PACKAGE-NAME from REPO and return the `package' +s-expression corresponding to that package, or #f on failure." + (and=> (fetch-sxml package-name) + (cut sxml->package <> component))))) + +;;; ctan.scm ends here diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 203cda8049..9bba074e8c 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -74,7 +74,7 @@ (define %standard-import-options '()) ;;; (define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" "gem" - "cran" "crate")) + "cran" "crate" "texlive")) (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/texlive.scm b/guix/scripts/import/texlive.scm new file mode 100644 index 0000000000..1cceee7051 --- /dev/null +++ b/guix/scripts/import/texlive.scm @@ -0,0 +1,101 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ricardo Wurmus +;;; +;;; 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 (guix scripts import texlive) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import texlive) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-texlive)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '()) + +(define (show-help) + (display (G_ "Usage: guix import texlive PACKAGE-NAME +Import and convert the Texlive package for PACKAGE-NAME.\n")) + (display (G_ " + -a, --archive=ARCHIVE specify the archive repository")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import texlive"))) + (option '(#\a "archive") #t #f + (lambda (opt name arg result) + (alist-cons 'component arg + (alist-delete 'component result)))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-texlive . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (let ((sexp (texlive->guix-package package-name + (or (assoc-ref opts 'component) + "latex")))) + (unless sexp + (leave (G_ "failed to download description for package '~a'~%") + package-name)) + sexp)) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) diff --git a/tests/texlive.scm b/tests/texlive.scm new file mode 100644 index 0000000000..e28eda175c --- /dev/null +++ b/tests/texlive.scm @@ -0,0 +1,115 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Ricardo Wurmus +;;; +;;; 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 (test-texlive) + #:use-module (gnu packages tex) + #:use-module (guix import texlive) + #:use-module (guix tests) + #:use-module (guix build utils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-64) + #:use-module (srfi srfi-26) + #:use-module (ice-9 match)) + +(test-begin "texlive") + +(define xml + "\ + + foo + Foomatic frobnication in LuaLaTeX + + + + +

+ Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals + in a foomatic way with the LuaTeX engine. +

+

+ The package requires the bar and golly + bundles for extremely special specialties. +

+
+ + + + null +
") + +(define sxml + '(*TOP* (entry (@ (id "foo")) + (name "foo") + (caption "Foomatic frobnication in LuaLaTeX") + (authorref (@ (id "rekado"))) + (license (@ (type "lppl1.3"))) + (version (@ (number "2.6a"))) + (description + (p "\n Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals\n in a foomatic way with the LuaTeX engine.\n ") + (p "\n The package requires the bar and golly\n bundles for extremely special specialties.\n ")) + (ctan (@ (path "/macros/latex/contrib/foo") (file "true"))) + (texlive (@ (location "foo"))) + (keyval (@ (value "tests") (key "topic"))) + "\n null\n"))) + +(test-equal "fetch-sxml: returns SXML for valid XML" + sxml + (mock ((guix http-client) http-fetch + (lambda (url) + xml)) + ((@@ (guix import texlive) fetch-sxml) "foo"))) + +;; TODO: +(test-assert "sxml->package" + ;; Replace network resources with sample data. + (mock ((guix build svn) svn-fetch + (lambda* (url revision directory + #:key (svn-command "svn") + (user-name #f) + (password #f)) + (mkdir-p directory) + (with-output-to-file (string-append directory "/foo") + (lambda () + (display "source"))))) + (let ((result ((@@ (guix import texlive) sxml->package) sxml))) + (match result + (('package + ('name "texlive-latex-foo") + ('version "2.6a") + ('source ('origin + ('method 'svn-fetch) + ('uri ('texlive-ref "latex" "foo")) + ('sha256 + ('base32 + (? string? hash))))) + ('build-system 'texlive-build-system) + ('arguments ('quote (#:tex-directory "latex/foo"))) + ('home-page "http://www.ctan.org/pkg/foo") + ('synopsis "Foomatic frobnication in LuaLaTeX") + ('description + "Foo is a package for LuaLaTeX. It provides an interface to \ +frobnicate gimbals in a foomatic way with the LuaTeX engine. The package \ +requires the bar and golly bundles for extremely special specialties.") + ('license 'lppl1.3+)) + #t) + (_ + (begin + (format #t "~s\n" result) + (pk 'fail result #f))))))) + +(test-end "texlive") -- cgit v1.2.3 From 2f0c4b82843ab41793b675267ede13c169399f86 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 16 Jun 2017 09:55:00 +0200 Subject: doc: Explain how to use the GCC toolchain. * doc/guix.texi (Application Setup): Add subsection "The GCC toolchain". --- doc/guix.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 97fa1b7864..cb5821e698 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1441,6 +1441,30 @@ some reason, you want to avoid auto-loading Emacs packages installed with Guix, you can do so by running Emacs with @code{--no-site-file} option (@pxref{Init File,,, emacs, The GNU Emacs Manual}). +@subsection The GCC toolchain + +@cindex GCC +@cindex ld-wrapper + +Guix offers individual compiler packages such as @code{gcc} but if you +are in need of a complete toolchain for compiling and linking source +code what you really want is the @code{gcc-toolchain} package. This +package provides a complete GCC toolchain for C/C++ development, +including GCC itself, the GNU C Library (headers and binaries, plus +debugging symbols in the @code{debug} output), Binutils, and a linker +wrapper. + +@cindex attempt to use impure library, error message + +The wrapper's purpose is to inspect the @code{-L} and @code{-l} switches +passed to the linker, add corresponding @code{-rpath} arguments, and +invoke the actual linker with this new set of arguments. By default, +the linker wrapper refuses to link to libraries outside the store to +ensure ``purity''. This can be annoying when using the toolchain to +link with local libraries. To allow references to libraries outside the +store you need to define the environment variable +@code{GUIX_LD_WRAPPER_ALLOW_IMPURITIES}. + @c TODO What else? @c ********************************************************************* -- cgit v1.2.3 From c8f54f5346ef32c56cd2190ec0aff1b07ff13973 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 17 Jun 2017 01:05:02 -0400 Subject: doc: Clarify comment about QEMU qcow2 file sizes. * doc/guix.texi (Installing GuixSD in a Virtual Machine): Clarify comment about QEMU's qcow2 virtualized block device file format. --- doc/guix.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index cb5821e698..db0e2fbd78 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7799,7 +7799,8 @@ qcow2-formatted disk image, use the @command{qemu-img} command: qemu-img create -f qcow2 guixsd.img 5G @end example -This will create a 5GB file. +The resulting file will be much smaller than 5GB, but it will grow as +the virtualized storage device is filled up. @item Boot the USB installation image in an VM: -- cgit v1.2.3 From 01049bb0c1f3f69afb8d1782f99ca5c0adaed946 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 17 Jun 2017 01:13:13 -0400 Subject: doc: Suggest a QEMU image size large enough for the system examples. * doc/guix.texi (Installing GuixSD in a Virtual Machine): Increase suggested image size from 5 GB to 50 GB. --- doc/guix.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index db0e2fbd78..4933a98ddb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7796,11 +7796,11 @@ Create a disk image that will hold the installed system. To make a qcow2-formatted disk image, use the @command{qemu-img} command: @example -qemu-img create -f qcow2 guixsd.img 5G +qemu-img create -f qcow2 guixsd.img 50G @end example -The resulting file will be much smaller than 5GB, but it will grow as -the virtualized storage device is filled up. +The resulting file will be much smaller than 50 GB (typically less than +1 MB), but it will grow as the virtualized storage device is filled up. @item Boot the USB installation image in an VM: -- cgit v1.2.3