aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-12-01 14:09:36 +0100
committerLudovic Courtès <ludo@gnu.org>2014-12-01 14:09:36 +0100
commitd68fe741623d11d16c514cf8bddbb48a1e5258ae (patch)
tree9022ca5a9ee881abe336f6dbf32e34b9c1901cef
parente9bab1df6d4c71f9617362c2bd8babe61dec759d (diff)
downloadguix-d68fe741623d11d16c514cf8bddbb48a1e5258ae.tar
guix-d68fe741623d11d16c514cf8bddbb48a1e5258ae.tar.gz
build-system/gnu: Add 'validate-documentation-location' phase.
* guix/build/gnu-build-system.scm (validate-documentation-location): New procedure. (%standard-phases): Add it.
-rw-r--r--guix/build/gnu-build-system.scm24
1 files changed, 23 insertions, 1 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index e42a6cc48b..9d97ceb5bb 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -372,6 +372,27 @@ makefiles."
strip-directories)))
outputs))))
+(define* (validate-documentation-location #:key outputs
+ #:allow-other-keys)
+ "Documentation should go to 'share/info' and 'share/man', not just 'info/'
+and 'man/'. This phase moves directories to the right place if needed."
+ (define (validate-sub-directory output sub-directory)
+ (let ((directory (string-append output "/" sub-directory)))
+ (when (directory-exists? directory)
+ (let ((target (string-append output "/share/" sub-directory)))
+ (format #t "moving '~a' to '~a'~%" directory target)
+ (mkdir-p (dirname target))
+ (rename-file directory target)))))
+
+ (define (validate-output output)
+ (for-each (cut validate-sub-directory output <>)
+ '("man" "info")))
+
+ (match outputs
+ (((names . directories) ...)
+ (for-each validate-output directories)))
+ #t)
+
(define %standard-phases
;; Standard build phases, as a list of symbol/procedure pairs.
(let-syntax ((phases (syntax-rules ()
@@ -380,7 +401,8 @@ makefiles."
patch-usr-bin-file
patch-source-shebangs configure patch-generated-file-shebangs
build check install
- patch-shebangs strip)))
+ patch-shebangs strip
+ validate-documentation-location)))
(define* (gnu-build #:key (source #f) (outputs #f) (inputs #f)