summaryrefslogtreecommitdiff
path: root/guix/self.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-11-07 21:09:57 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-11-07 21:09:57 +0100
commit55174e668f2985d1c4efda4fbf58f4061dde0db2 (patch)
treef55f7e50fff1a1c3d1e6d2e932a7ef19347e5011 /guix/self.scm
parent1badc85068ee0be2a028c1b94a3dd285901bc391 (diff)
parentb31e1561611ebe4916890183b24e6e13cb83bf59 (diff)
downloadgnu-guix-55174e668f2985d1c4efda4fbf58f4061dde0db2.tar
gnu-guix-55174e668f2985d1c4efda4fbf58f4061dde0db2.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/self.scm')
-rw-r--r--guix/self.scm47
1 files changed, 36 insertions, 11 deletions
diff --git a/guix/self.scm b/guix/self.scm
index 3e29c9a42a..ddbe0b3669 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/"
@@ -273,10 +274,10 @@ DOMAIN, a gettext domain."
'graphviz))
(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 +291,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
@@ -404,11 +405,29 @@ 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")))))
+
(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 +441,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 +461,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 +690,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