diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-12-11 22:18:05 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-12-11 22:18:05 +0100 |
commit | b03e4fd5269897448124a7b61a737802b2c638ee (patch) | |
tree | e4eaab1d3076e335c57eea462ff7fda7919f0831 /guix/self.scm | |
parent | da3c6a7f19ef1243af725f63c16c8fd92fde33b4 (diff) | |
parent | 99aad42138e0895df51e64e1261984f277952516 (diff) | |
download | guix-patches-b03e4fd5269897448124a7b61a737802b2c638ee.tar guix-patches-b03e4fd5269897448124a7b61a737802b2c638ee.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/self.scm')
-rw-r--r-- | guix/self.scm | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/guix/self.scm b/guix/self.scm index 3e29c9a42a..f2db3dbf52 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -206,21 +206,22 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'." (local-file file #:recursive? #t))) (find-files (string-append directory "/" sub-directory) pred))) -(define* (sub-directory item sub-directory) - "Return SUB-DIRECTORY within ITEM, which may be a file name or a file-like -object." +(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." (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. - (local-file (string-append item "/" sub-directory) - #:recursive? #t)) + (local-file (string-append item "/" file) + #:recursive? recursive?)) ;; TODO: Add 'local-file?' case. (_ ;; In this case, anything that refers to the result also depends on ITEM, ;; which isn't great. - (file-append item "/" sub-directory)))) + (file-append item "/" file)))) (define* (locale-data source domain #:optional (directory domain)) @@ -238,7 +239,7 @@ DOMAIN, a gettext domain." (ice-9 match) (ice-9 ftw)) (define po-directory - #+(sub-directory source (string-append "po/" directory))) + #+(file-append* source (string-append "po/" directory))) (define (compile language) (let ((gmo (string-append #$output "/" language "/LC_MESSAGES/" @@ -272,11 +273,15 @@ DOMAIN, a gettext domain." (module-ref (resolve-interface '(gnu packages graphviz)) 'graphviz)) + (define glibc-utf8-locales + (module-ref (resolve-interface '(gnu packages base)) + 'glibc-utf8-locales)) + (define documentation - (sub-directory source "doc")) + (file-append* source "doc")) (define examples - (sub-directory source "gnu/system/examples")) + (file-append* source "gnu/system/examples")) (define build (with-imported-modules '((guix build utils)) @@ -290,7 +295,7 @@ DOMAIN, a gettext domain." ;; doesn't change at each commit? (call-with-output-file "version.texi" (lambda (port) - (let ((version "0.0-git)")) + (let ((version "0.0-git")) (format port " @set UPDATED 1 January 1970 @set UPDATED-MONTH January 1970 @@ -335,6 +340,10 @@ DOMAIN, a gettext domain." (delete-file-recursively "images") (symlink (string-append #$output "/images") "images") + ;; Provide UTF-8 locales needed by the 'xspara.c' code in makeinfo. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (for-each (lambda (texi) (unless (string=? "guix.texi" texi) ;; Create 'version-LL.texi'. @@ -404,11 +413,32 @@ load path." (apply guix-main (command-line)))) #:guile guile)) +(define (miscellaneous-files source) + "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")) + ("share/guix/hydra.gnu.org.pub" + ,(file-append* source + "/etc/substitutes/hydra.gnu.org.pub")) + ("share/guix/berlin.guixsd.org.pub" + ,(file-append* source + "/etc/substitutes/berlin.guixsd.org.pub")) + ("share/guix/ci.guix.info.pub" ;alias + ,(file-append* source "/etc/substitutes/berlin.guixsd.org.pub"))))) + (define* (whole-package name modules dependencies #:key (guile-version (effective-version)) compiled-modules - info daemon guile + info daemon miscellany + guile (command (guix-command modules #:dependencies dependencies #:guile guile @@ -422,6 +452,7 @@ assumed to be part of MODULES." (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) + (mkdir-p (string-append #$output "/bin")) (symlink #$command (string-append #$output "/bin/guix")) @@ -441,6 +472,10 @@ assumed to be part of MODULES." (string-append #$output "/share/info")))) + (when #$miscellany + (copy-recursively #$miscellany #$output + #:log (%make-void-port "w"))) + ;; Object files. (when #$compiled-modules (let ((modules (string-append #$output "/lib/guile/" @@ -666,6 +701,7 @@ assumed to be part of MODULES." 'guix-daemon) #:info (info-manual source) + #:miscellany (miscellaneous-files source) #:guile-version guile-version))) ((= 0 pull-version) ;; Legacy 'guix pull': return the .scm and .go files as one |