mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-07-08 04:34:05 +02:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88c2e2349a | |||
| 3bf155b888 | |||
| a40cc32ae8 | |||
| 1691a4458c | |||
| e32c098f5d | |||
| 4ea1538dd7 | |||
| 10527dac08 | |||
| f492b57306 | |||
| 9b3c194c2d | |||
| bba1e723b0 | |||
| 47d554602c | |||
| aaf86bbe1f | |||
| 889fe96307 | |||
| efc8489651 | |||
| 989a3916dc | |||
| 8e2f32cee9 | |||
| b77b4c7c3a | |||
| d7d049fdcd | |||
| 495c50008b | |||
| 9b6703eabe | |||
| a8f9579348 | |||
| 2d4d26769d | |||
| 239bfe2ec1 | |||
| b1aef25453 | |||
| 047ae5c345 | |||
| 2cf16f2c31 | |||
| 09b984b77d | |||
| 6dbdb5fcf5 | |||
| 7866294e32 | |||
| 61b7e96877 | |||
| 1ab48edb16 | |||
| b129026e2e | |||
| 591af24ade | |||
| 556520a33c | |||
| 755c4b496e | |||
| 0406df0b9b | |||
| 416a691cff | |||
| 156a881001 | |||
| 93d37985da | |||
| 883aa80b45 | |||
| 754a7660a1 | |||
| a420b4f34e | |||
| a508b5c778 | |||
| e45c83c397 | |||
| fe563a87ad | |||
| 9ad14196ce | |||
| 6232959311 | |||
| f59aa79ca3 | |||
| 2493de0d1a | |||
| ba4aed0f1f | |||
| aeecd06ab9 | |||
| 43e18fd6c6 | |||
| e692cb6035 | |||
| 241772d5c0 | |||
| 29a09fa5e4 | |||
| 41407fda7a | |||
| 90612b9f1f | |||
| 7ef490e3fc | |||
| 1b06e77108 | |||
| 047425a662 | |||
| 883fefe160 |
@@ -426,6 +426,7 @@ AUX_FILES = \
|
||||
gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
|
||||
gnu/packages/aux-files/pack-audit.c \
|
||||
gnu/packages/aux-files/python/sanity-check.py \
|
||||
gnu/packages/aux-files/python/sanity-check-next.py \
|
||||
gnu/packages/aux-files/python/sitecustomize.py \
|
||||
gnu/packages/aux-files/renpy/renpy.in \
|
||||
gnu/packages/aux-files/run-in-namespace.c
|
||||
|
||||
@@ -34,6 +34,7 @@ Please send Guix bug reports to bug-guix@gnu.org.
|
||||
*** ‘guix shell’ has a new ‘--emulate-fhs’ option
|
||||
*** ‘guix shell’ has a new ‘--symlink’ option
|
||||
*** ‘--with-commit’ option now accepts strings returned by ‘git describe’
|
||||
*** ‘--with-source’ option now applied recursively
|
||||
*** Align tabular data output by commands like ‘guix package --list-available’
|
||||
*** Improved ‘guix import go’ importer via a new PEG parser
|
||||
*** Improved Software Heritage downloader
|
||||
@@ -52,6 +53,7 @@ Please send Guix bug reports to bug-guix@gnu.org.
|
||||
*** GNOME is now at version 42
|
||||
*** TeX Live is now at version 2021
|
||||
*** Multiple TeX Live trees can now be used via GUIX_TEXMF
|
||||
*** Python modules are searched in GUIX_PYTHONPATH instead of PYTHONPATH
|
||||
*** Python is now faster thanks to being built with optimizations
|
||||
*** The Rust bootstrap now starts from 1.54 instead of 1.19
|
||||
*** Most Python 2 packages have been removed
|
||||
@@ -78,9 +80,28 @@ Please send Guix bug reports to bug-guix@gnu.org.
|
||||
*** The init RAM disk honors more arguments—e.g. ‘root’ and ‘rootflags’
|
||||
*** ‘guix system image’ can now generate WSL images
|
||||
*** The mcron task scheduler logs now contain the jobs exit statuses
|
||||
*** Chromium extensions are now built in a deterministic fashion
|
||||
*** The ‘rsync’ service lets you specify individual “modules”
|
||||
*** New services
|
||||
|
||||
anonip, bitmask, fail2ban, gitile, greetd, jami, lightdm, log-cleanup,
|
||||
nar-herder, opendht, rasdaemon, samba, seatd, strongswan, wsdd
|
||||
|
||||
*** 5311 new packages
|
||||
|
||||
*** 6573 package updates
|
||||
|
||||
Noteworthy updates:
|
||||
bash 5.1.8, binutils 2.37, clojure 1.11.1, cups 2.3.3op2, emacs 28.2,
|
||||
enlightenment 0.25.4, gcc-toolchain 12.2.0, gdb 12.1, ghc 8.10.7,
|
||||
gimp 2.10.32, glibc 2.33, gnome 42.4, gnupg 2.2.32, go 1.19.1, guile 3.0.8,
|
||||
icecat 102.5.0-guix0-preview1, icedtea 3.19.0, inkscape 1.2.1, julia 1.6.7,
|
||||
libreoffice 7.4.3.2, linux-libre 6.0.10, ocaml 4.14.0, octave 7.2.0,
|
||||
openjdk 18, perl 5.34.0, python2 2.7.18, python 3.9.9, racket 8.7,
|
||||
rust 1.60.0, r 4.2.2, sbcl 2.2.10, shepherd 0.9.3, xorg-server 21.1.4
|
||||
|
||||
** Programming interfaces
|
||||
*** Package input fields can now plain package lists
|
||||
*** Package input fields can now be plain package lists
|
||||
*** G-expressions can now be used in build phases
|
||||
*** New ‘modify-inputs’ macro to ease customizing a list of package inputs
|
||||
*** New ‘this-package-input’ and ‘this-package-native-input’ macros
|
||||
@@ -90,7 +111,7 @@ Please send Guix bug reports to bug-guix@gnu.org.
|
||||
*** ‘texlive-union’ is now deprecated in favor of ‘texlive-updmap.cfg’
|
||||
*** New (guix cpu) module
|
||||
*** New (guix least-authority) module
|
||||
*** New (guix plaform) module
|
||||
*** New (guix platform) module
|
||||
*** New (guix read-print) module
|
||||
|
||||
It provides a comment-preserving reader and a comment-preserving
|
||||
@@ -101,11 +122,14 @@ pretty-printer smarter than (ice-9 pretty-print).
|
||||
This build system lets you build Guix instances from channel specifications,
|
||||
similar to how 'guix time-machine' would do it, as regular packages.
|
||||
|
||||
*** New ‘pyproject-build-system’
|
||||
|
||||
This is an extension of ‘python-build-system’ with support for PEP-517 and
|
||||
‘pyproject.toml’ files. It may eventually get merged back into
|
||||
‘python-build-system’.
|
||||
|
||||
*** New ‘elm-build-system’
|
||||
*** New ‘rebar-build-system’
|
||||
*** New services
|
||||
anonip, bitmask, fail2ban, gitile, greetd, jami, lightdm, log-cleanup,
|
||||
nar-herder, opendht, rasdaemon, samba, seatd, strongswan, wsdd
|
||||
|
||||
** Noteworthy bug fixes
|
||||
*** Fall back to Software Heritage when cloning a channel
|
||||
@@ -120,7 +144,6 @@ nar-herder, opendht, rasdaemon, samba, seatd, strongswan, wsdd
|
||||
(<https://issues.guix.gnu.org/51425>)
|
||||
*** Fonts can now be discovered in any profile via XDG_DATA_DIRS
|
||||
(<https://issues.guix.gnu.org/31403>)
|
||||
*** Python modules are searched in GUIX_PYTHONPATH instead of PYTHONPATH
|
||||
*** Various Python reproducibility fixes
|
||||
*** The installer now supports MSDOS disk labels on UEFI systems
|
||||
(<https://issues.guix.gnu.org/47889>)
|
||||
@@ -128,10 +151,10 @@ nar-herder, opendht, rasdaemon, samba, seatd, strongswan, wsdd
|
||||
(<https://issues.guix.gnu.org/48419>)
|
||||
*** The installer no longer crashes when deleting a free space partition
|
||||
*** Emacs handles major upgrades better without a re-login
|
||||
(<https://bugs.gnu.org/47458>)
|
||||
(<https://issues.guix.gnu.org/47458>)
|
||||
*** The bootloader configuration now accepts multiple targets
|
||||
(<https://issues.guix.gnu.org/40997>.)
|
||||
*** A file system mount point is always created when ‘create?’ is true
|
||||
(<https://issues.guix.gnu.org/40997>)
|
||||
*** File system mount point is always created when ‘create?’ is true
|
||||
(<https://issues.guix.gnu.org/40158>)
|
||||
*** Build the man database only if ‘man-db’ is in the profile
|
||||
*** gdk-pixbuf now discovers pixbuf loaders via a search path
|
||||
@@ -142,10 +165,12 @@ nar-herder, opendht, rasdaemon, samba, seatd, strongswan, wsdd
|
||||
(https://issues.guix.gnu.org/38838)
|
||||
*** ‘chfn’ can now change the user's full name
|
||||
(https://issues.guix.gnu.org/52539)
|
||||
*** Gnome settings Bluetooth panel is now working
|
||||
*** GNOME Settings Bluetooth panel is now working
|
||||
(https://issues.guix.gnu.org/32166)
|
||||
*** Inferiors are now caching store connections
|
||||
(https://issues.guix.gnu.org/48007)
|
||||
*** Retry downloads when a substitute has become unavailable
|
||||
(https://issues.guix.gnu.org/57978)
|
||||
*** The installer doesn't segfault when removing an extended partition
|
||||
*** The installer doesn't ship an older Guix revision
|
||||
(https://issues.guix.gnu.org/53210)
|
||||
|
||||
+214
-20
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2019-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2019-2025 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
|
||||
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||
;;;
|
||||
@@ -34,6 +34,7 @@
|
||||
(guix profiles)
|
||||
(guix utils)
|
||||
(git)
|
||||
(gnu packages)
|
||||
(gnu packages base)
|
||||
(gnu packages compression)
|
||||
(gnu packages gawk)
|
||||
@@ -52,8 +53,116 @@
|
||||
(define file-append*
|
||||
(@@ (guix self) file-append*))
|
||||
|
||||
(define translated-texi-manuals
|
||||
(@@ (guix self) translate-texi-manuals))
|
||||
(define (translated-texi-manuals source)
|
||||
"Return the translated texinfo manuals built from SOURCE."
|
||||
(define po4a
|
||||
(specification->package "po4a"))
|
||||
|
||||
(define gettext-minimal
|
||||
(specification->package "gettext-minimal"))
|
||||
|
||||
(define documentation
|
||||
(file-append* source "doc"))
|
||||
|
||||
(define documentation-po
|
||||
(file-append* source "po/doc"))
|
||||
|
||||
(define build
|
||||
(with-imported-modules '((guix build utils) (guix build po))
|
||||
#~(begin
|
||||
(use-modules (guix build utils) (guix build po)
|
||||
(ice-9 match) (ice-9 regex) (ice-9 textual-ports)
|
||||
(ice-9 vlist) (ice-9 threads)
|
||||
(srfi srfi-1))
|
||||
|
||||
(define (translate-tmp-texi po source output)
|
||||
"Translate Texinfo file SOURCE using messages from PO, and write
|
||||
the result to OUTPUT."
|
||||
(invoke #+(file-append po4a "/bin/po4a-translate")
|
||||
"-M" "UTF-8" "-L" "UTF-8" "-k" "0" "-f" "texinfo"
|
||||
"-m" source "-p" po "-l" output))
|
||||
|
||||
(define (canonicalize-whitespace str)
|
||||
;; Change whitespace (newlines, etc.) in STR to #\space.
|
||||
(string-map (lambda (chr)
|
||||
(if (char-set-contains? char-set:whitespace chr)
|
||||
#\space
|
||||
chr))
|
||||
str))
|
||||
|
||||
(define* (translate-texi prefix po lang
|
||||
#:key (extras '()))
|
||||
"Translate the manual for one language LANG using the PO file.
|
||||
PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRAS is
|
||||
a list of extra files, such as '(\"contributing\")."
|
||||
(for-each (lambda (file)
|
||||
(translate-tmp-texi po (string-append file ".texi")
|
||||
(string-append file "." lang
|
||||
".texi.tmp")))
|
||||
(cons prefix extras))
|
||||
|
||||
(for-each (lambda (file)
|
||||
(let* ((texi (string-append file "." lang ".texi"))
|
||||
(tmp (string-append texi ".tmp")))
|
||||
(copy-file tmp texi)
|
||||
(translate-cross-references texi po)))
|
||||
(cons prefix extras)))
|
||||
|
||||
(define (available-translations directory domain)
|
||||
;; Return the list of available translations under DIRECTORY for
|
||||
;; DOMAIN, a gettext domain such as "guix-manual". The result is
|
||||
;; a list of language/PO file pairs.
|
||||
(filter-map (lambda (po)
|
||||
(let ((base (basename po)))
|
||||
(and (string-prefix? (string-append domain ".")
|
||||
base)
|
||||
(match (string-split base #\.)
|
||||
((_ ... lang "po")
|
||||
(cons lang po))))))
|
||||
(find-files directory
|
||||
"\\.[a-z]{2}(_[A-Z]{2})?\\.po$")))
|
||||
|
||||
(define parallel-jobs
|
||||
;; Limit thread creation by 'n-par-for-each', mostly to put an
|
||||
;; upper bound on memory usage.
|
||||
(min (parallel-job-count) 4))
|
||||
|
||||
(mkdir #$output)
|
||||
(copy-recursively #$documentation "."
|
||||
#:log (%make-void-port "w"))
|
||||
|
||||
(for-each
|
||||
(lambda (file)
|
||||
(copy-file file (basename file)))
|
||||
(find-files #$documentation-po ".*.po$"))
|
||||
|
||||
(setenv "GUIX_LOCPATH"
|
||||
#+(file-append glibc-utf8-locales "/lib/locale"))
|
||||
(setenv "PATH" #+(file-append gettext-minimal "/bin"))
|
||||
(setenv "LC_ALL" "en_US.UTF-8")
|
||||
(setlocale LC_ALL "en_US.UTF-8")
|
||||
|
||||
(n-par-for-each parallel-jobs
|
||||
(match-lambda
|
||||
((language . po)
|
||||
(translate-texi "guix" po language
|
||||
#:extras '("contributing"))))
|
||||
(available-translations "." "guix-manual"))
|
||||
|
||||
(n-par-for-each parallel-jobs
|
||||
(match-lambda
|
||||
((language . po)
|
||||
(translate-texi "guix-cookbook" po language)))
|
||||
(available-translations "." "guix-cookbook"))
|
||||
|
||||
(for-each (lambda (file)
|
||||
(install-file file #$output))
|
||||
(append
|
||||
(find-files "." "contributing\\..*\\.texi$")
|
||||
(find-files "." "guix\\..*\\.texi$")
|
||||
(find-files "." "guix-cookbook\\..*\\.texi$"))))))
|
||||
|
||||
(computed-file "guix-translated-texinfo" build))
|
||||
|
||||
(define info-manual
|
||||
(@@ (guix self) info-manual))
|
||||
@@ -78,6 +187,10 @@
|
||||
%cookbook-languages
|
||||
%manual-languages))
|
||||
|
||||
(define %latest-guix-version
|
||||
;; Latest released version.
|
||||
"1.4.0")
|
||||
|
||||
(define (texinfo-manual-images source)
|
||||
"Return a directory containing all the images used by the user manual, taken
|
||||
from SOURCE, the root of the source tree."
|
||||
@@ -184,11 +297,16 @@ as well as images, OS examples, and translations."
|
||||
(define %web-site-url
|
||||
;; URL of the web site home page.
|
||||
(or (getenv "GUIX_WEB_SITE_URL")
|
||||
"/software/guix/"))
|
||||
"/"))
|
||||
|
||||
(define %manual-css-url
|
||||
;; URL of the main CSS file.
|
||||
(in-vicinity %web-site-url
|
||||
"themes/initial/css/manual.css"))
|
||||
|
||||
(define %makeinfo-html-options
|
||||
;; Options passed to 'makeinfo --html'.
|
||||
'("--css-ref=https://www.gnu.org/software/gnulib/manual.css"
|
||||
`(,(string-append "--css-ref=" %manual-css-url)
|
||||
"-c" "EXTRA_HEAD=<meta name=\"viewport\" \
|
||||
content=\"width=device-width, initial-scale=1\" />"))
|
||||
|
||||
@@ -284,6 +402,9 @@ actual file name."
|
||||
(loop rest))
|
||||
((('strong _ ...) _ ...)
|
||||
#t)
|
||||
((('span ('@ ('class "category")) ;raw Texinfo 6.8
|
||||
(? string-or-entity?) ...) rest ...)
|
||||
#t)
|
||||
((('span ('@ ('class "symbol-definition-category"))
|
||||
(? string-or-entity?) ...) rest ...)
|
||||
#t)
|
||||
@@ -507,10 +628,16 @@ its <pre class=\"lisp\"> blocks (as produced by 'makeinfo --html')."
|
||||
|
||||
;; Replace the ugly <strong> used for @deffn etc., which
|
||||
;; translate to <dt>, with more stylable markup.
|
||||
(('dt (@ ('id id)) category ... ('strong thing))
|
||||
(('dt ('@ ('id id)) ;raw Texinfo 6.8
|
||||
('span ('@ ('class "category")) category ...)
|
||||
('span ('strong thing)
|
||||
anchor))
|
||||
(highlight-definition id category thing '()))
|
||||
(('dt (@ ('id id)) category ... ('strong thing)
|
||||
(? space?) ('em args ...))
|
||||
(('dt (@ ('id id))
|
||||
('span ('@ ('class "category")) category ...)
|
||||
('span ('strong thing)
|
||||
(? space?) ('em args ...)
|
||||
anchor))
|
||||
(highlight-definition id category thing args))
|
||||
|
||||
((tag ('@ attributes ...) body ...)
|
||||
@@ -613,9 +740,10 @@ its <pre class=\"lisp\"> blocks (as produced by 'makeinfo --html')."
|
||||
|
||||
(define* (stylized-html source input
|
||||
#:key
|
||||
(latest-version %latest-guix-version)
|
||||
(languages %languages)
|
||||
(manual %manual)
|
||||
(manual-css-url "/static/base/css/manual.css"))
|
||||
(manual-css-url %manual-css-url))
|
||||
"Process all the HTML files in INPUT; add them MANUAL-CSS-URL as a <style>
|
||||
link, and add a menu to choose among LANGUAGES. Use the Guix PO files found
|
||||
in SOURCE."
|
||||
@@ -661,6 +789,14 @@ in SOURCE."
|
||||
(href ,url))
|
||||
,label)))
|
||||
|
||||
(define menu-item-separator
|
||||
;; Thin horizontal line to separate drop-down menu items.
|
||||
`(img (@ (class "hline")
|
||||
(src ,(in-vicinity
|
||||
#$%web-site-url
|
||||
"themes/initial/img/h-separator.png"))
|
||||
(alt ""))))
|
||||
|
||||
(define* (navigation-bar menus #:key split-node?)
|
||||
;; Return the navigation bar showing all of MENUS.
|
||||
`(header (@ (class "navbar"))
|
||||
@@ -707,7 +843,43 @@ in SOURCE."
|
||||
"https://translate.fedoraproject.org/projects/guix/documentation-cookbook/"
|
||||
"https://translate.fedoraproject.org/projects/guix/documentation-manual/")))))
|
||||
|
||||
(define (stylized-html sxml file)
|
||||
(define (version-menu-items language split-node?)
|
||||
;; Return the menu items to select the version of the manual of
|
||||
;; the type of medium (PDF, split-node, etc.).
|
||||
(define language-extension
|
||||
(if (string=? language "en")
|
||||
""
|
||||
(string-append "." language)))
|
||||
|
||||
(define pdf-link
|
||||
(string-append (if split-node? "../" "")
|
||||
#$manual language-extension ".pdf"))
|
||||
|
||||
(define version-links
|
||||
(list (menu-item #$latest-version
|
||||
(string-append
|
||||
"/manual/" #$latest-version
|
||||
"/" language
|
||||
(if split-node? "/html_node" "")))
|
||||
(menu-item "development"
|
||||
(string-append
|
||||
"/manual/devel/" language
|
||||
(if split-node? "/html_node" "")))
|
||||
menu-item-separator))
|
||||
|
||||
(append (if (string=? #$manual "guix")
|
||||
version-links
|
||||
'())
|
||||
(list (if split-node?
|
||||
(menu-item "single page"
|
||||
(string-append "../" #$manual
|
||||
language-extension
|
||||
".html"))
|
||||
(menu-item "multiple pages"
|
||||
"html_node"))
|
||||
(menu-item "PDF" pdf-link))))
|
||||
|
||||
(define (stylized-html sxml file language)
|
||||
;; Return SXML, which was read from FILE, with additional
|
||||
;; styling.
|
||||
(define split-node?
|
||||
@@ -730,9 +902,16 @@ in SOURCE."
|
||||
;; TODO: Add "Contribute" menu, to report
|
||||
;; errors, etc.
|
||||
(list (menu-dropdown
|
||||
#:label "Version"
|
||||
#:items
|
||||
(version-menu-items language
|
||||
split-node?))
|
||||
(menu-dropdown
|
||||
#:label
|
||||
`(img (@ (alt "Language")
|
||||
(src "/static/base/img/language-picker.svg")))
|
||||
(src #$(in-vicinity
|
||||
%web-site-url
|
||||
"themes/initial/img/language-picker.svg"))))
|
||||
#:items
|
||||
(language-menu-items file)))
|
||||
#:split-node? split-node?)
|
||||
@@ -744,13 +923,13 @@ in SOURCE."
|
||||
((? string? str)
|
||||
str))))
|
||||
|
||||
(define (process-html file)
|
||||
(define (process-html file language)
|
||||
;; Parse FILE and add links to translations. Install the result
|
||||
;; to #$output.
|
||||
(format (current-error-port) "processing ~a...~%" file)
|
||||
(let* ((shtml (parameterize ((%strict-tokenizer? #t))
|
||||
(call-with-input-file file html->shtml)))
|
||||
(processed (stylized-html shtml file))
|
||||
(processed (stylized-html shtml file language))
|
||||
(base (string-drop file (string-length #$input)))
|
||||
(target (string-append #$output base)))
|
||||
(mkdir-p (dirname target))
|
||||
@@ -758,6 +937,15 @@ in SOURCE."
|
||||
(lambda (port)
|
||||
(write-shtml-as-html processed port)))))
|
||||
|
||||
(define (input-file-language file)
|
||||
;; Return the language code of FILE, an input file, as a string
|
||||
;; like "sv" or "zh-cn".
|
||||
(match (string-tokenize (string-drop file
|
||||
(string-length #$input))
|
||||
(char-set-complement
|
||||
(char-set #\/)))
|
||||
((language _ ...) language)))
|
||||
|
||||
;; Install a UTF-8 locale so we can process UTF-8 files.
|
||||
(setenv "GUIX_LOCPATH"
|
||||
#+(file-append glibc-utf8-locales "/lib/locale"))
|
||||
@@ -768,7 +956,8 @@ in SOURCE."
|
||||
(n-par-for-each (parallel-job-count)
|
||||
(lambda (file)
|
||||
(if (string-suffix? ".html" file)
|
||||
(process-html file)
|
||||
(let ((language (input-file-language file)))
|
||||
(process-html file language))
|
||||
;; Copy FILE as is to #$output.
|
||||
(let* ((base (string-drop file (string-length #$input)))
|
||||
(target (string-append #$output base)))
|
||||
@@ -835,7 +1024,8 @@ makeinfo OPTIONS."
|
||||
(let* ((texi (language->texi-file-name language))
|
||||
(opts `("--html"
|
||||
"-c" ,(string-append "TOP_NODE_UP_URL=/manual/"
|
||||
language)
|
||||
#$%latest-guix-version
|
||||
"/" language)
|
||||
#$@options
|
||||
,texi)))
|
||||
(format #t "building HTML manual for language '~a'...~%"
|
||||
@@ -903,11 +1093,11 @@ makeinfo OPTIONS."
|
||||
sed
|
||||
tar
|
||||
texinfo
|
||||
texlive-base
|
||||
texlive-scheme-basic
|
||||
texlive-bin ;for GUIX_TEXMF
|
||||
texlive-epsf
|
||||
texlive-fonts-ec
|
||||
texlive-tex-texinfo)))))
|
||||
texlive-ec
|
||||
texlive-texinfo)))))
|
||||
|
||||
(define build
|
||||
(with-imported-modules '((guix build utils))
|
||||
@@ -1293,6 +1483,7 @@ commit date (an integer)."
|
||||
(setenv "PATH"
|
||||
(string-append #+tar "/bin:"
|
||||
#+xz "/bin:"
|
||||
#+zstd "/bin:"
|
||||
#+texinfo "/bin"))
|
||||
(invoke "tar" "xf" #$(package-source guile))
|
||||
(mkdir-p (string-append #$output "/en/html_node"))
|
||||
@@ -1356,7 +1547,9 @@ by 'html-identifier-indexes'."
|
||||
|
||||
|
||||
(let* ((root (canonicalize-path
|
||||
(string-append (current-source-directory) "/..")))
|
||||
(string-append (or (current-source-directory)
|
||||
(string-append (getcwd) "/doc"))
|
||||
"/..")))
|
||||
(commit date (latest-commit+date root))
|
||||
(version (or (getenv "GUIX_MANUAL_VERSION")
|
||||
(string-take commit 7)))
|
||||
@@ -1403,7 +1596,8 @@ by 'html-identifier-indexes'."
|
||||
(merge-index-alists guix-split-node-indexes guile-split-node-indexes))
|
||||
|
||||
(format (current-error-port)
|
||||
"building manual from work tree around commit ~a, ~a~%"
|
||||
"building manual from work tree (~a) around commit ~a, ~a~%"
|
||||
root
|
||||
commit
|
||||
(let* ((time (make-time time-utc 0 date))
|
||||
(date (time-utc->date time)))
|
||||
|
||||
@@ -1089,11 +1089,16 @@ and then to browse them ``by hand'' using @code{car}, @code{cdr},
|
||||
notably the fact that it is hard to read, error-prone, and a hindrance
|
||||
to proper type error reports.
|
||||
|
||||
@findex define-record-type*
|
||||
@findex match-record
|
||||
@cindex pattern matching
|
||||
Guix code should define appropriate data types (for instance, using
|
||||
@code{define-record-type*}) rather than abuse lists. In addition, it
|
||||
should use pattern matching, via Guile’s @code{(ice-9 match)} module,
|
||||
especially when matching lists (@pxref{Pattern Matching,,, guile, GNU
|
||||
Guile Reference Manual}).
|
||||
Guile Reference Manual}); pattern matching for records is better done
|
||||
using @code{match-record} from @code{(guix records)}, which, unlike
|
||||
@code{match}, verifies field names at macro-expansion time.
|
||||
|
||||
@node Formatting Code
|
||||
@subsection Formatting Code
|
||||
@@ -1509,7 +1514,7 @@ that we can send the rest of the patches to.
|
||||
|
||||
@example
|
||||
$ git send-email outgoing/0000-cover-letter.patch -a \
|
||||
--to=guix-patches@@debbugs.gnu.org \
|
||||
--to=guix-patches@@gnu.org \
|
||||
$(etc/teams.scm cc-members ...)
|
||||
$ rm outgoing/0000-cover-letter.patch # we don't want to resend it!
|
||||
@end example
|
||||
|
||||
+11
-11
@@ -10,8 +10,8 @@
|
||||
@include version.texi
|
||||
|
||||
@c Identifier of the OpenPGP key used to sign tarballs and such.
|
||||
@set OPENPGP-SIGNING-KEY-ID 27D586A4F8900854329FF09F1260E46482E63562
|
||||
@set OPENPGP-SIGNING-KEY-URL https://sv.gnu.org/people/viewgpg.php?user_id=127547
|
||||
@set OPENPGP-SIGNING-KEY-ID 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
|
||||
@set OPENPGP-SIGNING-KEY-URL https://sv.gnu.org/people/viewgpg.php?user_id=15145
|
||||
|
||||
@c Base URL for downloads.
|
||||
@set BASE-URL https://ftp.gnu.org/gnu/guix
|
||||
@@ -22,7 +22,7 @@
|
||||
@set SUBSTITUTE-URLS https://@value{SUBSTITUTE-SERVER-1} https://@value{SUBSTITUTE-SERVER-2}
|
||||
|
||||
@copying
|
||||
Copyright @copyright{} 2012-2022 Ludovic Courtès@*
|
||||
Copyright @copyright{} 2012-2022, 2025 Ludovic Courtès@*
|
||||
Copyright @copyright{} 2013, 2014, 2016 Andreas Enge@*
|
||||
Copyright @copyright{} 2013 Nikita Karetnikov@*
|
||||
Copyright @copyright{} 2014, 2015, 2016 Alex Kost@*
|
||||
@@ -642,7 +642,7 @@ to join! @xref{Contributing}, for information about how you can help.
|
||||
|
||||
@quotation Note
|
||||
We recommend the use of this
|
||||
@uref{https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh,
|
||||
@uref{https://guix.gnu.org/install.sh,
|
||||
shell installer script} to install Guix on top of a running GNU/Linux system,
|
||||
thereafter called a @dfn{foreign distro}.@footnote{This section is concerned
|
||||
with the installation of the package manager, which can be done on top of a
|
||||
@@ -691,14 +691,14 @@ GNU@tie{}tar and Xz.
|
||||
@c Note duplicated from the ``Installation'' node.
|
||||
@quotation Note
|
||||
We recommend the use of this
|
||||
@uref{https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh,
|
||||
@uref{https://guix.gnu.org/install.sh,
|
||||
shell installer script}. The script automates the download, installation, and
|
||||
initial configuration steps described below. It should be run as the root
|
||||
user. As root, you can thus run this:
|
||||
|
||||
@example
|
||||
cd /tmp
|
||||
wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
|
||||
wget -O guix-install.sh https://guix.gnu.org/install.sh
|
||||
chmod +x guix-install.sh
|
||||
./guix-install.sh
|
||||
@end example
|
||||
@@ -11706,8 +11706,7 @@ This is the declarative counterpart of @code{text-file}.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} computed-file @var{name} @var{gexp} @
|
||||
[#:local-build? #t]
|
||||
[#:options '()]
|
||||
[#:local-build? #t] [#:options '()]
|
||||
Return an object representing the store item @var{name}, a file or
|
||||
directory computed by @var{gexp}. When @var{local-build?} is true (the
|
||||
default), the derivation is built locally. @var{options} is a list of
|
||||
@@ -39224,7 +39223,7 @@ $ qemu-system-x86_64 \
|
||||
-nic user,model=virtio-net-pci \
|
||||
-enable-kvm -m 2048 \
|
||||
-device virtio-blk,drive=myhd \
|
||||
-drive if=none,file=/tmp/qemu-image,id=myhd
|
||||
-drive if=none,file=guix-system-vm-image-@value{VERSION}.x86_64-linux.qcow2,id=myhd
|
||||
@end example
|
||||
|
||||
Here is what each of these options means:
|
||||
@@ -39260,8 +39259,9 @@ better performance than if it were emulating a complete disk drive. See the
|
||||
QEMU and KVM documentation for more info.
|
||||
|
||||
@item -drive if=none,file=/tmp/qemu-image,id=myhd
|
||||
Use our QCOW image, the @file{/tmp/qemu-image} file, as the backing
|
||||
store of the ``myhd'' drive.
|
||||
Use our QCOW image, the
|
||||
@file{guix-system-vm-image-@value{VERSION}.x86_64-linux.qcow2} file, as
|
||||
the backing store of the ``myhd'' drive.
|
||||
@end table
|
||||
|
||||
The default @command{run-vm.sh} script that is returned by an invocation of
|
||||
|
||||
+10
-4
@@ -1,7 +1,7 @@
|
||||
# htmlxref.cnf - reference file for free Texinfo manuals on the web.
|
||||
# Modified by Ludovic Courtès <ludo@gnu.org> for the GNU Guix manual.
|
||||
|
||||
htmlxrefversion=2022-08-04.13; # UTC
|
||||
htmlxrefversion=2026-01-19.09; # UTC
|
||||
|
||||
# Copyright 2010-2020, 2022 Free Software Foundation, Inc.
|
||||
#
|
||||
@@ -409,17 +409,21 @@ GUILE_GNOME = ${GS}/guile-gnome/docs
|
||||
|
||||
guile-gtk node ${GS}/guile-gtk/docs/guile-gtk/
|
||||
|
||||
guile-netlink mono https://git.lepiller.eu/guile-netlink/manual/manual.html
|
||||
|
||||
guile-rpc mono ${GS}/guile-rpc/manual/guile-rpc.html
|
||||
guile-rpc node ${GS}/guile-rpc/manual/html_node/
|
||||
|
||||
GUIX_ROOT = https://guix.gnu.org
|
||||
GUIX = ${GUIX_ROOT}/manual
|
||||
GUIX = ${GUIX_ROOT}/manual/1.4.0
|
||||
guix.de mono ${GUIX}/de/guix.de.html
|
||||
guix.de node ${GUIX}/de/html_node/
|
||||
guix.es mono ${GUIX}/es/guix.es.html
|
||||
guix.es node ${GUIX}/es/html_node/
|
||||
guix.fr mono ${GUIX}/fr/guix.fr.html
|
||||
guix.fr node ${GUIX}/fr/html_node/
|
||||
guix.pt_BR mono ${GUIX}/pt-br/guix.pt_BR.html
|
||||
guix.pt_BR node ${GUIX}/pt-br/html_node/
|
||||
guix.ru mono ${GUIX}/ru/guix.ru.html
|
||||
guix.ru node ${GUIX}/ru/html_node/
|
||||
guix.zh_CN mono ${GUIX}/zh-cn/guix.zh_CN.html
|
||||
@@ -428,10 +432,12 @@ GUIX = ${GUIX_ROOT}/manual
|
||||
guix node ${GUIX}/en/html_node/
|
||||
|
||||
GUIX_COOKBOOK = ${GUIX_ROOT}/cookbook
|
||||
guix-cookbook.de mono ${GUIX_COOKBOOK}/de/guix-cookbook.html
|
||||
guix-cookbook.de mono ${GUIX_COOKBOOK}/de/guix-cookbook.de.html
|
||||
guix-cookbook.de node ${GUIX_COOKBOOK}/de/html_node/
|
||||
guix-cookbook.fr mono ${GUIX_COOKBOOK}/fr/guix-cookbook.html
|
||||
guix-cookbook.fr mono ${GUIX_COOKBOOK}/fr/guix-cookbook.fr.html
|
||||
guix-cookbook.fr node ${GUIX_COOKBOOK}/fr/html_node/
|
||||
guix-cookbook.sk mono ${GUIX_COOKBOOK}/sk/guix-cookbook.sk.html
|
||||
guix-cookbook.sk node ${GUIX_COOKBOOK}/sk/html_node/
|
||||
guix-cookbook mono ${GUIX_COOKBOOK}/en/guix-cookbook.html
|
||||
guix-cookbook node ${GUIX_COOKBOOK}/en/html_node/
|
||||
|
||||
|
||||
+15
-7
@@ -492,14 +492,22 @@ sys_enable_guix_daemon()
|
||||
}
|
||||
|
||||
sys_authorize_build_farms()
|
||||
{ # authorize the public key of the build farm
|
||||
{ # authorize the public key(s) of the build farm(s)
|
||||
local hosts=(
|
||||
ci.guix.gnu.org
|
||||
bordeaux.guix.gnu.org
|
||||
)
|
||||
|
||||
if prompt_yes_no "Permit downloading pre-built package binaries from the \
|
||||
project's build farm?"; then
|
||||
guix archive --authorize \
|
||||
< ~root/.config/guix/current/share/guix/ci.guix.gnu.org.pub \
|
||||
&& _msg "${PAS}Authorized public key for ci.guix.gnu.org"
|
||||
else
|
||||
_msg "${INF}Skipped authorizing build farm public keys"
|
||||
project's build farms?"; then
|
||||
for host in "${hosts[@]}"; do
|
||||
local key=~root/.config/guix/current/share/guix/$host.pub
|
||||
[ -f "$key" ] \
|
||||
&& guix archive --authorize < "$key" \
|
||||
&& _msg "${PAS}Authorized public key for $host"
|
||||
done
|
||||
else
|
||||
_msg "${INF}Skipped authorizing build farm public keys"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
+21
-2
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013-2020, 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
|
||||
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||
;;;
|
||||
@@ -282,12 +282,31 @@ disk."
|
||||
(mount "/.rw-store" (%store-directory) "" MS_MOVE)
|
||||
(rmdir "/.rw-store")))
|
||||
|
||||
(define (umount* directory)
|
||||
"Unmount DIRECTORY, but retry a few times upon EBUSY."
|
||||
(let loop ((attempts 5))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(umount directory))
|
||||
(lambda args
|
||||
(if (and (= EBUSY (system-error-errno args))
|
||||
(> attempts 0))
|
||||
(begin
|
||||
(sleep 1)
|
||||
(loop (- attempts 1)))
|
||||
(apply throw args))))))
|
||||
|
||||
(define (unmount-cow-store target backing-directory)
|
||||
"Unmount copy-on-write store."
|
||||
(let ((tmp-dir "/remove"))
|
||||
(mkdir-p tmp-dir)
|
||||
(mount (%store-directory) tmp-dir "" MS_MOVE)
|
||||
(umount tmp-dir)
|
||||
|
||||
;; We might get EBUSY at this point, possibly because of lingering
|
||||
;; processes with open file descriptors. Use 'umount*' to retry upon
|
||||
;; EBUSY, leaving a bit of time. See <https://issues.guix.gnu.org/59884>.
|
||||
(umount* tmp-dir)
|
||||
|
||||
(rmdir tmp-dir)
|
||||
(delete-file-recursively
|
||||
(string-append target backing-directory))))
|
||||
|
||||
+29
-29
@@ -77,35 +77,35 @@ Each message is also prefixed by a timestamp by GNU Shepherd."))
|
||||
(define shepherd-schedule-action
|
||||
(@@ (gnu services mcron) shepherd-schedule-action))
|
||||
|
||||
(define home-mcron-shepherd-services
|
||||
(match-lambda
|
||||
(($ <home-mcron-configuration> mcron '()) ; no jobs to run
|
||||
'())
|
||||
(($ <home-mcron-configuration> mcron jobs log? log-format)
|
||||
(let ((files (job-files mcron jobs)))
|
||||
(list (shepherd-service
|
||||
(documentation "User cron jobs.")
|
||||
(provision '(mcron))
|
||||
(modules `((srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(ice-9 popen) ; for the 'schedule' action
|
||||
(ice-9 rdelim)
|
||||
(ice-9 match)
|
||||
,@%default-modules))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list (string-append #$mcron "/bin/mcron")
|
||||
#$@(if log?
|
||||
#~("--log" "--log-format" #$log-format)
|
||||
#~())
|
||||
#$@files)
|
||||
#:log-file (string-append
|
||||
(or (getenv "XDG_LOG_HOME")
|
||||
(format #f "~a/.local/var/log"
|
||||
(getenv "HOME")))
|
||||
"/mcron.log")))
|
||||
(stop #~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-schedule-action mcron files)))))))))
|
||||
(define (home-mcron-shepherd-services config)
|
||||
(match-record config <home-mcron-configuration>
|
||||
(mcron jobs log? log-format)
|
||||
(if (null? jobs)
|
||||
'() ;no jobs to run
|
||||
(let ((files (job-files mcron jobs)))
|
||||
(list (shepherd-service
|
||||
(documentation "User cron jobs.")
|
||||
(provision '(mcron))
|
||||
(modules `((srfi srfi-1)
|
||||
(srfi srfi-26)
|
||||
(ice-9 popen) ;for the 'schedule' action
|
||||
(ice-9 rdelim)
|
||||
(ice-9 match)
|
||||
,@%default-modules))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list (string-append #$mcron "/bin/mcron")
|
||||
#$@(if log?
|
||||
#~("--log" "--log-format" #$log-format)
|
||||
#~())
|
||||
#$@files)
|
||||
#:log-file (string-append
|
||||
(or (getenv "XDG_LOG_HOME")
|
||||
(format #f "~a/.local/var/log"
|
||||
(getenv "HOME")))
|
||||
"/mcron.log")))
|
||||
(stop #~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-schedule-action mcron files)))))))))
|
||||
|
||||
(define home-mcron-profile (compose list home-mcron-configuration-mcron))
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix records)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match)
|
||||
@@ -479,31 +480,30 @@ with text blocks from other extensions and the base service.")
|
||||
with text blocks from other extensions and the base service."))
|
||||
|
||||
(define (home-bash-extensions original-config extension-configs)
|
||||
(match original-config
|
||||
(($ <home-bash-configuration> _ _ environment-variables aliases
|
||||
bash-profile bashrc bash-logout)
|
||||
(home-bash-configuration
|
||||
(inherit original-config)
|
||||
(environment-variables
|
||||
(append environment-variables
|
||||
(append-map
|
||||
home-bash-extension-environment-variables extension-configs)))
|
||||
(aliases
|
||||
(append aliases
|
||||
(append-map
|
||||
home-bash-extension-aliases extension-configs)))
|
||||
(bash-profile
|
||||
(append bash-profile
|
||||
(append-map
|
||||
home-bash-extension-bash-profile extension-configs)))
|
||||
(bashrc
|
||||
(append bashrc
|
||||
(append-map
|
||||
home-bash-extension-bashrc extension-configs)))
|
||||
(bash-logout
|
||||
(append bash-logout
|
||||
(append-map
|
||||
home-bash-extension-bash-logout extension-configs)))))))
|
||||
(match-record original-config <home-bash-configuration>
|
||||
(environment-variables aliases bash-profile bashrc bash-logout)
|
||||
(home-bash-configuration
|
||||
(inherit original-config)
|
||||
(environment-variables
|
||||
(append environment-variables
|
||||
(append-map
|
||||
home-bash-extension-environment-variables extension-configs)))
|
||||
(aliases
|
||||
(append aliases
|
||||
(append-map
|
||||
home-bash-extension-aliases extension-configs)))
|
||||
(bash-profile
|
||||
(append bash-profile
|
||||
(append-map
|
||||
home-bash-extension-bash-profile extension-configs)))
|
||||
(bashrc
|
||||
(append bashrc
|
||||
(append-map
|
||||
home-bash-extension-bashrc extension-configs)))
|
||||
(bash-logout
|
||||
(append bash-logout
|
||||
(append-map
|
||||
home-bash-extension-bash-logout extension-configs))))))
|
||||
|
||||
(define home-bash-service-type
|
||||
(service-type (name 'home-bash)
|
||||
|
||||
+18
-18
@@ -383,25 +383,25 @@ configuration."
|
||||
(define (serialize-alist config)
|
||||
(generic-serialize-alist append format-config config))
|
||||
|
||||
(define (serialize-xdg-desktop-action action)
|
||||
(match action
|
||||
(($ <xdg-desktop-action> action name config)
|
||||
`(,(format #f "[Desktop Action ~a]\n"
|
||||
(string-capitalize (maybe-object->string action)))
|
||||
,(format #f "Name=~a\n" name)
|
||||
,@(serialize-alist config)))))
|
||||
(define (serialize-xdg-desktop-action desktop-action)
|
||||
(match-record desktop-action <xdg-desktop-action>
|
||||
(action name config)
|
||||
`(,(format #f "[Desktop Action ~a]\n"
|
||||
(string-capitalize (maybe-object->string action)))
|
||||
,(format #f "Name=~a\n" name)
|
||||
,@(serialize-alist config))))
|
||||
|
||||
(match entry
|
||||
(($ <xdg-desktop-entry> file name type config actions)
|
||||
(list (if (string-suffix? file ".desktop")
|
||||
file
|
||||
(string-append file ".desktop"))
|
||||
`("[Desktop Entry]\n"
|
||||
,(format #f "Name=~a\n" name)
|
||||
,(format #f "Type=~a\n"
|
||||
(string-capitalize (symbol->string type)))
|
||||
,@(serialize-alist config)
|
||||
,@(append-map serialize-xdg-desktop-action actions))))))
|
||||
(match-record entry <xdg-desktop-entry>
|
||||
(file name type config actions)
|
||||
(list (if (string-suffix? file ".desktop")
|
||||
file
|
||||
(string-append file ".desktop"))
|
||||
`("[Desktop Entry]\n"
|
||||
,(format #f "Name=~a\n" name)
|
||||
,(format #f "Type=~a\n"
|
||||
(string-capitalize (symbol->string type)))
|
||||
,@(serialize-alist config)
|
||||
,@(append-map serialize-xdg-desktop-action actions)))))
|
||||
|
||||
(define-configuration home-xdg-mime-applications-configuration
|
||||
(added
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#:use-module (guix utils)
|
||||
#:use-module (guix ui)
|
||||
#:use-module ((guix self) #:select (make-config.scm))
|
||||
#:use-module (guix describe)
|
||||
#:use-module (guix channels)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (gnu installer utils)
|
||||
@@ -52,6 +54,7 @@
|
||||
#:use-module (gnu system locale)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (web uri)
|
||||
#:export (installer-program))
|
||||
|
||||
(define module-to-import?
|
||||
@@ -315,6 +318,25 @@ selected keymap."
|
||||
((installer-final-page current-installer)
|
||||
result prev-steps))))))))
|
||||
|
||||
(define (provenance-sexp)
|
||||
"Return an sexp representing the currently-used channels, for logging
|
||||
purposes."
|
||||
(match (match (current-channels)
|
||||
(() (and=> (repository->guix-channel (dirname (current-filename)))
|
||||
list))
|
||||
(channels channels))
|
||||
(#f
|
||||
(warning (G_ "cannot determine installer provenance~%"))
|
||||
'unknown)
|
||||
((channels ...)
|
||||
(map (lambda (channel)
|
||||
(let* ((uri (string->uri (channel-url channel)))
|
||||
(url (if (or (not uri) (eq? 'file (uri-scheme uri)))
|
||||
"local checkout"
|
||||
(channel-url channel))))
|
||||
`(channel ,(channel-name channel) ,url ,(channel-commit channel))))
|
||||
channels))))
|
||||
|
||||
(define (installer-program)
|
||||
"Return a file-like object that runs the given INSTALLER."
|
||||
(define init-gettext
|
||||
@@ -429,6 +451,9 @@ selected keymap."
|
||||
(define current-installer newt-installer)
|
||||
(define steps (#$steps current-installer))
|
||||
|
||||
(installer-log-line "installer provenance: ~s"
|
||||
'#$(provenance-sexp))
|
||||
|
||||
(dynamic-wind
|
||||
(installer-init current-installer)
|
||||
(lambda ()
|
||||
|
||||
+24
-6
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -114,6 +114,8 @@ it can interact with the rest of the system."
|
||||
;; Catch SIGINT and kill the container process.
|
||||
(sigaction SIGINT
|
||||
(lambda (signum)
|
||||
;: FIXME: Use of SIGKILL prevents the dynamic-wind exit handler of
|
||||
;; THUNK to run.
|
||||
(false-if-exception
|
||||
(kill pid SIGKILL))))
|
||||
|
||||
@@ -196,14 +198,16 @@ or #f. Return #t on success and #f on failure."
|
||||
;; the loaded cow-store locale files will prevent umounting.
|
||||
(install-locale locale)
|
||||
|
||||
;; Save the database, so that it can be restored once the
|
||||
;; cow-store is umounted.
|
||||
;; Stop the daemon and save the database, so that it can be
|
||||
;; restored once the cow-store is umounted.
|
||||
(stop-service 'guix-daemon)
|
||||
(copy-file database-file saved-database)
|
||||
|
||||
(installer-log-line "mounting copy-on-write store")
|
||||
(mount-cow-store (%installer-target-dir) backing-directory))
|
||||
(lambda ()
|
||||
;; We need to drag the guix-daemon to the container MNT
|
||||
;; namespace, so that it can operate on the cow-store.
|
||||
(stop-service 'guix-daemon)
|
||||
(start-service 'guix-daemon (list (number->string (getpid))))
|
||||
|
||||
(setvbuf (current-output-port) 'none)
|
||||
@@ -213,11 +217,25 @@ or #f. Return #t on success and #f on failure."
|
||||
|
||||
(set! ret (run-command install-command #:tty? #t)))
|
||||
(lambda ()
|
||||
;; Restart guix-daemon so that it does no keep the MNT namespace
|
||||
;; Stop guix-daemon so that it does no keep the MNT namespace
|
||||
;; alive.
|
||||
(restart-service 'guix-daemon)
|
||||
(stop-service 'guix-daemon)
|
||||
|
||||
;; Restore the database and restart it. As part of restoring the
|
||||
;; database, remove the WAL and shm files in case they were left
|
||||
;; behind after guix-daemon was stopped. Failing to do so,
|
||||
;; sqlite might behave as if transactions that appear in the WAL
|
||||
;; file were committed. (See <https://www.sqlite.org/wal.html>.)
|
||||
(installer-log-line "restoring store database from '~a'"
|
||||
saved-database)
|
||||
(copy-file saved-database database-file)
|
||||
(for-each (lambda (suffix)
|
||||
(false-if-exception
|
||||
(delete-file (string-append database-file suffix))))
|
||||
'("-wal" "-shm"))
|
||||
(start-service 'guix-daemon)
|
||||
|
||||
;; Finally umount the cow-store and exit the container.
|
||||
(installer-log-line "unmounting copy-on-write store")
|
||||
(unmount-cow-store (%installer-target-dir) backing-directory)
|
||||
(assert-exit ret))))))))
|
||||
|
||||
@@ -116,7 +116,7 @@ report it by email to ~a.") uploaded-name %guix-bug-report-address)
|
||||
(define command-output "")
|
||||
(define (line-accumulator line)
|
||||
(set! command-output
|
||||
(string-append/shared command-output line "\n")))
|
||||
(string-append/shared command-output line)))
|
||||
(define result (run-external-command-with-line-hooks (list line-accumulator)
|
||||
args))
|
||||
(define exit-val (status:exit-val result))
|
||||
|
||||
@@ -379,12 +379,44 @@ fail. See rereadpt function in wipefs.c of util-linux for an explanation."
|
||||
(define %min-device-size
|
||||
(* 2 GIBIBYTE-SIZE)) ;2GiB
|
||||
|
||||
(define (mapped-device? device)
|
||||
"Return #true if DEVICE is a mapped device, false otherwise."
|
||||
(string-prefix? "/dev/dm-" device))
|
||||
|
||||
;; TODO: Use DM_TABLE_DEPS ioctl instead of dmsetup.
|
||||
(define (mapped-device-parent-partition device)
|
||||
"Return the parent partition path of the mapped DEVICE."
|
||||
(let* ((command `("dmsetup" "deps" ,device "-o" "devname"))
|
||||
(parent #f)
|
||||
(handler
|
||||
(lambda (input)
|
||||
;; We are parsing an output that should look like:
|
||||
;; 1 dependencies : (sda2)
|
||||
(let ((result
|
||||
(string-match "\\(([^\\)]+)\\)"
|
||||
(get-string-all input))))
|
||||
(and result
|
||||
(set! parent
|
||||
(format #f "/dev/~a"
|
||||
(match:substring result 1))))))))
|
||||
(run-external-command-with-handler handler command)
|
||||
parent))
|
||||
|
||||
(define (eligible-devices)
|
||||
"Return all the available devices except the install device and the devices
|
||||
which are smaller than %MIN-DEVICE-SIZE."
|
||||
|
||||
(define the-installer-root-partition-path
|
||||
(installer-root-partition-path))
|
||||
(let ((root (installer-root-partition-path)))
|
||||
(cond
|
||||
((mapped-device? root)
|
||||
;; If the partition is a mapped device (/dev/dm-X), locate the parent
|
||||
;; partition. It is the case when Ventoy is used to host the
|
||||
;; installation image.
|
||||
(let ((parent (mapped-device-parent-partition root)))
|
||||
(installer-log-line "mapped device ~a -> ~a" parent root)
|
||||
parent))
|
||||
(else root))))
|
||||
|
||||
(define (small-device? device)
|
||||
(let ((length (device-length device))
|
||||
|
||||
+14
-12
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -159,7 +159,9 @@ COMMAND will be run in a pseudoterminal. Returns the integer status value of
|
||||
the child process as returned by waitpid."
|
||||
(define (handler input)
|
||||
(and
|
||||
(and=> (get-line input)
|
||||
;; Lines for progress bars etc. end in \r; treat is as a line ending so
|
||||
;; those lines are printed right away.
|
||||
(and=> (read-delimited "\r\n" input 'concat)
|
||||
(lambda (line)
|
||||
(if (eof-object? line)
|
||||
#f
|
||||
@@ -186,7 +188,7 @@ in a pseudoterminal."
|
||||
|
||||
(installer-log-line "running command ~s" command)
|
||||
(define result (run-external-command-with-line-hooks
|
||||
(list %display-line-hook) command
|
||||
(list display) command
|
||||
#:tty? tty?))
|
||||
(define exit-val (status:exit-val result))
|
||||
(define term-sig (status:term-sig result))
|
||||
@@ -264,7 +266,10 @@ values."
|
||||
(or port (%make-void-port "w")))))
|
||||
|
||||
(define (%syslog-line-hook line)
|
||||
(format (syslog-port) "installer[~d]: ~a~%" (getpid) line))
|
||||
(let ((line (if (string-suffix? "\r" line)
|
||||
(string-append (string-drop-right line 1) "\n")
|
||||
line)))
|
||||
(format (syslog-port) "installer[~d]: ~a" (getpid) line)))
|
||||
|
||||
(define-syntax syslog
|
||||
(lambda (s)
|
||||
@@ -293,11 +298,7 @@ values."
|
||||
port)))
|
||||
|
||||
(define (%installer-log-line-hook line)
|
||||
(format (installer-log-port) "~a~%" line))
|
||||
|
||||
(define (%display-line-hook line)
|
||||
(display line)
|
||||
(newline))
|
||||
(display line (installer-log-port)))
|
||||
|
||||
(define %default-installer-line-hooks
|
||||
(list %syslog-line-hook
|
||||
@@ -309,9 +310,10 @@ values."
|
||||
(syntax-case s ()
|
||||
((_ fmt args ...)
|
||||
(string? (syntax->datum #'fmt))
|
||||
#'(let ((formatted (format #f fmt args ...)))
|
||||
(for-each (lambda (f) (f formatted))
|
||||
%default-installer-line-hooks))))))
|
||||
(with-syntax ((fmt (string-append (syntax->datum #'fmt) "\n")))
|
||||
#'(let ((formatted (format #f fmt args ...)))
|
||||
(for-each (lambda (f) (f formatted))
|
||||
%default-installer-line-hooks)))))))
|
||||
|
||||
|
||||
;;;
|
||||
|
||||
@@ -1472,6 +1472,15 @@ valuable enough at this time.")
|
||||
(("pip install")
|
||||
(string-append (search-input-file inputs "bin/pip")
|
||||
" install")))))
|
||||
(add-after 'link-depot 'fix-test-git-submodule
|
||||
;; Git v2.38.1 fixes security issues and changes the default
|
||||
;; behaviour of `git submodule`. This substitution is a backport
|
||||
;; of the upstream patch, not yet released, fixing the test suite.
|
||||
;; https://github.com/JuliaDocs/Documenter.jl/commit/b5a5c65d02d136743e7c18ffebf8baba900484fc
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "test/utilities.jl"
|
||||
(("submodule add")
|
||||
"-c protocol.file.allow=always submodule add"))))
|
||||
(add-after 'link-depot 'remove-javascript-downloads
|
||||
(lambda _
|
||||
(substitute* "src/Writers/HTMLWriter.jl"
|
||||
|
||||
@@ -164,9 +164,9 @@
|
||||
;; Latest version of Guix, which may or may not correspond to a release.
|
||||
;; Note: the 'update-guix-package.scm' script expects this definition to
|
||||
;; start precisely like this.
|
||||
(let ((version "1.3.0")
|
||||
(commit "682639c107908426fe6bf0a1b8404b98b7820290")
|
||||
(revision 32))
|
||||
(let ((version "1.4.0")
|
||||
(commit "8e2f32cee982d42a79e53fc1e9aa7b8ff0514714")
|
||||
(revision 0))
|
||||
(package
|
||||
(name "guix")
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
(commit commit)))
|
||||
(sha256
|
||||
(base32
|
||||
"1ap8hfq46ncp7azhdvc9s64a9q9y74xfqpgfwlcgz6sw82a09yh0"))
|
||||
"042mipw2bp9lc75m9g5q6rdifrp8483cmk57kwrdps0i3vd590dl"))
|
||||
(file-name (string-append "guix-" version "-checkout"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
%standard-phases)
|
||||
|
||||
;; XXX: Work around <https://issues.guix.gnu.org/59616>.
|
||||
#:tests? ,(not (hurd-target?))))
|
||||
#:tests? ,(and (not (hurd-target?))
|
||||
(not (%current-target-system)))))
|
||||
(inputs (list ncurses perl))
|
||||
;; When cross-compiling, texinfo will build some of its own binaries with
|
||||
;; the native compiler. This means ncurses is needed both in both inputs
|
||||
|
||||
+459
-445
File diff suppressed because it is too large
Load Diff
@@ -249,7 +249,7 @@ does not have a default value" field kind)))
|
||||
#'(field ...)
|
||||
#'(field-getter ...)
|
||||
#'(field-default ...))
|
||||
(%location #,(id #'stem #'stem #'-location)
|
||||
(%location #,(id #'stem #'stem #'-source-location)
|
||||
(default (and=> (current-source-location)
|
||||
source-properties->location))
|
||||
(innate)))
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
(let ((cuirass (cuirass-configuration-cuirass config))
|
||||
(cache-directory (cuirass-configuration-cache-directory config))
|
||||
(web-log-file (cuirass-configuration-web-log-file config))
|
||||
(log-file (cuirass-configuration-log-file config))
|
||||
(main-log-file (cuirass-configuration-log-file config))
|
||||
(user (cuirass-configuration-user config))
|
||||
(group (cuirass-configuration-group config))
|
||||
(interval (cuirass-configuration-interval config))
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
#:user #$user
|
||||
#:group #$group
|
||||
#:log-file #$log-file))
|
||||
#:log-file #$main-log-file))
|
||||
(stop #~(make-kill-destructor)))
|
||||
,(shepherd-service
|
||||
(documentation "Run Cuirass web interface.")
|
||||
|
||||
+11
-11
@@ -215,17 +215,6 @@ lines.")
|
||||
(parameter-alist '())
|
||||
"Extra options to include."))
|
||||
|
||||
(define (serialize-getmail-configuration-file field-name val)
|
||||
(match-record val <getmail-configuration-file>
|
||||
(retriever destination options)
|
||||
#~(string-append
|
||||
"[retriever]\n"
|
||||
#$(serialize-getmail-retriever-configuration #f retriever)
|
||||
"\n[destination]\n"
|
||||
#$(serialize-getmail-destination-configuration #f destination)
|
||||
"\n[options]\n"
|
||||
#$(serialize-getmail-options-configuration #f options))))
|
||||
|
||||
(define-configuration getmail-configuration-file
|
||||
(retriever
|
||||
(getmail-retriever-configuration (getmail-retriever-configuration))
|
||||
@@ -237,6 +226,17 @@ lines.")
|
||||
(getmail-options-configuration (getmail-options-configuration))
|
||||
"Configure getmail."))
|
||||
|
||||
(define (serialize-getmail-configuration-file field-name val)
|
||||
(match-record val <getmail-configuration-file>
|
||||
(retriever destination options)
|
||||
#~(string-append
|
||||
"[retriever]\n"
|
||||
#$(serialize-getmail-retriever-configuration #f retriever)
|
||||
"\n[destination]\n"
|
||||
#$(serialize-getmail-destination-configuration #f destination)
|
||||
"\n[options]\n"
|
||||
#$(serialize-getmail-options-configuration #f options))))
|
||||
|
||||
(define (serialize-symbol field-name val) "")
|
||||
(define (serialize-getmail-configuration field-name val) "")
|
||||
|
||||
|
||||
+12
-12
@@ -1,5 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2022 muradm <mail@muradm.net>
|
||||
;;; Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -351,28 +352,27 @@ provided as a list of file-like objects."))
|
||||
(match-record config <fail2ban-configuration>
|
||||
(fail2ban run-directory)
|
||||
(let* ((fail2ban-server (file-append fail2ban "/bin/fail2ban-server"))
|
||||
(fail2ban-client (file-append fail2ban "/bin/fail2ban-client"))
|
||||
(pid-file (in-vicinity run-directory "fail2ban.pid"))
|
||||
(socket-file (in-vicinity run-directory "fail2ban.sock"))
|
||||
(config-dir (file-append (config->fail2ban-etc-directory config)
|
||||
"/etc/fail2ban"))
|
||||
(fail2ban-action (lambda args
|
||||
#~(lambda _
|
||||
(invoke #$fail2ban-server
|
||||
"-c" #$config-dir
|
||||
"-p" #$pid-file
|
||||
"-s" #$socket-file
|
||||
"-b"
|
||||
#$@args)))))
|
||||
#~(invoke #$fail2ban-client #$@args))))
|
||||
|
||||
;; TODO: Add 'reload' action.
|
||||
;; TODO: Add 'reload' action (see 'fail2ban.service.in' in the source).
|
||||
(list (shepherd-service
|
||||
(provision '(fail2ban))
|
||||
(documentation "Run the fail2ban daemon.")
|
||||
(requirement '(user-processes))
|
||||
(modules `((ice-9 match)
|
||||
,@%default-modules))
|
||||
(start (fail2ban-action "start"))
|
||||
(stop (fail2ban-action "stop")))))))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list #$fail2ban-server
|
||||
"-c" #$config-dir "-s" #$socket-file
|
||||
"-p" #$pid-file "-xf" "start")
|
||||
#:pid-file #$pid-file))
|
||||
(stop #~(lambda (_)
|
||||
#$(fail2ban-action "stop")
|
||||
#f))))))) ;successfully stopped
|
||||
|
||||
(define fail2ban-service-type
|
||||
(service-type (name 'fail2ban)
|
||||
|
||||
+4
-17
@@ -38,6 +38,7 @@
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix derivations)
|
||||
#:use-module (guix profiles)
|
||||
#:use-module ((guix utils) #:select (substitute-keyword-arguments))
|
||||
@@ -49,9 +50,6 @@
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages cross-base)
|
||||
#:use-module (gnu packages cryptsetup)
|
||||
#:use-module (gnu packages disk)
|
||||
#:use-module (gnu packages file-systems)
|
||||
#:use-module (gnu packages firmware)
|
||||
#:use-module (gnu packages gawk)
|
||||
#:use-module (gnu packages guile)
|
||||
@@ -858,6 +856,8 @@ of PROVENANCE-SERVICE-TYPE to its services."
|
||||
(cons* procps psmisc which
|
||||
(@ (gnu packages admin) shadow-with-man-pages) ;for 'passwd'
|
||||
|
||||
e2fsprogs ;for lsattr, chattr, etc.
|
||||
|
||||
guile-3.0-latest
|
||||
|
||||
;; The packages below are also in %FINAL-INPUTS, so take them from
|
||||
@@ -896,20 +896,7 @@ of PROVENANCE-SERVICE-TYPE to its services."
|
||||
;; many people are familiar with, so keep it around.
|
||||
iw wireless-tools))
|
||||
|
||||
(define %base-packages-disk-utilities
|
||||
;; A well-rounded set of packages for interacting with disks,
|
||||
;; partitions and filesystems, included with the Guix installation
|
||||
;; image.
|
||||
(list parted gptfdisk ddrescue
|
||||
;; We used to provide fdisk from GNU fdisk, but as of version 2.0.0a
|
||||
;; it pulls Guile 1.8, which takes unreasonable space; furthermore
|
||||
;; util-linux's fdisk is already available, in %base-packages-linux.
|
||||
cryptsetup mdadm
|
||||
dosfstools
|
||||
btrfs-progs
|
||||
f2fs-tools
|
||||
jfsutils
|
||||
xfsprogs))
|
||||
(define-deprecated %base-packages-disk-utilities #f '())
|
||||
|
||||
(define %base-packages
|
||||
;; Default set of packages globally visible. It should include anything
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
;; This is an operating system configuration template
|
||||
;; for a "bare bones" setup, with no X11 display server.
|
||||
|
||||
(use-modules (gnu))
|
||||
(use-service-modules networking ssh)
|
||||
(use-package-modules admin curl networking screen)
|
||||
|
||||
(operating-system
|
||||
(host-name "ruby-guard-5545")
|
||||
(timezone "Europe/Budapest")
|
||||
(locale "en_US.utf8")
|
||||
|
||||
;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
|
||||
;; target hard disk, and "my-root" is the label of the target
|
||||
;; root file system.
|
||||
(bootloader (bootloader-configuration
|
||||
(bootloader grub-bootloader)
|
||||
(targets '("/dev/sdX"))))
|
||||
(file-systems (cons (file-system
|
||||
(device (file-system-label "my-root"))
|
||||
(mount-point "/")
|
||||
(type "ext4"))
|
||||
%base-file-systems))
|
||||
(users (cons (user-account
|
||||
(name "alice")
|
||||
(comment "Bob's sister")
|
||||
(group "users")
|
||||
;; adding her to the yggdrasil group means she can use
|
||||
;; yggdrasilctl to modify the configuration
|
||||
(supplementary-groups '("wheel" "yggdrasil")))
|
||||
%base-user-accounts))
|
||||
|
||||
;; Globally-installed packages.
|
||||
(packages (cons* screen curl %base-packages))
|
||||
|
||||
;; Add services to the baseline: a DHCP client and
|
||||
;; an SSH server.
|
||||
;; If you add an /etc/yggdrasil-private.conf, you can log in to ssh
|
||||
;; using your Yggdrasil IPv6 address from another machine running Yggdrasil.
|
||||
;; Alternatively, the client can sit behind a router that has Yggdrasil.
|
||||
;; That file is specifically _not_ handled by Guix, because we don't want its
|
||||
;; contents to sit in the world-readable /gnu/store.
|
||||
(services
|
||||
(append
|
||||
(list
|
||||
(service dhcp-client-service-type)
|
||||
(service yggdrasil-service-type
|
||||
(yggdrasil-configuration
|
||||
(log-to 'stdout)
|
||||
(log-level 'debug)
|
||||
(autoconf? #f)
|
||||
(json-config
|
||||
;; choose a few from
|
||||
;; https://github.com/yggdrasil-network/public-peers
|
||||
'((peers . #("tcp://1.2.3.4:1337"))))
|
||||
(config-file #f)))
|
||||
(service openssh-service-type
|
||||
(openssh-configuration
|
||||
(port-number 2222))))
|
||||
%base-services)))
|
||||
@@ -972,9 +972,9 @@ image, depending on IMAGE format."
|
||||
(G_ "~a: unsupported image format") image-format)))))))
|
||||
|
||||
|
||||
;;
|
||||
;; Image detection.
|
||||
;;
|
||||
;;;
|
||||
;;; Image type discovery.
|
||||
;;;
|
||||
|
||||
(define (image-modules)
|
||||
"Return the list of image modules."
|
||||
|
||||
+31
-2
@@ -48,6 +48,9 @@
|
||||
#:use-module (gnu packages bootloaders)
|
||||
#:use-module (gnu packages certs)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages cryptsetup)
|
||||
#:use-module (gnu packages disk)
|
||||
#:use-module (gnu packages file-systems)
|
||||
#:use-module (gnu packages fonts)
|
||||
#:use-module (gnu packages fontutils)
|
||||
#:use-module (gnu packages guile)
|
||||
@@ -281,13 +284,24 @@ templates under @file{/etc/configuration}.")))
|
||||
;; appropriate options. The GUI installer needs it when the machine does not
|
||||
;; support Kernel Mode Setting. Otherwise kmscon is missing /dev/fb0.
|
||||
(define (uvesafb-shepherd-service _)
|
||||
(define modprobe
|
||||
(program-file "modprobe-wrapper"
|
||||
#~(begin
|
||||
;; Use a wrapper because shepherd 0.9.3 won't let us
|
||||
;; pass environment variables to the child process:
|
||||
;; <https://issues.guix.gnu.org/60106>.
|
||||
(setenv "LINUX_MODULE_DIRECTORY"
|
||||
"/run/booted-system/kernel/lib/modules")
|
||||
(apply execl #$(file-append kmod "/bin/modprobe")
|
||||
"modprobe" (cdr (command-line))))))
|
||||
|
||||
(list (shepherd-service
|
||||
(documentation "Load the uvesafb kernel module if needed.")
|
||||
(provision '(maybe-uvesafb))
|
||||
(requirement '(file-systems))
|
||||
(start #~(lambda ()
|
||||
(or (file-exists? "/dev/fb0")
|
||||
(invoke #+(file-append kmod "/bin/modprobe")
|
||||
(invoke #+modprobe
|
||||
"uvesafb"
|
||||
(string-append "v86d=" #$v86d "/sbin/v86d")
|
||||
"mode_option=1024x768"))))
|
||||
@@ -458,6 +472,21 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
|
||||
\x1b[1;33mUse Alt-F2 for documentation.\x1b[0m
|
||||
")
|
||||
|
||||
(define %installer-disk-utilities
|
||||
;; A well-rounded set of packages for interacting with disks, partitions and
|
||||
;; file systems, included with the Guix installation image.
|
||||
(list parted gptfdisk ddrescue
|
||||
;; We used to provide fdisk from GNU fdisk, but as of version 2.0.0a
|
||||
;; it pulls Guile 1.8, which takes unreasonable space; furthermore
|
||||
;; util-linux's fdisk is already available, in %base-packages-linux.
|
||||
cryptsetup mdadm
|
||||
dosfstools
|
||||
btrfs-progs
|
||||
e2fsprogs
|
||||
f2fs-tools
|
||||
jfsutils
|
||||
xfsprogs))
|
||||
|
||||
(define installation-os
|
||||
;; The operating system used on installation images for USB sticks etc.
|
||||
(operating-system
|
||||
@@ -530,7 +559,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
|
||||
font-dejavu font-gnu-unifont
|
||||
grub ; mostly so xrefs to its manual work
|
||||
nss-certs) ; To access HTTPS, use git, etc.
|
||||
%base-packages-disk-utilities
|
||||
%installer-disk-utilities
|
||||
%base-packages))))
|
||||
|
||||
(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0")
|
||||
|
||||
+18
-9
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
|
||||
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
@@ -234,8 +234,8 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
|
||||
|
||||
#$@(map virtfs-option shared-fs)
|
||||
#$@(if rw-image?
|
||||
#~((format #f "-drive file=~a,if=virtio" #$image))
|
||||
#~((format #f "-drive file=~a,if=virtio,cache=writeback,werror=report,readonly=on"
|
||||
#~((format #f "-drive file=~a,format=qcow2,if=virtio" #$image))
|
||||
#~((format #f "-drive file=~a,format=raw,if=virtio,cache=writeback,werror=report,readonly=on"
|
||||
#$image)))))
|
||||
|
||||
(define* (system-qemu-image/shared-store-script os
|
||||
@@ -303,17 +303,26 @@ useful when FULL-BOOT? is true."
|
||||
"-m " (number->string #$memory-size)
|
||||
#$@options))
|
||||
|
||||
(define copy-image
|
||||
;; Script that "copies" BASE-IMAGE to /tmp. Make a copy-on-write image,
|
||||
;; which is much cheaper than actually copying it.
|
||||
(program-file "copy-image"
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(unless (file-exists? #$rw-image)
|
||||
(invoke #+(file-append qemu "/bin/qemu-img")
|
||||
"create" "-b" #$base-image
|
||||
"-F" "raw" "-f" "qcow2" #$rw-image))))))
|
||||
|
||||
(define builder
|
||||
#~(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(format port "#!~a~%"
|
||||
#+(file-append bash "/bin/sh"))
|
||||
(when (not #$volatile?)
|
||||
(format port "~a~%"
|
||||
#$(program-file "copy-image"
|
||||
#~(unless (file-exists? #$rw-image)
|
||||
(copy-file #$base-image #$rw-image)
|
||||
(chmod #$rw-image #o640)))))
|
||||
#$@(if volatile?
|
||||
#~()
|
||||
#~((format port "~a~%" #+copy-image)))
|
||||
(format port "exec ~a \"$@\"~%"
|
||||
(string-join #$qemu-exec " "))
|
||||
(chmod port #o555))))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
|
||||
;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2019-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -209,7 +209,7 @@ inside %DOCKER-OS."
|
||||
(virtual-machine
|
||||
(operating-system os)
|
||||
(volatile? #f)
|
||||
(disk-image-size (* 5000 (expt 2 20)))
|
||||
(disk-image-size (* 5500 (expt 2 20)))
|
||||
(memory-size 2048)
|
||||
(port-forwardings '())))
|
||||
|
||||
|
||||
@@ -471,8 +471,6 @@ reboot\n")
|
||||
(mlet* %store-monad ((images (run-install
|
||||
%minimal-os-on-vda
|
||||
%minimal-os-on-vda-source
|
||||
#:packages
|
||||
(list e2fsprogs)
|
||||
#:script
|
||||
%simple-installation-script-for-/dev/vda
|
||||
#:installation-image-type
|
||||
|
||||
@@ -447,9 +447,14 @@ If an error occurs while creating the binding, defer the error report until
|
||||
the returned procedure is called."
|
||||
(catch #t
|
||||
(lambda ()
|
||||
;; Note: When #:library is set, try it first and fall back to libc
|
||||
;; proper. This is because libraries like libutil.so have been subsumed
|
||||
;; by libc.so with glibc >= 2.34.
|
||||
(let ((ptr (dynamic-func name
|
||||
(if library
|
||||
(dynamic-link library)
|
||||
(or (false-if-exception
|
||||
(dynamic-link library))
|
||||
(dynamic-link))
|
||||
(dynamic-link)))))
|
||||
;; The #:return-errno? facility was introduced in Guile 2.0.12.
|
||||
(pointer->procedure return-type ptr argument-types
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2016-2019, 2021-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -77,7 +77,7 @@ CLAUSES."
|
||||
((#:autoload module _ rest ...)
|
||||
(loop rest (cons module result)))
|
||||
(((or #:export #:re-export #:export-syntax #:re-export-syntax
|
||||
#:re-export-and-replace #:replace #:version)
|
||||
#:re-export-and-replace #:replace #:version #:declarative?)
|
||||
_ rest ...)
|
||||
(loop rest result))
|
||||
(((or #:pure #:no-backtrace) rest ...)
|
||||
|
||||
+76
-11
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
@@ -104,6 +104,10 @@ error-reporting purposes."
|
||||
(()
|
||||
#t)))))))
|
||||
|
||||
(define-syntax map-fields
|
||||
(lambda (x)
|
||||
(syntax-violation 'map-fields "bad use of syntactic keyword" x x)))
|
||||
|
||||
(define-syntax-parameter this-record
|
||||
(lambda (s)
|
||||
"Return the record being defined. This macro may only be used in the
|
||||
@@ -325,6 +329,15 @@ This expression returns a new object equal to 'x' except for its 'name'
|
||||
field and its 'loc' field---the latter is marked as \"innate\", so it is not
|
||||
inherited."
|
||||
|
||||
(define (rtd-identifier type)
|
||||
;; Return an identifier derived from TYPE to name its record type
|
||||
;; descriptor (RTD).
|
||||
(let ((type-name (syntax->datum type)))
|
||||
(datum->syntax
|
||||
type
|
||||
(string->symbol
|
||||
(string-append "% " (symbol->string type-name) " rtd")))))
|
||||
|
||||
(define (field-default-value s)
|
||||
(syntax-case s (default)
|
||||
((field (default val) _ ...)
|
||||
@@ -428,10 +441,31 @@ inherited."
|
||||
field)))
|
||||
field-spec)))
|
||||
#`(begin
|
||||
(define-record-type type
|
||||
(define-record-type #,(rtd-identifier #'type)
|
||||
(ctor field ...)
|
||||
pred
|
||||
field-spec* ...)
|
||||
|
||||
;; Rectify the vtable type name...
|
||||
(set-struct-vtable-name! #,(rtd-identifier #'type) 'type)
|
||||
(cond-expand
|
||||
(guile-3
|
||||
;; ... and the record type name.
|
||||
(struct-set! #,(rtd-identifier #'type) vtable-offset-user
|
||||
'type))
|
||||
(else #f))
|
||||
|
||||
(define-syntax type
|
||||
(lambda (s)
|
||||
"This macro lets us query record type info at
|
||||
macro-expansion time."
|
||||
(syntax-case s (map-fields)
|
||||
((_ map-fields macro)
|
||||
#'(macro (field ...)))
|
||||
(id
|
||||
(identifier? #'id)
|
||||
#'#,(rtd-identifier #'type)))))
|
||||
|
||||
(define #,(current-abi-identifier #'type)
|
||||
#,cookie)
|
||||
|
||||
@@ -535,19 +569,50 @@ pairs. Stop upon an empty line (after consuming it) or EOF."
|
||||
(else
|
||||
(error "unmatched line" line))))))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Pattern matching.
|
||||
;;;
|
||||
|
||||
(define-syntax lookup-field
|
||||
(lambda (s)
|
||||
"Look up FIELD in the given list and return an expression that represents
|
||||
its offset in the record. Raise a syntax violation when the field is not
|
||||
found."
|
||||
(syntax-case s ()
|
||||
((_ field offset ())
|
||||
(syntax-violation 'lookup-field "unknown record type field"
|
||||
s #'field))
|
||||
((_ field offset (head tail ...))
|
||||
(free-identifier=? #'field #'head)
|
||||
#'offset)
|
||||
((_ field offset (_ tail ...))
|
||||
#'(lookup-field field (+ 1 offset) (tail ...))))))
|
||||
|
||||
(define-syntax match-record-inner
|
||||
(lambda (s)
|
||||
(syntax-case s ()
|
||||
((_ record type (field rest ...) body ...)
|
||||
#`(let-syntax ((field-offset (syntax-rules ()
|
||||
((_ f)
|
||||
(lookup-field field 0 f)))))
|
||||
(let* ((offset (type map-fields field-offset))
|
||||
(field (struct-ref record offset)))
|
||||
(match-record-inner record type (rest ...) body ...))))
|
||||
((_ record type () body ...)
|
||||
#'(begin body ...)))))
|
||||
|
||||
(define-syntax match-record
|
||||
(syntax-rules ()
|
||||
"Bind each FIELD of a RECORD of the given TYPE to it's FIELD name.
|
||||
The order in which fields appear does not matter. A syntax error is raised if
|
||||
an unknown field is queried.
|
||||
|
||||
The current implementation does not support thunked and delayed fields."
|
||||
((_ record type (field fields ...) body ...)
|
||||
;; TODO support thunked and delayed fields
|
||||
((_ record type (fields ...) body ...)
|
||||
(if (eq? (struct-vtable record) type)
|
||||
;; TODO compute indices and report wrong-field-name errors at
|
||||
;; expansion time
|
||||
;; TODO support thunked and delayed fields
|
||||
(let ((field ((record-accessor type 'field) record)))
|
||||
(match-record record type (fields ...) body ...))
|
||||
(throw 'wrong-type-arg record)))
|
||||
((_ record type () body ...)
|
||||
(begin body ...))))
|
||||
(match-record-inner record type (fields ...) body ...)
|
||||
(throw 'wrong-type-arg record)))))
|
||||
|
||||
;;; records.scm ends here
|
||||
|
||||
@@ -728,14 +728,21 @@ WHILE-LIST."
|
||||
(home (getenv "HOME"))
|
||||
(uid (if user 1000 (getuid)))
|
||||
(gid (if user 1000 (getgid)))
|
||||
(passwd (let ((pwd (getpwuid (getuid))))
|
||||
|
||||
;; On a foreign distro, the name service switch might be
|
||||
;; dysfunctional and 'getpwuid' throws. Don't let that hamper
|
||||
;; operations.
|
||||
(passwd (let ((pwd (false-if-exception (getpwuid (getuid)))))
|
||||
(password-entry
|
||||
(name (or user (passwd:name pwd)))
|
||||
(real-name (if user
|
||||
(name (or user
|
||||
(and=> pwd passwd:name)
|
||||
(getenv "USER")
|
||||
"charlie"))
|
||||
(real-name (if (or user (not pwd))
|
||||
""
|
||||
(passwd:gecos pwd)))
|
||||
(uid uid) (gid gid) (shell bash)
|
||||
(directory (if user
|
||||
(directory (if (or user (not pwd))
|
||||
(string-append "/home/" user)
|
||||
(passwd:dir pwd))))))
|
||||
(groups (list (group-entry (name "users") (gid gid))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org>
|
||||
;;; Copyright © 2018-2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -262,7 +262,10 @@ down the road."
|
||||
(deduplicate file (dump-and-compute-hash) #:store store)
|
||||
(call-with-output-file file
|
||||
(lambda (output)
|
||||
(dump-port input output size)))))
|
||||
(if (file-port? input)
|
||||
(sendfile output input size 0)
|
||||
(dump-port input output size
|
||||
#:buffer-size %deduplication-minimum-size))))))
|
||||
|
||||
(define* (copy-file/deduplicate source target
|
||||
#:key (store (%store-directory)))
|
||||
|
||||
@@ -2576,7 +2576,7 @@ Path DerivationGoal::openLogFile()
|
||||
closeOnExec(fd);
|
||||
|
||||
if (!(fLogFile = fdopen(fd.borrow(), "w")))
|
||||
throw SysError(format("opening file `%1%'") % logFileName);
|
||||
throw SysError(format("opening log file `%1%'") % logFileName);
|
||||
|
||||
int err;
|
||||
if (!(bzLogFile = BZ2_bzWriteOpen(&err, fLogFile, 9, 0, 0)))
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ Hash hashFile(HashType ht, const Path & path)
|
||||
start(ht, ctx);
|
||||
|
||||
AutoCloseFD fd = open(path.c_str(), O_RDONLY);
|
||||
if (fd == -1) throw SysError(format("opening file `%1%'") % path);
|
||||
if (fd == -1) throw SysError(format("computing hash of file `%1%'") % path);
|
||||
|
||||
unsigned char buf[8192];
|
||||
ssize_t n;
|
||||
|
||||
+2
-2
@@ -264,7 +264,7 @@ string readFile(const Path & path, bool drain)
|
||||
{
|
||||
AutoCloseFD fd = open(path.c_str(), O_RDONLY);
|
||||
if (fd == -1)
|
||||
throw SysError(format("opening file `%1%'") % path);
|
||||
throw SysError(format("reading file `%1%'") % path);
|
||||
return drain ? drainFD(fd) : readFile(fd);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ void writeFile(const Path & path, const string & s)
|
||||
{
|
||||
AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||
if (fd == -1)
|
||||
throw SysError(format("opening file '%1%'") % path);
|
||||
throw SysError(format("writing file '%1%'") % path);
|
||||
writeFull(fd, s);
|
||||
}
|
||||
|
||||
|
||||
+1397
-867
File diff suppressed because it is too large
Load Diff
+1463
-936
File diff suppressed because it is too large
Load Diff
+1272
-882
File diff suppressed because it is too large
Load Diff
+1256
-863
File diff suppressed because it is too large
Load Diff
+14104
-13803
File diff suppressed because it is too large
Load Diff
+14151
-13827
File diff suppressed because it is too large
Load Diff
+14867
-14664
File diff suppressed because it is too large
Load Diff
+18849
-18575
File diff suppressed because it is too large
Load Diff
+18670
-18375
File diff suppressed because it is too large
Load Diff
+19331
-19062
File diff suppressed because it is too large
Load Diff
+785
-285
File diff suppressed because it is too large
Load Diff
+786
-285
File diff suppressed because it is too large
Load Diff
+812
-290
File diff suppressed because it is too large
Load Diff
+806
-375
File diff suppressed because it is too large
Load Diff
+801
-285
File diff suppressed because it is too large
Load Diff
+1822
-1111
File diff suppressed because it is too large
Load Diff
+789
-285
File diff suppressed because it is too large
Load Diff
+787
-285
File diff suppressed because it is too large
Load Diff
+879
-374
File diff suppressed because it is too large
Load Diff
+797
-285
File diff suppressed because it is too large
Load Diff
+785
-285
File diff suppressed because it is too large
Load Diff
+789
-291
File diff suppressed because it is too large
Load Diff
+785
-285
File diff suppressed because it is too large
Load Diff
+802
-272
File diff suppressed because it is too large
Load Diff
+786
-285
File diff suppressed because it is too large
Load Diff
+809
-290
File diff suppressed because it is too large
Load Diff
+803
-277
File diff suppressed because it is too large
Load Diff
+810
-291
File diff suppressed because it is too large
Load Diff
+785
-285
File diff suppressed because it is too large
Load Diff
+814
-273
File diff suppressed because it is too large
Load Diff
+788
-285
File diff suppressed because it is too large
Load Diff
+798
-290
File diff suppressed because it is too large
Load Diff
+808
-294
File diff suppressed because it is too large
Load Diff
+788
-285
File diff suppressed because it is too large
Load Diff
+789
-285
File diff suppressed because it is too large
Load Diff
+800
-285
File diff suppressed because it is too large
Load Diff
+789
-285
File diff suppressed because it is too large
Load Diff
@@ -19,4 +19,5 @@ pt_BR
|
||||
sk
|
||||
sr
|
||||
tr
|
||||
vi
|
||||
zh_CN
|
||||
|
||||
+13429
-2955
File diff suppressed because it is too large
Load Diff
+12792
-1650
File diff suppressed because it is too large
Load Diff
+13530
-2996
File diff suppressed because it is too large
Load Diff
+13416
-6335
File diff suppressed because it is too large
Load Diff
+12427
-1428
File diff suppressed because it is too large
Load Diff
+12391
-1428
File diff suppressed because it is too large
Load Diff
+13701
-3147
File diff suppressed because it is too large
Load Diff
+12825
-1839
File diff suppressed because it is too large
Load Diff
+12681
-1458
File diff suppressed because it is too large
Load Diff
+12389
-1433
File diff suppressed because it is too large
Load Diff
+12451
-1428
File diff suppressed because it is too large
Load Diff
+12519
-1428
File diff suppressed because it is too large
Load Diff
+12629
-1545
File diff suppressed because it is too large
Load Diff
+12433
-1482
File diff suppressed because it is too large
Load Diff
+12451
-1431
File diff suppressed because it is too large
Load Diff
+12435
-1488
File diff suppressed because it is too large
Load Diff
+12415
-1432
File diff suppressed because it is too large
Load Diff
+34807
File diff suppressed because it is too large
Load Diff
+12715
-1521
File diff suppressed because it is too large
Load Diff
@@ -528,4 +528,37 @@ Description: 1st line,
|
||||
'("a" "b" "c")
|
||||
'("a")))
|
||||
|
||||
(test-equal "match-record, simple"
|
||||
'((1 2) (a b))
|
||||
(let ()
|
||||
(define-record-type* <foo> foo make-foo
|
||||
foo?
|
||||
(first foo-first (default 1))
|
||||
(second foo-second))
|
||||
|
||||
(list (match-record (foo (second 2)) <foo>
|
||||
(first second)
|
||||
(list first second))
|
||||
(match-record (foo (first 'a) (second 'b)) <foo>
|
||||
(second first)
|
||||
(list first second)))))
|
||||
|
||||
(test-equal "match-record, unknown field"
|
||||
'syntax-error
|
||||
(catch 'syntax-error
|
||||
(lambda ()
|
||||
(eval '(begin
|
||||
(use-modules (guix records))
|
||||
|
||||
(define-record-type* <foo> foo make-foo
|
||||
foo?
|
||||
(first foo-first (default 1))
|
||||
(second foo-second))
|
||||
|
||||
(match-record (foo (second 2)) <foo>
|
||||
(one two)
|
||||
#f))
|
||||
(make-fresh-user-module)))
|
||||
(lambda (key . args) key)))
|
||||
|
||||
(test-end)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2018, 2020-2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018, 2020-2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -136,6 +136,21 @@
|
||||
(cons (apply = (map (compose stat:ino stat) identical))
|
||||
(map (compose stat:nlink stat) identical))))))
|
||||
|
||||
(test-assert "copy-file/deduplicate, below %deduplication-minimum-size"
|
||||
(call-with-temporary-directory
|
||||
(lambda (store)
|
||||
(let ((source (string-append store "/input")))
|
||||
(call-with-output-file source
|
||||
(lambda (port)
|
||||
(display "Hello!\n" port)))
|
||||
(copy-file/deduplicate source
|
||||
(string-append store "/a")
|
||||
#:store store)
|
||||
(and (not (directory-exists? (string-append store "/.links")))
|
||||
(file=? source (string-append store "/a"))
|
||||
(not (= (stat:ino (stat (string-append store "/a")))
|
||||
(stat:ino (stat source)))))))))
|
||||
|
||||
(test-assert "copy-file/deduplicate"
|
||||
(call-with-temporary-directory
|
||||
(lambda (store)
|
||||
|
||||
Reference in New Issue
Block a user