self: 'compiled-files' builds the given list of files.
* guix/self.scm (compiled-files): Add 'module-files' parameter. [build]: 'process-directory' now honors MODULE-FILES instead of building any '.scm' file it sees. (scheme-node): Adjust accordingly.master
parent
e3a87d770f
commit
8031b3fa3c
|
@ -171,7 +171,8 @@ must be present in the search path."
|
||||||
(source (imported-files (string-append name "-source")
|
(source (imported-files (string-append name "-source")
|
||||||
(append module-files extra-files))))
|
(append module-files extra-files))))
|
||||||
(node name modules source dependencies
|
(node name modules source dependencies
|
||||||
(compiled-modules name source modules
|
(compiled-modules name source
|
||||||
|
(map car module-files)
|
||||||
(map node-source dependencies)
|
(map node-source dependencies)
|
||||||
(map node-compiled dependencies)
|
(map node-compiled dependencies)
|
||||||
#:extensions extensions
|
#:extensions extensions
|
||||||
|
@ -505,7 +506,7 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'."
|
||||||
#:substitutable? #f
|
#:substitutable? #f
|
||||||
#:env-vars (("COLUMNS" . "200")))))
|
#:env-vars (("COLUMNS" . "200")))))
|
||||||
|
|
||||||
(define* (compiled-modules name module-tree modules
|
(define* (compiled-modules name module-tree module-files
|
||||||
#:optional
|
#:optional
|
||||||
(dependencies '())
|
(dependencies '())
|
||||||
(dependencies-compiled '())
|
(dependencies-compiled '())
|
||||||
|
@ -513,6 +514,9 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'."
|
||||||
(extensions '()) ;full-blown Guile packages
|
(extensions '()) ;full-blown Guile packages
|
||||||
parallel?
|
parallel?
|
||||||
guile-for-build)
|
guile-for-build)
|
||||||
|
"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."
|
||||||
;; This is a non-monadic, enhanced version of 'compiled-file' from (guix
|
;; This is a non-monadic, enhanced version of 'compiled-file' from (guix
|
||||||
;; gexp).
|
;; gexp).
|
||||||
(define build
|
(define build
|
||||||
|
@ -543,16 +547,13 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'."
|
||||||
(* 100. (/ completed total)) total)
|
(* 100. (/ completed total)) total)
|
||||||
(force-output))
|
(force-output))
|
||||||
|
|
||||||
(define (process-directory directory output)
|
(define (process-directory directory files output)
|
||||||
(let ((files (find-files directory "\\.scm$"))
|
;; Hide compilation warnings.
|
||||||
(prefix (+ 1 (string-length directory))))
|
(parameterize ((current-warning-port (%make-void-port "w")))
|
||||||
;; Hide compilation warnings.
|
(compile-files directory #$output files
|
||||||
(parameterize ((current-warning-port (%make-void-port "w")))
|
#:workers (parallel-job-count)
|
||||||
(compile-files directory #$output
|
#:report-load report-load
|
||||||
(map (cut string-drop <> prefix) files)
|
#:report-compilation report-compilation)))
|
||||||
#:workers (parallel-job-count)
|
|
||||||
#:report-load report-load
|
|
||||||
#:report-compilation report-compilation))))
|
|
||||||
|
|
||||||
(setvbuf (current-output-port) _IONBF)
|
(setvbuf (current-output-port) _IONBF)
|
||||||
(setvbuf (current-error-port) _IONBF)
|
(setvbuf (current-error-port) _IONBF)
|
||||||
|
@ -580,7 +581,7 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'."
|
||||||
|
|
||||||
(mkdir #$output)
|
(mkdir #$output)
|
||||||
(chdir #+module-tree)
|
(chdir #+module-tree)
|
||||||
(process-directory "." #$output)
|
(process-directory "." '#+module-files #$output)
|
||||||
(newline))))
|
(newline))))
|
||||||
|
|
||||||
(computed-file name build
|
(computed-file name build
|
||||||
|
|
Reference in New Issue