2018-03-23 10:36:12 -04:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2023-05-20 09:57:13 -04:00
|
|
|
|
;;; Copyright © 2017-2023 Ludovic Courtès <ludo@gnu.org>
|
2020-02-21 10:41:44 -05:00
|
|
|
|
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
|
2023-06-22 02:30:25 -04:00
|
|
|
|
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
|
2018-03-23 10:36:12 -04:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (guix self)
|
|
|
|
|
#:use-module (guix config)
|
|
|
|
|
#:use-module (guix modules)
|
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
|
#:use-module (guix store)
|
|
|
|
|
#:use-module (guix monads)
|
|
|
|
|
#:use-module (guix discovery)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix sets)
|
|
|
|
|
#:use-module (guix modules)
|
2020-09-30 16:40:59 -04:00
|
|
|
|
#:use-module ((guix utils) #:select (version-major+minor))
|
2018-06-18 16:43:44 -04:00
|
|
|
|
#:use-module ((guix build utils) #:select (find-files))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
|
#:use-module (srfi srfi-9)
|
2019-01-07 05:38:53 -05:00
|
|
|
|
#:use-module (srfi srfi-35)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
|
#:export (make-config.scm
|
2018-05-30 05:10:27 -04:00
|
|
|
|
whole-package ;for internal use in 'guix pull'
|
2018-03-23 10:36:12 -04:00
|
|
|
|
compiled-guix
|
2019-01-22 04:22:33 -05:00
|
|
|
|
guix-derivation))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Dependency handling.
|
|
|
|
|
;;;
|
|
|
|
|
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(define %packages
|
|
|
|
|
(let ((ref (lambda (module variable)
|
|
|
|
|
(delay
|
|
|
|
|
(module-ref (resolve-interface
|
|
|
|
|
`(gnu packages ,module))
|
|
|
|
|
variable)))))
|
|
|
|
|
`(("guile" . ,(ref 'guile 'guile-3.0-latest))
|
|
|
|
|
("guile-avahi" . ,(ref 'guile-xyz 'guile-avahi))
|
|
|
|
|
("guile-json" . ,(ref 'guile 'guile-json-4))
|
|
|
|
|
("guile-ssh" . ,(ref 'ssh 'guile-ssh))
|
|
|
|
|
("guile-git" . ,(ref 'guile 'guile-git))
|
|
|
|
|
("guile-semver" . ,(ref 'guile-xyz 'guile-semver))
|
|
|
|
|
("guile-lib" . ,(ref 'guile-xyz 'guile-lib))
|
|
|
|
|
("guile-sqlite3" . ,(ref 'guile 'guile-sqlite3))
|
|
|
|
|
("guile-zlib" . ,(ref 'guile 'guile-zlib))
|
|
|
|
|
("guile-lzlib" . ,(ref 'guile 'guile-lzlib))
|
|
|
|
|
("guile-zstd" . ,(ref 'guile 'guile-zstd))
|
|
|
|
|
("guile-gcrypt" . ,(ref 'gnupg 'guile-gcrypt))
|
|
|
|
|
("guile-gnutls" . ,(ref 'tls 'guile-gnutls))
|
|
|
|
|
("guix-daemon" . ,(ref 'package-management 'guix-daemon))
|
|
|
|
|
("disarchive" . ,(ref 'backup 'disarchive))
|
|
|
|
|
("guile-lzma" . ,(ref 'guile 'guile-lzma))
|
|
|
|
|
("gzip" . ,(ref 'compression 'gzip))
|
|
|
|
|
("bzip2" . ,(ref 'compression 'bzip2))
|
|
|
|
|
("xz" . ,(ref 'compression 'xz))
|
2023-09-11 08:54:29 -04:00
|
|
|
|
("git-minimal" . ,(ref 'version-control 'git-minimal))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
("po4a" . ,(ref 'gettext 'po4a))
|
|
|
|
|
("gettext-minimal" . ,(ref 'gettext 'gettext-minimal))
|
|
|
|
|
("gcc-toolchain" . ,(ref 'commencement 'gcc-toolchain))
|
|
|
|
|
("glibc-utf8-locales" . ,(ref 'base 'glibc-utf8-locales))
|
2023-05-20 09:57:13 -04:00
|
|
|
|
("graphviz" . ,(ref 'graphviz 'graphviz-minimal))
|
|
|
|
|
("font-ghostscript" . ,(ref 'ghostscript 'font-ghostscript))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
("texinfo" . ,(ref 'texinfo 'texinfo)))))
|
|
|
|
|
|
|
|
|
|
(define (specification->package name)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
;; Use our own variant of that procedure because that of (gnu packages)
|
|
|
|
|
;; would traverse all the .scm files, which is wasteful.
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(and=> (assoc-ref %packages name) force))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Derivations.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
;; Node in a DAG of build tasks. Each node maps to a derivation, but it's
|
|
|
|
|
;; easier to express things this way.
|
|
|
|
|
(define-record-type <node>
|
|
|
|
|
(node name modules source dependencies compiled)
|
|
|
|
|
node?
|
|
|
|
|
(name node-name) ;string
|
|
|
|
|
(modules node-modules) ;list of module names
|
|
|
|
|
(source node-source) ;list of source files
|
|
|
|
|
(dependencies node-dependencies) ;list of nodes
|
|
|
|
|
(compiled node-compiled)) ;node -> lowerable object
|
|
|
|
|
|
2018-07-16 08:45:20 -04:00
|
|
|
|
;; File mappings are essentially an alist as passed to 'imported-files'.
|
|
|
|
|
(define-record-type <file-mapping>
|
|
|
|
|
(file-mapping name alist)
|
|
|
|
|
file-mapping?
|
|
|
|
|
(name file-mapping-name)
|
|
|
|
|
(alist file-mapping-alist))
|
|
|
|
|
|
|
|
|
|
(define-gexp-compiler (file-mapping-compiler (mapping <file-mapping>)
|
|
|
|
|
system target)
|
|
|
|
|
;; Here we use 'imported-files', which can arrange to directly import all
|
|
|
|
|
;; the files instead of creating a derivation, when possible.
|
|
|
|
|
(imported-files (map (match-lambda
|
|
|
|
|
((destination (? local-file? file))
|
|
|
|
|
(cons destination
|
|
|
|
|
(local-file-absolute-file-name file)))
|
|
|
|
|
((destination source)
|
|
|
|
|
(cons destination source))) ;silliness
|
|
|
|
|
(file-mapping-alist mapping))
|
|
|
|
|
#:name (file-mapping-name mapping)
|
|
|
|
|
#:system system))
|
|
|
|
|
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(define (node-source+compiled node)
|
|
|
|
|
"Return a \"bundle\" containing both the source code and object files for
|
|
|
|
|
NODE's modules, under their FHS directories: share/guile/site and lib/guile."
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(define source
|
|
|
|
|
(string-append #$output "/share/guile/site/"
|
|
|
|
|
(effective-version)))
|
|
|
|
|
|
|
|
|
|
(define object
|
|
|
|
|
(string-append #$output "/lib/guile/" (effective-version)
|
|
|
|
|
"/site-ccache"))
|
|
|
|
|
|
|
|
|
|
(mkdir-p (dirname source))
|
|
|
|
|
(symlink #$(node-source node) source)
|
|
|
|
|
(mkdir-p (dirname object))
|
|
|
|
|
(symlink #$(node-compiled node) object))))
|
|
|
|
|
|
|
|
|
|
(computed-file (string-append (node-name node) "-modules")
|
2019-09-26 12:49:25 -04:00
|
|
|
|
build
|
|
|
|
|
#:options '(#:local-build? #t
|
|
|
|
|
|
|
|
|
|
;; "Building" it locally is faster.
|
|
|
|
|
#:substitutable? #f)))
|
2019-01-07 16:57:34 -05:00
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define (node-fold proc init nodes)
|
|
|
|
|
(let loop ((nodes nodes)
|
|
|
|
|
(visited (setq))
|
|
|
|
|
(result init))
|
|
|
|
|
(match nodes
|
|
|
|
|
(() result)
|
|
|
|
|
((head tail ...)
|
|
|
|
|
(if (set-contains? visited head)
|
|
|
|
|
(loop tail visited result)
|
|
|
|
|
(loop tail (set-insert head visited)
|
|
|
|
|
(proc head result)))))))
|
|
|
|
|
|
|
|
|
|
(define (node-modules/recursive nodes)
|
|
|
|
|
(node-fold (lambda (node modules)
|
|
|
|
|
(append (node-modules node) modules))
|
|
|
|
|
'()
|
|
|
|
|
nodes))
|
|
|
|
|
|
|
|
|
|
(define* (closure modules #:optional (except '()))
|
|
|
|
|
(source-module-closure modules
|
|
|
|
|
#:select?
|
|
|
|
|
(match-lambda
|
|
|
|
|
(('guix 'config)
|
|
|
|
|
#f)
|
|
|
|
|
((and module
|
|
|
|
|
(or ('guix _ ...) ('gnu _ ...)))
|
|
|
|
|
(not (member module except)))
|
|
|
|
|
(rest #f))))
|
|
|
|
|
|
|
|
|
|
(define module->import
|
|
|
|
|
;; Return a file-name/file-like object pair for the specified module and
|
|
|
|
|
;; suitable for 'imported-files'.
|
|
|
|
|
(match-lambda
|
|
|
|
|
((module '=> thing)
|
|
|
|
|
(let ((file (module-name->file-name module)))
|
|
|
|
|
(list file thing)))
|
|
|
|
|
(module
|
|
|
|
|
(let ((file (module-name->file-name module)))
|
|
|
|
|
(list file
|
|
|
|
|
(local-file (search-path %load-path file)))))))
|
|
|
|
|
|
|
|
|
|
(define* (scheme-node name modules #:optional (dependencies '())
|
|
|
|
|
#:key (extra-modules '()) (extra-files '())
|
|
|
|
|
(extensions '())
|
|
|
|
|
parallel? guile-for-build)
|
|
|
|
|
"Return a node that builds the given Scheme MODULES, and depends on
|
|
|
|
|
DEPENDENCIES (a list of nodes). EXTRA-MODULES is a list of additional modules
|
|
|
|
|
added to the source, and EXTRA-FILES is a list of additional files.
|
|
|
|
|
EXTENSIONS is a set of full-blown Guile packages (e.g., 'guile-json') that
|
|
|
|
|
must be present in the search path."
|
|
|
|
|
(let* ((modules (append extra-modules
|
|
|
|
|
(closure modules
|
|
|
|
|
(node-modules/recursive dependencies))))
|
|
|
|
|
(module-files (map module->import modules))
|
2018-07-16 08:45:20 -04:00
|
|
|
|
(source (file-mapping (string-append name "-source")
|
|
|
|
|
(append module-files extra-files))))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(node name modules source dependencies
|
2018-06-01 18:02:23 -04:00
|
|
|
|
(compiled-modules name source
|
|
|
|
|
(map car module-files)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(map node-source dependencies)
|
|
|
|
|
(map node-compiled dependencies)
|
|
|
|
|
#:extensions extensions
|
|
|
|
|
#:parallel? parallel?
|
|
|
|
|
#:guile-for-build guile-for-build))))
|
|
|
|
|
|
|
|
|
|
(define (file-imports directory sub-directory pred)
|
|
|
|
|
"List all the files matching PRED under DIRECTORY/SUB-DIRECTORY. Return a
|
|
|
|
|
list of file-name/file-like objects suitable as inputs to 'imported-files'."
|
|
|
|
|
(map (lambda (file)
|
|
|
|
|
(list (string-drop file (+ 1 (string-length directory)))
|
|
|
|
|
(local-file file #:recursive? #t)))
|
|
|
|
|
(find-files (string-append directory "/" sub-directory) pred)))
|
|
|
|
|
|
2018-11-06 03:35:06 -05:00
|
|
|
|
(define* (file-append* item file #:key (recursive? #t))
|
|
|
|
|
"Return FILE within ITEM, which may be a file name or a file-like object.
|
|
|
|
|
When ITEM is a plain file name (a string), simply return a 'local-file'
|
|
|
|
|
record with the new file name."
|
2018-05-30 16:12:09 -04:00
|
|
|
|
(match item
|
|
|
|
|
((? string?)
|
|
|
|
|
;; This is the optimal case: we return a new "source". Thus, a
|
|
|
|
|
;; derivation that depends on this sub-directory does not depend on ITEM
|
|
|
|
|
;; itself.
|
2018-11-06 03:35:06 -05:00
|
|
|
|
(local-file (string-append item "/" file)
|
|
|
|
|
#:recursive? recursive?))
|
2020-05-25 11:33:04 -04:00
|
|
|
|
((? local-file? base)
|
|
|
|
|
;; Likewise, but with a <local-file>.
|
|
|
|
|
(if (local-file-recursive? base)
|
|
|
|
|
(local-file (string-append (local-file-absolute-file-name base)
|
|
|
|
|
"/" file)
|
|
|
|
|
(basename file)
|
|
|
|
|
#:recursive? recursive?
|
|
|
|
|
#:select? (local-file-select? base))
|
|
|
|
|
(file-append base file)))
|
2018-05-30 16:12:09 -04:00
|
|
|
|
(_
|
|
|
|
|
;; In this case, anything that refers to the result also depends on ITEM,
|
|
|
|
|
;; which isn't great.
|
2018-11-06 03:35:06 -05:00
|
|
|
|
(file-append item "/" file))))
|
2018-05-30 16:12:09 -04:00
|
|
|
|
|
|
|
|
|
(define* (locale-data source domain
|
|
|
|
|
#:optional (directory domain))
|
|
|
|
|
"Return the locale data from 'po/DIRECTORY' in SOURCE, corresponding to
|
|
|
|
|
DOMAIN, a gettext domain."
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(define gettext-minimal
|
|
|
|
|
(specification->package "gettext-minimal"))
|
2018-05-30 16:12:09 -04:00
|
|
|
|
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(ice-9 match) (ice-9 ftw))
|
|
|
|
|
|
|
|
|
|
(define po-directory
|
2018-11-06 03:35:06 -05:00
|
|
|
|
#+(file-append* source (string-append "po/" directory)))
|
2018-05-30 16:12:09 -04:00
|
|
|
|
|
|
|
|
|
(define (compile language)
|
|
|
|
|
(let ((gmo (string-append #$output "/" language "/LC_MESSAGES/"
|
|
|
|
|
#$domain ".mo")))
|
|
|
|
|
(mkdir-p (dirname gmo))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(invoke #+(file-append gettext-minimal "/bin/msgfmt")
|
2018-05-30 16:12:09 -04:00
|
|
|
|
"-c" "--statistics" "--verbose"
|
|
|
|
|
"-o" gmo
|
|
|
|
|
(string-append po-directory "/" language ".po"))))
|
|
|
|
|
|
|
|
|
|
(define (linguas)
|
|
|
|
|
;; Return the list of languages. Note: don't read 'LINGUAS'
|
|
|
|
|
;; because it contains things like 'en@boldquot' that do not have
|
|
|
|
|
;; a corresponding .po file.
|
|
|
|
|
(map (cut basename <> ".po")
|
|
|
|
|
(scandir po-directory
|
|
|
|
|
(cut string-suffix? ".po" <>))))
|
|
|
|
|
|
|
|
|
|
(for-each compile (linguas)))))
|
|
|
|
|
|
|
|
|
|
(computed-file (string-append "guix-locale-" domain)
|
|
|
|
|
build))
|
|
|
|
|
|
2019-04-26 08:54:52 -04:00
|
|
|
|
(define (translate-texi-manuals source)
|
|
|
|
|
"Return the translated texinfo manuals built from SOURCE."
|
|
|
|
|
(define po4a
|
|
|
|
|
(specification->package "po4a"))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
|
|
|
|
|
(define gettext-minimal
|
|
|
|
|
(specification->package "gettext-minimal"))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
|
|
|
|
|
(define glibc-utf8-locales
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(specification->package "glibc-utf8-locales"))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
|
|
|
|
|
(define documentation
|
|
|
|
|
(file-append* source "doc"))
|
|
|
|
|
|
|
|
|
|
(define documentation-po
|
|
|
|
|
(file-append* source "po/doc"))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
|
2019-04-26 08:54:52 -04:00
|
|
|
|
(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)
|
2020-06-22 17:58:42 -04:00
|
|
|
|
(ice-9 vlist) (ice-9 threads)
|
2019-04-26 08:54:52 -04:00
|
|
|
|
(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))
|
|
|
|
|
|
2020-06-22 16:57:26 -04:00
|
|
|
|
(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))
|
|
|
|
|
|
2020-04-21 15:50:34 -04:00
|
|
|
|
(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\")."
|
2021-10-10 16:07:51 -04:00
|
|
|
|
(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)))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
|
2020-04-21 16:23:54 -04:00
|
|
|
|
(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$")))
|
|
|
|
|
|
2020-11-16 05:40:53 -05:00
|
|
|
|
(define parallel-jobs
|
2021-07-09 11:32:05 -04:00
|
|
|
|
;; Limit thread creation by 'n-par-for-each', mostly to put an
|
|
|
|
|
;; upper bound on memory usage.
|
2021-07-09 11:05:28 -04:00
|
|
|
|
(min (parallel-job-count) 4))
|
2020-11-16 05:40:53 -05:00
|
|
|
|
|
2020-06-22 17:40:15 -04:00
|
|
|
|
(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"))
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(setenv "PATH" #+(file-append gettext-minimal "/bin"))
|
2020-06-22 17:40:15 -04:00
|
|
|
|
(setenv "LC_ALL" "en_US.UTF-8")
|
|
|
|
|
(setlocale LC_ALL "en_US.UTF-8")
|
|
|
|
|
|
2020-11-16 05:40:53 -05:00
|
|
|
|
(n-par-for-each parallel-jobs
|
2020-06-22 17:58:42 -04:00
|
|
|
|
(match-lambda
|
|
|
|
|
((language . po)
|
|
|
|
|
(translate-texi "guix" po language
|
|
|
|
|
#:extras '("contributing"))))
|
|
|
|
|
(available-translations "." "guix-manual"))
|
|
|
|
|
|
2020-11-16 05:40:53 -05:00
|
|
|
|
(n-par-for-each parallel-jobs
|
2020-06-22 17:58:42 -04:00
|
|
|
|
(match-lambda
|
|
|
|
|
((language . po)
|
|
|
|
|
(translate-texi "guix-cookbook" po language)))
|
|
|
|
|
(available-translations "." "guix-cookbook"))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
|
2020-04-21 17:05:02 -04:00
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(install-file file #$output))
|
|
|
|
|
(append
|
|
|
|
|
(find-files "." "contributing\\..*\\.texi$")
|
|
|
|
|
(find-files "." "guix\\..*\\.texi$")
|
|
|
|
|
(find-files "." "guix-cookbook\\..*\\.texi$"))))))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
|
|
|
|
|
(computed-file "guix-translated-texinfo" build))
|
|
|
|
|
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(define (info-manual source)
|
|
|
|
|
"Return the Info manual built from SOURCE."
|
|
|
|
|
(define texinfo
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(specification->package "texinfo"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(define graphviz
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(specification->package "graphviz"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
2023-05-20 09:57:13 -04:00
|
|
|
|
(define font-ghostscript
|
|
|
|
|
(specification->package "font-ghostscript"))
|
|
|
|
|
|
2018-12-02 16:53:22 -05:00
|
|
|
|
(define glibc-utf8-locales
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(specification->package "glibc-utf8-locales"))
|
2018-12-02 16:53:22 -05:00
|
|
|
|
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(define documentation
|
2018-11-06 03:35:06 -05:00
|
|
|
|
(file-append* source "doc"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(define examples
|
2018-11-06 03:35:06 -05:00
|
|
|
|
(file-append* source "gnu/system/examples"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
2020-04-21 17:05:02 -04:00
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(ice-9 match))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
|
|
|
|
|
;; Create 'version.texi'.
|
|
|
|
|
;; XXX: Can we use a more meaningful version string yet one that
|
|
|
|
|
;; doesn't change at each commit?
|
|
|
|
|
(call-with-output-file "version.texi"
|
|
|
|
|
(lambda (port)
|
2018-11-05 16:58:19 -05:00
|
|
|
|
(let ((version "0.0-git"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(format port "
|
|
|
|
|
@set UPDATED 1 January 1970
|
|
|
|
|
@set UPDATED-MONTH January 1970
|
|
|
|
|
@set EDITION ~a
|
|
|
|
|
@set VERSION ~a\n" version version))))
|
|
|
|
|
|
|
|
|
|
;; Copy configuration templates that the manual includes.
|
|
|
|
|
(for-each (lambda (template)
|
|
|
|
|
(copy-file template
|
|
|
|
|
(string-append
|
|
|
|
|
"os-config-"
|
|
|
|
|
(basename template ".tmpl")
|
|
|
|
|
".texi")))
|
|
|
|
|
(find-files #$examples "\\.tmpl$"))
|
|
|
|
|
|
|
|
|
|
;; Build graphs.
|
|
|
|
|
(mkdir-p (string-append #$output "/images"))
|
2023-05-20 09:57:13 -04:00
|
|
|
|
|
|
|
|
|
(setenv "XDG_DATA_DIRS" ;fonts needed by 'dot'
|
|
|
|
|
#+(file-append font-ghostscript "/share"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(for-each (lambda (dot-file)
|
|
|
|
|
(invoke #+(file-append graphviz "/bin/dot")
|
|
|
|
|
"-Tpng" "-Gratio=.9" "-Gnodesep=.005"
|
|
|
|
|
"-Granksep=.00005" "-Nfontsize=9"
|
|
|
|
|
"-Nheight=.1" "-Nwidth=.1"
|
|
|
|
|
"-o" (string-append #$output "/images/"
|
|
|
|
|
(basename dot-file ".dot")
|
|
|
|
|
".png")
|
|
|
|
|
dot-file))
|
|
|
|
|
(find-files (string-append #$documentation "/images")
|
|
|
|
|
"\\.dot$"))
|
|
|
|
|
|
|
|
|
|
;; Copy other PNGs.
|
|
|
|
|
(for-each (lambda (png-file)
|
|
|
|
|
(install-file png-file
|
|
|
|
|
(string-append #$output "/images")))
|
|
|
|
|
(find-files (string-append #$documentation "/images")
|
|
|
|
|
"\\.png$"))
|
|
|
|
|
|
|
|
|
|
;; Finally build the manual. Copy it the Texinfo files to $PWD and
|
|
|
|
|
;; add a symlink to the 'images' directory so that 'makeinfo' can
|
|
|
|
|
;; see those images and produce image references in the Info output.
|
|
|
|
|
(copy-recursively #$documentation "."
|
|
|
|
|
#:log (%make-void-port "w"))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
(copy-recursively #+(translate-texi-manuals source) "."
|
|
|
|
|
#:log (%make-void-port "w"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(delete-file-recursively "images")
|
|
|
|
|
(symlink (string-append #$output "/images") "images")
|
|
|
|
|
|
2018-12-02 16:53:22 -05:00
|
|
|
|
;; Provide UTF-8 locales needed by the 'xspara.c' code in makeinfo.
|
|
|
|
|
(setenv "GUIX_LOCPATH"
|
|
|
|
|
#+(file-append glibc-utf8-locales "/lib/locale"))
|
|
|
|
|
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(for-each (lambda (texi)
|
2020-04-21 17:05:02 -04:00
|
|
|
|
(match (string-split (basename texi) #\.)
|
|
|
|
|
(("guix" language "texi")
|
|
|
|
|
;; Create 'version-LL.texi'.
|
|
|
|
|
(symlink "version.texi"
|
|
|
|
|
(string-append "version-" language
|
|
|
|
|
".texi")))
|
|
|
|
|
(_ #f))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(invoke #+(file-append texinfo "/bin/makeinfo")
|
|
|
|
|
texi "-I" #$documentation
|
|
|
|
|
"-I" "."
|
|
|
|
|
"-o" (string-append #$output "/"
|
|
|
|
|
(basename texi ".texi")
|
|
|
|
|
".info")))
|
|
|
|
|
(cons "guix.texi"
|
2020-04-21 17:05:02 -04:00
|
|
|
|
(append (find-files "."
|
|
|
|
|
"^guix\\.[a-z]{2}(_[A-Z]{2})?\\.texi$")
|
|
|
|
|
(find-files "."
|
|
|
|
|
"^guix-cookbook.*\\.texi$"))))
|
2019-01-08 12:07:16 -05:00
|
|
|
|
|
|
|
|
|
;; Compress Info files.
|
|
|
|
|
(setenv "PATH"
|
|
|
|
|
#+(file-append (specification->package "gzip") "/bin"))
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(invoke "gzip" "-9n" file))
|
|
|
|
|
(find-files #$output "\\.info(-[0-9]+)?$")))))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
|
|
|
|
|
(computed-file "guix-manual" build))
|
|
|
|
|
|
2020-04-12 18:08:48 -04:00
|
|
|
|
(define-syntax-rule (prevent-inlining! identifier ...)
|
|
|
|
|
(begin (set! identifier identifier) ...))
|
|
|
|
|
|
|
|
|
|
;; XXX: These procedures are actually used by 'doc/build.scm'. Protect them
|
|
|
|
|
;; from inlining on Guile 3.
|
|
|
|
|
(prevent-inlining! file-append* translate-texi-manuals info-manual)
|
|
|
|
|
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(define* (guile-module-union things #:key (name "guix-module-union"))
|
|
|
|
|
"Return the union of the subset of THINGS (packages, computed files, etc.)
|
|
|
|
|
that provide Guile modules."
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules '((guix build union))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build union))
|
|
|
|
|
|
|
|
|
|
(define (modules directory)
|
|
|
|
|
(string-append directory "/share/guile/site"))
|
|
|
|
|
|
|
|
|
|
(define (objects directory)
|
|
|
|
|
(string-append directory "/lib/guile"))
|
|
|
|
|
|
|
|
|
|
(union-build #$output
|
|
|
|
|
(filter (lambda (directory)
|
|
|
|
|
(or (file-exists? (modules directory))
|
|
|
|
|
(file-exists? (objects directory))))
|
|
|
|
|
'#$things)
|
|
|
|
|
|
|
|
|
|
#:log-port (%make-void-port "w")))))
|
|
|
|
|
|
|
|
|
|
(computed-file name build))
|
|
|
|
|
|
2020-09-30 16:40:59 -04:00
|
|
|
|
(define (quiet-guile guile)
|
|
|
|
|
"Return a wrapper that does the same as the 'guile' executable of GUILE,
|
|
|
|
|
except that it does not complain about locales and falls back to 'en_US.utf8'
|
|
|
|
|
instead of 'C'."
|
|
|
|
|
(define gcc
|
|
|
|
|
(specification->package "gcc-toolchain"))
|
|
|
|
|
|
|
|
|
|
(define source
|
|
|
|
|
(search-path %load-path
|
|
|
|
|
"gnu/packages/aux-files/guile-launcher.c"))
|
|
|
|
|
|
|
|
|
|
(define effective
|
|
|
|
|
(version-major+minor (package-version guile)))
|
|
|
|
|
|
|
|
|
|
(define build
|
|
|
|
|
;; XXX: Reuse <c-compiler> from (guix scripts pack) instead?
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(srfi srfi-26))
|
|
|
|
|
|
|
|
|
|
(mkdir-p (string-append #$output "/bin"))
|
|
|
|
|
|
|
|
|
|
(setenv "PATH" #$(file-append gcc "/bin"))
|
|
|
|
|
(setenv "C_INCLUDE_PATH"
|
|
|
|
|
(string-join
|
|
|
|
|
(map (cut string-append <> "/include")
|
|
|
|
|
'#$(match (bag-transitive-build-inputs
|
|
|
|
|
(package->bag guile))
|
|
|
|
|
(((labels packages . _) ...)
|
|
|
|
|
(filter package? packages))))
|
|
|
|
|
":"))
|
|
|
|
|
(setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))
|
2022-06-18 02:53:11 -04:00
|
|
|
|
(setenv "GUIX_LD_WRAPPER_DISABLE_RPATH" "1")
|
2020-09-30 16:40:59 -04:00
|
|
|
|
|
|
|
|
|
(invoke "gcc" #$(local-file source) "-Wall" "-g0" "-O2"
|
|
|
|
|
"-I" #$(file-append guile "/include/guile/" effective)
|
|
|
|
|
"-L" #$(file-append guile "/lib")
|
2022-06-18 02:53:11 -04:00
|
|
|
|
"-Wl,-rpath" #$(file-append guile "/lib")
|
2020-09-30 16:40:59 -04:00
|
|
|
|
#$(string-append "-lguile-" effective)
|
|
|
|
|
"-o" (string-append #$output "/bin/guile")))))
|
|
|
|
|
|
|
|
|
|
(computed-file "guile-wrapper" build))
|
|
|
|
|
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(define* (guix-command modules
|
2018-06-16 19:35:54 -04:00
|
|
|
|
#:key source (dependencies '())
|
2018-07-02 08:50:36 -04:00
|
|
|
|
guile (guile-version (effective-version)))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
"Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its
|
|
|
|
|
load path."
|
2019-02-14 11:41:42 -05:00
|
|
|
|
(define glibc-utf8-locales
|
2023-02-28 10:47:02 -05:00
|
|
|
|
(specification->package "glibc-utf8-locales"))
|
2019-02-14 11:41:42 -05:00
|
|
|
|
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(define module-directory
|
|
|
|
|
;; To minimize the number of 'stat' calls needed to locate a module,
|
|
|
|
|
;; create the union of all the module directories.
|
|
|
|
|
(guile-module-union (cons modules dependencies)))
|
2018-08-27 16:17:12 -04:00
|
|
|
|
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(program-file "guix-command"
|
|
|
|
|
#~(begin
|
2020-12-07 10:01:36 -05:00
|
|
|
|
;; Remove the empty extension from the search path.
|
|
|
|
|
(set! %load-extensions '(".scm"))
|
|
|
|
|
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(set! %load-path
|
2020-12-07 09:18:20 -05:00
|
|
|
|
(append (list (string-append #$module-directory
|
|
|
|
|
"/share/guile/site/"
|
|
|
|
|
(effective-version))
|
|
|
|
|
(string-append #$guile "/share/guile/"
|
|
|
|
|
(effective-version)))
|
|
|
|
|
%load-path))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
|
|
|
|
(set! %load-compiled-path
|
2020-12-07 09:18:20 -05:00
|
|
|
|
(append (list (string-append #$module-directory
|
|
|
|
|
"/lib/guile/"
|
|
|
|
|
(effective-version)
|
|
|
|
|
"/site-ccache")
|
|
|
|
|
(string-append #$guile "/lib/guile/"
|
|
|
|
|
(effective-version)
|
|
|
|
|
"/ccache"))
|
|
|
|
|
%load-compiled-path))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
2019-02-14 11:41:42 -05:00
|
|
|
|
;; To maximize the chances that locales are set up right
|
|
|
|
|
;; out-of-the-box, bundle "common" UTF-8 locales.
|
|
|
|
|
(let ((locpath (getenv "GUIX_LOCPATH")))
|
|
|
|
|
(setenv "GUIX_LOCPATH"
|
|
|
|
|
(string-append (if locpath
|
|
|
|
|
(string-append locpath ":")
|
|
|
|
|
"")
|
|
|
|
|
#$(file-append glibc-utf8-locales
|
|
|
|
|
"/lib/locale"))))
|
|
|
|
|
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(let ((guix-main (module-ref (resolve-interface '(guix ui))
|
|
|
|
|
'guix-main)))
|
2018-05-30 16:12:09 -04:00
|
|
|
|
#$(if source
|
|
|
|
|
#~(begin
|
|
|
|
|
(bindtextdomain "guix"
|
|
|
|
|
#$(locale-data source "guix"))
|
|
|
|
|
(bindtextdomain "guix-packages"
|
|
|
|
|
#$(locale-data source
|
|
|
|
|
"guix-packages"
|
|
|
|
|
"packages")))
|
|
|
|
|
#t)
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
|
|
|
|
;; XXX: It would be more convenient to change it to:
|
|
|
|
|
;; (exit (apply guix-main (command-line)))
|
2018-07-02 08:50:36 -04:00
|
|
|
|
(apply guix-main (command-line))))
|
2020-09-30 16:40:59 -04:00
|
|
|
|
|
|
|
|
|
;; Use a 'guile' variant that doesn't complain about locales.
|
|
|
|
|
#:guile (quiet-guile guile)))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
2023-05-25 06:31:33 -04:00
|
|
|
|
(define (selinux-policy source daemon)
|
|
|
|
|
"Return the SELinux policy file taken from SOURCE and adjusted to refer to
|
|
|
|
|
DAEMON and to the current configuration variables."
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(copy-file #+(file-append* source "/etc/guix-daemon.cil.in")
|
|
|
|
|
"guix-daemon.cil")
|
|
|
|
|
(substitute* "guix-daemon.cil"
|
|
|
|
|
(("@guix_sysconfdir@") #$%sysconfdir)
|
|
|
|
|
(("@guix_localstatedir@") #$%localstatedir)
|
|
|
|
|
(("@storedir@") #$%storedir)
|
|
|
|
|
(("@prefix@") #$daemon))
|
|
|
|
|
(copy-file "guix-daemon.cil" #$output))))
|
|
|
|
|
|
|
|
|
|
(computed-file "guix-daemon.cil" build))
|
|
|
|
|
|
|
|
|
|
(define (miscellaneous-files source daemon)
|
2018-11-06 09:48:04 -05:00
|
|
|
|
"Return data files taken from SOURCE."
|
|
|
|
|
(file-mapping "guix-misc"
|
|
|
|
|
`(("etc/bash_completion.d/guix"
|
|
|
|
|
,(file-append* source "/etc/completion/bash/guix"))
|
|
|
|
|
("etc/bash_completion.d/guix-daemon"
|
|
|
|
|
,(file-append* source "/etc/completion/bash/guix-daemon"))
|
|
|
|
|
("share/zsh/site-functions/_guix"
|
|
|
|
|
,(file-append* source "/etc/completion/zsh/_guix"))
|
|
|
|
|
("share/fish/vendor_completions.d/guix.fish"
|
|
|
|
|
,(file-append* source "/etc/completion/fish/guix.fish"))
|
2023-05-25 06:31:33 -04:00
|
|
|
|
("share/selinux/guix-daemon.cil"
|
|
|
|
|
,(selinux-policy source daemon))
|
2020-07-09 09:52:46 -04:00
|
|
|
|
("share/guix/berlin.guix.gnu.org.pub"
|
2018-12-03 10:19:10 -05:00
|
|
|
|
,(file-append* source
|
2020-07-09 09:52:46 -04:00
|
|
|
|
"/etc/substitutes/berlin.guix.gnu.org.pub"))
|
2019-05-01 05:05:47 -04:00
|
|
|
|
("share/guix/ci.guix.gnu.org.pub" ;alias
|
2020-07-09 09:52:46 -04:00
|
|
|
|
,(file-append* source "/etc/substitutes/berlin.guix.gnu.org.pub"))
|
2018-12-03 10:19:10 -05:00
|
|
|
|
("share/guix/ci.guix.info.pub" ;alias
|
2021-06-07 06:00:09 -04:00
|
|
|
|
,(file-append* source "/etc/substitutes/berlin.guix.gnu.org.pub"))
|
|
|
|
|
("share/guix/bordeaux.guix.gnu.org.pub"
|
|
|
|
|
,(file-append* source "/etc/substitutes/bordeaux.guix.gnu.org.pub")))))
|
2018-11-06 09:48:04 -05:00
|
|
|
|
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(define* (whole-package name modules dependencies
|
2018-05-30 16:12:09 -04:00
|
|
|
|
#:key
|
|
|
|
|
(guile-version (effective-version))
|
2018-11-06 09:48:04 -05:00
|
|
|
|
info daemon miscellany
|
2018-11-05 17:26:37 -05:00
|
|
|
|
guile
|
2018-05-30 16:12:09 -04:00
|
|
|
|
(command (guix-command modules
|
|
|
|
|
#:dependencies dependencies
|
2018-07-02 08:50:36 -04:00
|
|
|
|
#:guile guile
|
2018-05-30 16:12:09 -04:00
|
|
|
|
#:guile-version guile-version)))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
"Return the whole Guix package NAME that uses MODULES, a derivation of all
|
2019-01-07 16:57:34 -05:00
|
|
|
|
the modules (under share/guile/site and lib/guile), and DEPENDENCIES, a list
|
|
|
|
|
of packages depended on. COMMAND is the 'guix' program to use; INFO is the
|
|
|
|
|
Info manual."
|
2019-02-03 16:13:55 -05:00
|
|
|
|
(define (wrap daemon)
|
|
|
|
|
(program-file "guix-daemon"
|
|
|
|
|
#~(begin
|
2019-05-26 16:01:42 -04:00
|
|
|
|
;; Refer to the right 'guix' command for 'guix
|
|
|
|
|
;; substitute' & co.
|
2019-02-03 16:13:55 -05:00
|
|
|
|
(setenv "GUIX" #$command)
|
2019-05-26 16:01:42 -04:00
|
|
|
|
|
|
|
|
|
;; Honor the user's settings rather than those hardcoded
|
|
|
|
|
;; in the 'guix-daemon' package.
|
|
|
|
|
(unless (getenv "GUIX_STATE_DIRECTORY")
|
|
|
|
|
(setenv "GUIX_STATE_DIRECTORY"
|
|
|
|
|
#$(string-append %localstatedir "/guix")))
|
|
|
|
|
(unless (getenv "GUIX_CONFIGURATION_DIRECTORY")
|
|
|
|
|
(setenv "GUIX_CONFIGURATION_DIRECTORY"
|
|
|
|
|
#$(string-append %sysconfdir "/guix")))
|
|
|
|
|
(unless (getenv "NIX_STORE_DIR")
|
2019-05-28 17:21:27 -04:00
|
|
|
|
(setenv "NIX_STORE_DIR" #$%storedir))
|
2019-05-26 16:01:42 -04:00
|
|
|
|
|
2019-02-03 16:13:55 -05:00
|
|
|
|
(apply execl #$(file-append daemon "/bin/guix-daemon")
|
2022-06-26 09:33:17 -04:00
|
|
|
|
"guix-daemon" (cdr (command-line))))
|
|
|
|
|
#:guile guile))
|
2019-02-03 16:13:55 -05:00
|
|
|
|
|
2018-05-30 16:12:09 -04:00
|
|
|
|
(computed-file name
|
|
|
|
|
(with-imported-modules '((guix build utils))
|
|
|
|
|
#~(begin
|
|
|
|
|
(use-modules (guix build utils))
|
2018-11-06 09:48:04 -05:00
|
|
|
|
|
2019-02-03 16:13:55 -05:00
|
|
|
|
(define daemon
|
|
|
|
|
#$(and daemon (wrap daemon)))
|
|
|
|
|
|
2018-05-30 16:12:09 -04:00
|
|
|
|
(mkdir-p (string-append #$output "/bin"))
|
|
|
|
|
(symlink #$command
|
|
|
|
|
(string-append #$output "/bin/guix"))
|
|
|
|
|
|
2019-02-03 16:13:55 -05:00
|
|
|
|
(when daemon
|
|
|
|
|
(symlink daemon
|
2018-06-14 15:59:23 -04:00
|
|
|
|
(string-append #$output "/bin/guix-daemon")))
|
|
|
|
|
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(let ((share (string-append #$output "/share"))
|
|
|
|
|
(lib (string-append #$output "/lib"))
|
|
|
|
|
(info #$info))
|
|
|
|
|
(mkdir-p share)
|
|
|
|
|
(symlink #$(file-append modules "/share/guile")
|
|
|
|
|
(string-append share "/guile"))
|
2018-05-31 07:42:43 -04:00
|
|
|
|
(when info
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(symlink #$info (string-append share "/info")))
|
|
|
|
|
|
|
|
|
|
(mkdir-p lib)
|
|
|
|
|
(symlink #$(file-append modules "/lib/guile")
|
|
|
|
|
(string-append lib "/guile")))
|
2018-06-16 19:35:54 -04:00
|
|
|
|
|
2018-11-06 09:48:04 -05:00
|
|
|
|
(when #$miscellany
|
|
|
|
|
(copy-recursively #$miscellany #$output
|
2019-01-07 16:57:34 -05:00
|
|
|
|
#:log (%make-void-port "w")))))))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
2020-12-03 08:34:26 -05:00
|
|
|
|
(define (transitive-package-dependencies package)
|
|
|
|
|
"Return the list of packages propagated by PACKAGE, including PACKAGE
|
|
|
|
|
itself."
|
|
|
|
|
(match (package-transitive-propagated-inputs package)
|
|
|
|
|
(((labels packages _ ...) ...)
|
|
|
|
|
(cons package packages))))
|
|
|
|
|
|
2021-01-27 08:46:10 -05:00
|
|
|
|
(define* (compiled-guix source #:key
|
|
|
|
|
(version %guix-version)
|
|
|
|
|
(channel-metadata #f)
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(pull-version 1)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(name (string-append "guix-" version))
|
|
|
|
|
(guile-version (effective-version))
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(guile-for-build (default-guile))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(gzip (specification->package "gzip"))
|
|
|
|
|
(bzip2 (specification->package "bzip2"))
|
|
|
|
|
(xz (specification->package "xz"))
|
|
|
|
|
(guix (specification->package "guix")))
|
|
|
|
|
"Return a file-like object that contains a compiled Guix."
|
2020-11-22 09:12:17 -05:00
|
|
|
|
(define guile-avahi
|
|
|
|
|
(specification->package "guile-avahi"))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define guile-json
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(specification->package "guile-json"))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
(define guile-ssh
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(specification->package "guile-ssh"))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2020-10-22 20:40:17 -04:00
|
|
|
|
(define guile-lib
|
|
|
|
|
(specification->package "guile-lib"))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define guile-git
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(specification->package "guile-git"))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2018-05-27 09:43:52 -04:00
|
|
|
|
(define guile-sqlite3
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(specification->package "guile-sqlite3"))
|
2018-05-27 09:43:52 -04:00
|
|
|
|
|
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-07-27 10:36:39 -04:00
|
|
|
|
(define guile-zlib
|
|
|
|
|
(specification->package "guile-zlib"))
|
|
|
|
|
|
|
|
|
|
(define guile-lzlib
|
|
|
|
|
(specification->package "guile-lzlib"))
|
|
|
|
|
|
2021-01-14 03:10:00 -05:00
|
|
|
|
(define guile-zstd
|
|
|
|
|
(specification->package "guile-zstd"))
|
|
|
|
|
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
(define guile-gcrypt
|
2019-01-07 05:38:53 -05:00
|
|
|
|
(specification->package "guile-gcrypt"))
|
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)
* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
#:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules. Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-08-31 11:07:07 -04:00
|
|
|
|
|
2020-02-21 10:41:44 -05:00
|
|
|
|
(define guile-semver
|
|
|
|
|
(specification->package "guile-semver"))
|
|
|
|
|
|
2022-10-18 04:32:27 -04:00
|
|
|
|
(define guile-gnutls
|
|
|
|
|
(specification->package "guile-gnutls"))
|
2018-06-27 16:33:36 -04:00
|
|
|
|
|
2021-05-14 16:52:46 -04:00
|
|
|
|
(define disarchive
|
|
|
|
|
(specification->package "disarchive"))
|
|
|
|
|
|
2021-12-22 17:35:56 -05:00
|
|
|
|
(define guile-lzma
|
|
|
|
|
(specification->package "guile-lzma"))
|
|
|
|
|
|
2023-09-11 08:54:29 -04:00
|
|
|
|
(define git
|
|
|
|
|
(specification->package "git-minimal"))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define dependencies
|
2020-12-03 08:34:26 -05:00
|
|
|
|
(append-map transitive-package-dependencies
|
2022-10-18 04:32:27 -04:00
|
|
|
|
(list guile-gcrypt guile-gnutls guile-git guile-avahi
|
2020-12-03 08:34:26 -05:00
|
|
|
|
guile-json guile-semver guile-ssh guile-sqlite3
|
2020-10-22 20:40:17 -04:00
|
|
|
|
guile-lib guile-zlib guile-lzlib guile-zstd)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
(define *core-modules*
|
|
|
|
|
(scheme-node "guix-core"
|
|
|
|
|
'((guix)
|
|
|
|
|
(guix monad-repl)
|
|
|
|
|
(guix packages)
|
|
|
|
|
(guix download)
|
|
|
|
|
(guix discovery)
|
|
|
|
|
(guix profiles)
|
|
|
|
|
(guix build-system gnu)
|
|
|
|
|
(guix build-system trivial)
|
|
|
|
|
(guix build profiles)
|
|
|
|
|
(guix build gnu-build-system))
|
|
|
|
|
|
|
|
|
|
;; Provide a dummy (guix config) with the default version
|
|
|
|
|
;; number, storedir, etc. This is so that "guix-core" is the
|
|
|
|
|
;; same across all installations and doesn't need to be
|
|
|
|
|
;; rebuilt when the version changes, which in turn means we
|
|
|
|
|
;; can have substitutes for it.
|
|
|
|
|
#:extra-modules
|
2021-08-09 06:28:17 -04:00
|
|
|
|
`(((guix config)
|
|
|
|
|
=> ,(make-config.scm
|
|
|
|
|
#:config-variables %default-config-variables)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2018-06-02 09:40:03 -04:00
|
|
|
|
;; (guix man-db) is needed at build-time by (guix profiles)
|
|
|
|
|
;; but we don't need to compile it; not compiling it allows
|
|
|
|
|
;; us to avoid an extra dependency on guile-gdbm-ffi.
|
|
|
|
|
#:extra-files
|
2018-06-04 09:40:09 -04:00
|
|
|
|
`(("guix/man-db.scm" ,(local-file "../guix/man-db.scm"))
|
2019-04-26 08:54:52 -04:00
|
|
|
|
("guix/build/po.scm" ,(local-file "../guix/build/po.scm"))
|
2018-06-04 09:40:09 -04:00
|
|
|
|
("guix/store/schema.sql"
|
|
|
|
|
,(local-file "../guix/store/schema.sql")))
|
2018-06-02 09:40:03 -04:00
|
|
|
|
|
2021-03-19 23:03:25 -04:00
|
|
|
|
#:extensions (list guile-gcrypt
|
|
|
|
|
guile-json) ;for (guix swh)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
|
|
|
|
(define *extra-modules*
|
|
|
|
|
(scheme-node "guix-extra"
|
|
|
|
|
(filter-map (match-lambda
|
|
|
|
|
(('guix 'scripts _ ..1) #f)
|
2018-06-02 09:40:03 -04:00
|
|
|
|
(('guix 'man-db) #f)
|
2019-06-15 15:47:57 -04:00
|
|
|
|
(('guix 'tests _ ...) #f)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(name name))
|
|
|
|
|
(scheme-modules* source "guix"))
|
|
|
|
|
(list *core-modules*)
|
2021-01-04 16:10:49 -05:00
|
|
|
|
|
|
|
|
|
#:extra-files
|
|
|
|
|
`(("guix/graph.js" ,(local-file "../guix/graph.js"))
|
|
|
|
|
("guix/d3.v3.js" ,(local-file "../guix/d3.v3.js")))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-05-06 10:41:50 -04:00
|
|
|
|
(define *core-package-modules*
|
|
|
|
|
(scheme-node "guix-packages-base"
|
2018-03-23 10:36:12 -04:00
|
|
|
|
`((gnu packages)
|
2018-05-06 10:41:50 -04:00
|
|
|
|
(gnu packages base))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(list *core-modules* *extra-modules*)
|
|
|
|
|
#:extensions dependencies
|
2018-05-06 10:41:50 -04:00
|
|
|
|
|
|
|
|
|
;; Add all the non-Scheme files here. We must do it here so
|
|
|
|
|
;; that 'search-patches' & co. can find them. Ideally we'd
|
|
|
|
|
;; keep them next to the .scm files that use them but it's
|
|
|
|
|
;; difficult to do (XXX).
|
|
|
|
|
#:extra-files
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(file-imports source "gnu/packages"
|
|
|
|
|
(lambda (file stat)
|
|
|
|
|
(and (eq? 'regular (stat:type stat))
|
|
|
|
|
(not (string-suffix? ".scm" file))
|
|
|
|
|
(not (string-suffix? ".go" file))
|
|
|
|
|
(not (string-prefix? ".#" file))
|
|
|
|
|
(not (string-suffix? "~" file)))))
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-05-06 10:41:50 -04:00
|
|
|
|
(define *package-modules*
|
|
|
|
|
(scheme-node "guix-packages"
|
|
|
|
|
(scheme-modules* source "gnu/packages")
|
|
|
|
|
(list *core-modules* *extra-modules* *core-package-modules*)
|
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define *system-modules*
|
|
|
|
|
(scheme-node "guix-system"
|
|
|
|
|
`((gnu system)
|
|
|
|
|
(gnu services)
|
2019-04-03 12:20:36 -04:00
|
|
|
|
,@(scheme-modules* source "gnu/bootloader")
|
2018-11-23 22:25:03 -05:00
|
|
|
|
,@(scheme-modules* source "gnu/system")
|
2019-07-06 20:02:02 -04:00
|
|
|
|
,@(scheme-modules* source "gnu/services")
|
2022-05-22 10:06:07 -04:00
|
|
|
|
,@(scheme-modules* source "gnu/machine")
|
2022-05-23 16:37:26 -04:00
|
|
|
|
,@(scheme-modules* source "guix/platforms/"))
|
2018-05-06 10:41:50 -04:00
|
|
|
|
(list *core-package-modules* *package-modules*
|
|
|
|
|
*extra-modules* *core-modules*)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:extra-files
|
2018-06-01 18:04:39 -04:00
|
|
|
|
(append (file-imports source "gnu/system/examples"
|
|
|
|
|
(const #t))
|
2019-01-18 17:16:19 -05:00
|
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
|
;; All the installer code is on the build-side.
|
|
|
|
|
(file-imports source "gnu/installer/"
|
|
|
|
|
(const #t))
|
2018-06-01 18:04:39 -04:00
|
|
|
|
;; Build-side code that we don't build. Some of
|
|
|
|
|
;; these depend on guile-rsvg, the Shepherd, etc.
|
|
|
|
|
(file-imports source "gnu/build" (const #t)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:guile-for-build
|
|
|
|
|
guile-for-build))
|
|
|
|
|
|
2021-09-10 05:53:02 -04:00
|
|
|
|
(define *home-modules*
|
|
|
|
|
(scheme-node "guix-home"
|
|
|
|
|
`((gnu home)
|
2021-10-09 09:51:25 -04:00
|
|
|
|
(gnu home services)
|
2021-10-08 14:17:06 -04:00
|
|
|
|
,@(scheme-modules* source "gnu/home/services"))
|
2021-09-10 05:53:02 -04:00
|
|
|
|
(list *core-package-modules* *package-modules*
|
|
|
|
|
*extra-modules* *core-modules* *system-modules*)
|
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2021-10-12 17:47:59 -04:00
|
|
|
|
(define *core-cli-modules*
|
|
|
|
|
;; Core command-line interface modules that do not depend on (gnu system
|
|
|
|
|
;; …) or (gnu home …), and not even on *PACKAGE-MODULES*.
|
|
|
|
|
(scheme-node "guix-cli-core"
|
|
|
|
|
(remove (match-lambda
|
|
|
|
|
(('guix 'scripts 'system . _) #t)
|
|
|
|
|
(('guix 'scripts 'environment) #t)
|
|
|
|
|
(('guix 'scripts 'container . _) #t)
|
|
|
|
|
(('guix 'scripts 'deploy) #t)
|
|
|
|
|
(('guix 'scripts 'home . _) #t)
|
|
|
|
|
(('guix 'scripts 'import . _) #t)
|
2022-07-31 17:03:36 -04:00
|
|
|
|
(('guix 'scripts 'gc) #t) ;autoloads (gnu home)
|
2021-10-12 17:47:59 -04:00
|
|
|
|
(('guix 'pack) #t)
|
|
|
|
|
(_ #f))
|
|
|
|
|
(scheme-modules* source "guix/scripts"))
|
|
|
|
|
(list *core-modules* *extra-modules*
|
|
|
|
|
*core-package-modules*)
|
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define *cli-modules*
|
|
|
|
|
(scheme-node "guix-cli"
|
2018-11-26 11:17:45 -05:00
|
|
|
|
(append (scheme-modules* source "/guix/scripts")
|
|
|
|
|
`((gnu ci)))
|
2018-05-06 10:41:50 -04:00
|
|
|
|
(list *core-modules* *extra-modules*
|
|
|
|
|
*core-package-modules* *package-modules*
|
2021-10-12 17:47:59 -04:00
|
|
|
|
*core-cli-modules* *system-modules* *home-modules*)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2019-01-22 16:54:04 -05:00
|
|
|
|
(define *system-test-modules*
|
|
|
|
|
;; Ship these modules mostly so (gnu ci) can discover them.
|
|
|
|
|
(scheme-node "guix-system-tests"
|
|
|
|
|
`((gnu tests)
|
|
|
|
|
,@(scheme-modules* source "gnu/tests"))
|
|
|
|
|
(list *core-package-modules* *package-modules*
|
|
|
|
|
*extra-modules* *system-modules* *core-modules*
|
|
|
|
|
*cli-modules*) ;for (guix scripts pack), etc.
|
2021-08-02 16:06:04 -04:00
|
|
|
|
#:extra-files (file-imports source "gnu/tests/data"
|
|
|
|
|
(const #t))
|
2019-01-22 16:54:04 -05:00
|
|
|
|
#:extensions dependencies
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define *config*
|
|
|
|
|
(scheme-node "guix-config"
|
|
|
|
|
'()
|
|
|
|
|
#:extra-modules
|
|
|
|
|
`(((guix config)
|
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-07-27 10:36:39 -04:00
|
|
|
|
=> ,(make-config.scm #:gzip gzip
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:bzip2 bzip2
|
|
|
|
|
#:xz xz
|
2023-09-11 08:54:29 -04:00
|
|
|
|
#:git git
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:package-name
|
|
|
|
|
%guix-package-name
|
|
|
|
|
#:package-version
|
|
|
|
|
version
|
2021-01-27 08:46:10 -05:00
|
|
|
|
#:channel-metadata
|
|
|
|
|
channel-metadata
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:bug-report-address
|
|
|
|
|
%guix-bug-report-address
|
|
|
|
|
#:home-page-url
|
|
|
|
|
%guix-home-page-url)))
|
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
2018-06-16 19:35:54 -04:00
|
|
|
|
(define (built-modules node-subset)
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(directory-union (string-append name "-modules")
|
2018-06-16 19:35:54 -04:00
|
|
|
|
(append-map node-subset
|
2018-05-30 05:10:27 -04:00
|
|
|
|
|
|
|
|
|
;; Note: *CONFIG* comes first so that it
|
|
|
|
|
;; overrides the (guix config) module that
|
|
|
|
|
;; comes with *CORE-MODULES*.
|
|
|
|
|
(list *config*
|
|
|
|
|
*cli-modules*
|
2021-10-12 17:47:59 -04:00
|
|
|
|
*core-cli-modules*
|
2019-01-20 16:59:28 -05:00
|
|
|
|
*system-test-modules*
|
2018-05-30 05:10:27 -04:00
|
|
|
|
*system-modules*
|
2021-09-10 05:53:02 -04:00
|
|
|
|
*home-modules*
|
2018-05-30 05:10:27 -04:00
|
|
|
|
*package-modules*
|
|
|
|
|
*core-package-modules*
|
|
|
|
|
*extra-modules*
|
|
|
|
|
*core-modules*))
|
|
|
|
|
|
|
|
|
|
;; Silently choose the first entry upon collision so that
|
|
|
|
|
;; we choose *CONFIG*.
|
|
|
|
|
#:resolve-collision 'first
|
|
|
|
|
|
|
|
|
|
;; When we do (add-to-store "utils.scm"), "utils.scm" must
|
|
|
|
|
;; be a regular file, not a symlink. Thus, arrange so that
|
|
|
|
|
;; regular files appear as regular files in the final
|
|
|
|
|
;; output.
|
|
|
|
|
#:copy? #t
|
|
|
|
|
#:quiet? #t))
|
|
|
|
|
|
|
|
|
|
;; Version 0 of 'guix pull' meant we'd just return Scheme modules.
|
|
|
|
|
;; Version 1 is when we return the full package.
|
|
|
|
|
(cond ((= 1 pull-version)
|
|
|
|
|
;; The whole package, with a standard file hierarchy.
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(let* ((modules (built-modules (compose list node-source+compiled)))
|
2023-05-25 06:31:33 -04:00
|
|
|
|
(daemon (specification->package "guix-daemon"))
|
2019-01-07 16:57:34 -05:00
|
|
|
|
(command (guix-command modules
|
2018-06-16 19:35:54 -04:00
|
|
|
|
#:source source
|
2021-05-14 16:52:46 -04:00
|
|
|
|
#:dependencies
|
2021-12-22 17:35:56 -05:00
|
|
|
|
(cons* disarchive
|
|
|
|
|
guile-lzma
|
|
|
|
|
dependencies)
|
2018-07-02 08:50:36 -04:00
|
|
|
|
#:guile guile-for-build
|
2018-06-16 19:35:54 -04:00
|
|
|
|
#:guile-version guile-version)))
|
|
|
|
|
(whole-package name modules dependencies
|
2018-05-30 16:12:09 -04:00
|
|
|
|
#:command command
|
2018-07-02 08:50:36 -04:00
|
|
|
|
#:guile guile-for-build
|
2018-06-14 15:59:23 -04:00
|
|
|
|
|
|
|
|
|
;; Include 'guix-daemon'. XXX: Here we inject an
|
|
|
|
|
;; older snapshot of guix-daemon, but that's a good
|
|
|
|
|
;; enough approximation for now.
|
2023-05-25 06:31:33 -04:00
|
|
|
|
#:daemon daemon
|
2018-06-14 15:59:23 -04:00
|
|
|
|
|
2018-05-31 07:42:43 -04:00
|
|
|
|
#:info (info-manual source)
|
2023-05-25 06:31:33 -04:00
|
|
|
|
#:miscellany (miscellaneous-files source daemon)
|
2018-05-30 16:12:09 -04:00
|
|
|
|
#:guile-version guile-version)))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
((= 0 pull-version)
|
2018-06-16 19:35:54 -04:00
|
|
|
|
;; Legacy 'guix pull': return the .scm and .go files as one
|
|
|
|
|
;; directory.
|
|
|
|
|
(built-modules (lambda (node)
|
|
|
|
|
(list (node-source node)
|
|
|
|
|
(node-compiled node)))))
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(else
|
|
|
|
|
;; Unsupported 'guix pull' version.
|
|
|
|
|
#f)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Generating (guix config).
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %persona-variables
|
|
|
|
|
;; (guix config) variables that define Guix's persona.
|
|
|
|
|
'(%guix-package-name
|
|
|
|
|
%guix-version
|
|
|
|
|
%guix-bug-report-address
|
|
|
|
|
%guix-home-page-url))
|
|
|
|
|
|
|
|
|
|
(define %config-variables
|
2018-06-18 16:43:44 -04:00
|
|
|
|
;; (guix config) variables corresponding to Guix configuration.
|
|
|
|
|
(letrec-syntax ((variables (syntax-rules ()
|
|
|
|
|
((_)
|
|
|
|
|
'())
|
|
|
|
|
((_ variable rest ...)
|
|
|
|
|
(cons `(variable . ,variable)
|
|
|
|
|
(variables rest ...))))))
|
2019-02-16 17:51:01 -05:00
|
|
|
|
(variables %localstatedir %storedir %sysconfdir)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2021-08-09 06:28:17 -04:00
|
|
|
|
(define %default-config-variables
|
|
|
|
|
;; Default values of the configuration variables above.
|
|
|
|
|
`((%localstatedir . "/var")
|
|
|
|
|
(%storedir . "/gnu/store")
|
|
|
|
|
(%sysconfdir . "/etc")))
|
|
|
|
|
|
2023-09-11 08:54:29 -04:00
|
|
|
|
(define* (make-config.scm #:key gzip xz bzip2 git
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(package-name "GNU Guix")
|
|
|
|
|
(package-version "0")
|
2021-01-27 08:46:10 -05:00
|
|
|
|
(channel-metadata #f)
|
2021-08-09 06:28:17 -04:00
|
|
|
|
(config-variables %config-variables)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(bug-report-address "bug-guix@gnu.org")
|
2019-07-15 12:46:39 -04:00
|
|
|
|
(home-page-url "https://guix.gnu.org"))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
;; Hack so that Geiser is not confused.
|
|
|
|
|
(define defmod 'define-module)
|
|
|
|
|
|
|
|
|
|
(scheme-file "config.scm"
|
2018-04-10 18:55:13 -04:00
|
|
|
|
#~(;; The following expressions get spliced.
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(#$defmod (guix config)
|
2022-11-14 05:05:22 -05:00
|
|
|
|
|
|
|
|
|
;; Mark it as non-declarative to prevent cross-module
|
|
|
|
|
;; inlining that could lead to inlining %GUIX-VERSION in
|
|
|
|
|
;; (guix ui).
|
|
|
|
|
#:declarative? #f
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:export (%guix-package-name
|
|
|
|
|
%guix-version
|
|
|
|
|
%guix-bug-report-address
|
|
|
|
|
%guix-home-page-url
|
2021-01-27 08:46:10 -05:00
|
|
|
|
%channel-metadata
|
2019-02-16 17:51:01 -05:00
|
|
|
|
%system
|
2018-06-18 17:56:16 -04:00
|
|
|
|
%store-directory
|
|
|
|
|
%state-directory
|
|
|
|
|
%store-database-directory
|
|
|
|
|
%config-directory
|
2023-09-11 08:54:29 -04:00
|
|
|
|
%git
|
2018-03-23 10:36:12 -04:00
|
|
|
|
%gzip
|
|
|
|
|
%bzip2
|
2018-06-18 16:53:25 -04:00
|
|
|
|
%xz))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2019-02-16 17:51:01 -05:00
|
|
|
|
(define %system
|
|
|
|
|
#$(%current-system))
|
|
|
|
|
|
2018-04-10 18:22:03 -04:00
|
|
|
|
#$@(map (match-lambda
|
|
|
|
|
((name . value)
|
|
|
|
|
#~(define-public #$name #$value)))
|
2021-08-09 06:28:17 -04:00
|
|
|
|
config-variables)
|
2018-04-10 18:22:03 -04:00
|
|
|
|
|
2018-06-18 17:56:16 -04:00
|
|
|
|
(define %store-directory
|
|
|
|
|
(or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
|
|
|
|
|
%storedir))
|
|
|
|
|
|
|
|
|
|
(define %state-directory
|
|
|
|
|
;; This must match `NIX_STATE_DIR' as defined in
|
|
|
|
|
;; `nix/local.mk'.
|
2019-02-03 16:10:06 -05:00
|
|
|
|
(or (getenv "GUIX_STATE_DIRECTORY")
|
2018-06-18 17:56:16 -04:00
|
|
|
|
(string-append %localstatedir "/guix")))
|
|
|
|
|
|
|
|
|
|
(define %store-database-directory
|
2019-02-03 16:10:06 -05:00
|
|
|
|
(or (getenv "GUIX_DATABASE_DIRECTORY")
|
2018-06-18 17:56:16 -04:00
|
|
|
|
(string-append %state-directory "/db")))
|
|
|
|
|
|
|
|
|
|
(define %config-directory
|
|
|
|
|
;; This must match `GUIX_CONFIGURATION_DIRECTORY' as
|
|
|
|
|
;; defined in `nix/local.mk'.
|
|
|
|
|
(or (getenv "GUIX_CONFIGURATION_DIRECTORY")
|
|
|
|
|
(string-append %sysconfdir "/guix")))
|
|
|
|
|
|
2018-04-10 18:22:03 -04:00
|
|
|
|
(define %guix-package-name #$package-name)
|
|
|
|
|
(define %guix-version #$package-version)
|
|
|
|
|
(define %guix-bug-report-address #$bug-report-address)
|
|
|
|
|
(define %guix-home-page-url #$home-page-url)
|
|
|
|
|
|
2021-01-27 08:46:10 -05:00
|
|
|
|
(define %channel-metadata
|
|
|
|
|
;; Metadata for the 'guix' channel in use. This
|
|
|
|
|
;; information is used by (guix describe).
|
|
|
|
|
'#$channel-metadata)
|
|
|
|
|
|
2023-09-11 08:54:29 -04:00
|
|
|
|
(define %git
|
|
|
|
|
#+(and git (file-append git "/bin/git")))
|
2018-04-10 18:22:03 -04:00
|
|
|
|
(define %gzip
|
|
|
|
|
#+(and gzip (file-append gzip "/bin/gzip")))
|
|
|
|
|
(define %bzip2
|
|
|
|
|
#+(and bzip2 (file-append bzip2 "/bin/bzip2")))
|
|
|
|
|
(define %xz
|
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-07-27 10:36:39 -04:00
|
|
|
|
#+(and xz (file-append xz "/bin/xz"))))
|
2018-04-10 18:55:13 -04:00
|
|
|
|
|
|
|
|
|
;; Guile 2.0 *requires* the 'define-module' to be at the
|
2018-06-18 16:53:25 -04:00
|
|
|
|
;; top-level or the 'toplevel-ref' in the resulting .go file are
|
2018-04-10 18:55:13 -04:00
|
|
|
|
;; made relative to a nonexistent anonymous module.
|
|
|
|
|
#:splice? #t))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Building.
|
|
|
|
|
;;;
|
|
|
|
|
|
2018-06-01 18:02:23 -04:00
|
|
|
|
(define* (compiled-modules name module-tree module-files
|
2018-03-23 10:36:12 -04:00
|
|
|
|
#:optional
|
|
|
|
|
(dependencies '())
|
|
|
|
|
(dependencies-compiled '())
|
|
|
|
|
#:key
|
|
|
|
|
(extensions '()) ;full-blown Guile packages
|
|
|
|
|
parallel?
|
|
|
|
|
guile-for-build)
|
2018-06-01 18:02:23 -04:00
|
|
|
|
"Build all the MODULE-FILES from MODULE-TREE. MODULE-FILES must be a list
|
|
|
|
|
like '(\"guix/foo.scm\" \"gnu/bar.scm\") and MODULE-TREE is the directory
|
|
|
|
|
containing MODULE-FILES and possibly other files as well."
|
2018-03-23 10:36:12 -04:00
|
|
|
|
;; This is a non-monadic, enhanced version of 'compiled-file' from (guix
|
|
|
|
|
;; gexp).
|
|
|
|
|
(define build
|
|
|
|
|
(with-imported-modules (source-module-closure
|
|
|
|
|
'((guix build compile)
|
|
|
|
|
(guix build utils)))
|
|
|
|
|
#~(begin
|
2023-06-22 02:30:25 -04:00
|
|
|
|
(use-modules (srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(ice-9 match)
|
|
|
|
|
(ice-9 format)
|
|
|
|
|
(ice-9 threads)
|
|
|
|
|
(guix build compile)
|
|
|
|
|
(guix build utils))
|
|
|
|
|
|
|
|
|
|
(define (regular? file)
|
|
|
|
|
(not (member file '("." ".."))))
|
|
|
|
|
|
|
|
|
|
(define (report-load file total completed)
|
|
|
|
|
(display #\cr)
|
|
|
|
|
(format #t
|
2019-01-27 12:15:05 -05:00
|
|
|
|
"[~3@a/~3@a] loading...\t~5,1f% of ~d files"
|
|
|
|
|
|
|
|
|
|
;; Note: Multiply TOTAL by two to account for the
|
|
|
|
|
;; compilation phase that follows.
|
|
|
|
|
completed (* total 2)
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(* 100. (/ completed total)) total)
|
|
|
|
|
(force-output))
|
|
|
|
|
|
|
|
|
|
(define (report-compilation file total completed)
|
|
|
|
|
(display #\cr)
|
2019-01-27 12:15:05 -05:00
|
|
|
|
(format #t "[~3@a/~3@a] compiling...\t~5,1f% of ~d files"
|
|
|
|
|
|
|
|
|
|
;; Add TOTAL to account for the load phase that came
|
|
|
|
|
;; before.
|
|
|
|
|
(+ total completed) (* total 2)
|
|
|
|
|
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(* 100. (/ completed total)) total)
|
|
|
|
|
(force-output))
|
|
|
|
|
|
2023-09-18 02:09:50 -04:00
|
|
|
|
(define* (process-directory directory files output #:key (size 25))
|
|
|
|
|
(let ((chunks (unfold
|
|
|
|
|
(lambda (seed) (< (length seed) size)) ;p
|
|
|
|
|
(cute take <> size) ;f
|
|
|
|
|
(cute drop <> size) ;g
|
|
|
|
|
files ;seed
|
|
|
|
|
list))) ;tail
|
2023-06-22 02:30:25 -04:00
|
|
|
|
(for-each
|
|
|
|
|
(lambda (chunk)
|
|
|
|
|
;; Hide compilation warnings.
|
|
|
|
|
(parameterize ((current-warning-port (%make-void-port "w")))
|
|
|
|
|
(compile-files directory output chunk
|
|
|
|
|
#:workers (parallel-job-count)
|
|
|
|
|
#:report-load report-load
|
|
|
|
|
#:report-compilation report-compilation)
|
|
|
|
|
(gc)))
|
|
|
|
|
chunks)))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
2019-01-27 12:15:05 -05:00
|
|
|
|
(setvbuf (current-output-port) 'line)
|
|
|
|
|
(setvbuf (current-error-port) 'line)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
(set! %load-path (cons #+module-tree %load-path))
|
|
|
|
|
(set! %load-path
|
|
|
|
|
(append '#+dependencies
|
|
|
|
|
(map (lambda (extension)
|
|
|
|
|
(string-append extension "/share/guile/site/"
|
|
|
|
|
(effective-version)))
|
|
|
|
|
'#+extensions)
|
|
|
|
|
%load-path))
|
|
|
|
|
|
|
|
|
|
(set! %load-compiled-path
|
|
|
|
|
(append '#+dependencies-compiled
|
|
|
|
|
(map (lambda (extension)
|
|
|
|
|
(string-append extension "/lib/guile/"
|
|
|
|
|
(effective-version)
|
|
|
|
|
"/site-ccache"))
|
|
|
|
|
'#+extensions)
|
|
|
|
|
%load-compiled-path))
|
|
|
|
|
|
|
|
|
|
;; Load the compiler modules upfront.
|
|
|
|
|
(compile #f)
|
|
|
|
|
|
|
|
|
|
(mkdir #$output)
|
|
|
|
|
(chdir #+module-tree)
|
2023-09-18 02:09:50 -04:00
|
|
|
|
(let ((size (if (equal? #$name "guix-packages-base") 10 25)))
|
|
|
|
|
(process-directory "." '#+module-files #$output #:size size))
|
2018-04-10 08:34:59 -04:00
|
|
|
|
(newline))))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
(computed-file name build
|
|
|
|
|
#:guile guile-for-build
|
|
|
|
|
#:options
|
|
|
|
|
`(#:local-build? #f ;allow substitutes
|
|
|
|
|
|
|
|
|
|
;; Don't annoy people about _IONBF deprecation.
|
2018-06-01 12:36:28 -04:00
|
|
|
|
;; Initialize 'terminal-width' in (system repl debug)
|
|
|
|
|
;; to a large-enough value to make backtrace more
|
|
|
|
|
;; verbose.
|
|
|
|
|
#:env-vars (("GUILE_WARN_DEPRECATED" . "no")
|
|
|
|
|
("COLUMNS" . "200")))))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Building.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define* (guix-derivation source version
|
2018-05-30 05:10:27 -04:00
|
|
|
|
#:optional (guile-version (effective-version))
|
2021-01-27 08:46:10 -05:00
|
|
|
|
#:key (pull-version 0)
|
|
|
|
|
channel-metadata)
|
2018-03-23 10:36:12 -04:00
|
|
|
|
"Return, as a monadic value, the derivation to build the Guix from SOURCE
|
2021-01-27 08:46:10 -05:00
|
|
|
|
for GUILE-VERSION. Use VERSION as the version string. Use CHANNEL-METADATA
|
|
|
|
|
as the channel metadata sexp to include in (guix config).
|
|
|
|
|
|
|
|
|
|
PULL-VERSION specifies the version of the 'guix pull' protocol. Return #f if
|
|
|
|
|
this PULL-VERSION value is not supported."
|
2018-03-23 10:36:12 -04:00
|
|
|
|
(define (shorten version)
|
|
|
|
|
(if (and (string-every char-set:hex-digit version)
|
|
|
|
|
(> (string-length version) 9))
|
|
|
|
|
(string-take version 9) ;Git commit
|
|
|
|
|
version))
|
|
|
|
|
|
|
|
|
|
(define guile
|
2020-01-23 16:43:17 -05:00
|
|
|
|
;; When PULL-VERSION >= 1, produce a self-contained Guix and use the
|
|
|
|
|
;; current Guile unconditionally.
|
|
|
|
|
(specification->package "guile"))
|
2019-01-07 05:38:53 -05:00
|
|
|
|
|
|
|
|
|
(when (and (< pull-version 1)
|
|
|
|
|
(not (string=? (package-version guile) guile-version)))
|
|
|
|
|
;; Guix < 0.15.0 has PULL-VERSION = 0, where the host Guile is reused and
|
|
|
|
|
;; can be any version. When that happens and Guile is not current (e.g.,
|
|
|
|
|
;; it's Guile 2.0), just bail out.
|
|
|
|
|
(raise (condition
|
|
|
|
|
(&message
|
|
|
|
|
(message "Guix is too old and cannot be upgraded")))))
|
2018-03-23 10:36:12 -04:00
|
|
|
|
|
|
|
|
|
(mbegin %store-monad
|
|
|
|
|
(set-guile-for-build guile)
|
2018-05-30 05:10:27 -04:00
|
|
|
|
(let ((guix (compiled-guix source
|
|
|
|
|
#:version version
|
2021-01-27 08:46:10 -05:00
|
|
|
|
#:channel-metadata channel-metadata
|
2018-05-30 05:10:27 -04:00
|
|
|
|
#:name (string-append "guix-"
|
|
|
|
|
(shorten version))
|
|
|
|
|
#:pull-version pull-version
|
2018-10-10 08:54:18 -04:00
|
|
|
|
#:guile-version (if (>= pull-version 1)
|
2020-01-23 16:43:17 -05:00
|
|
|
|
"3.0" guile-version)
|
2018-05-30 05:10:27 -04:00
|
|
|
|
#:guile-for-build guile)))
|
|
|
|
|
(if guix
|
|
|
|
|
(lower-object guix)
|
|
|
|
|
(return #f)))))
|