summaryrefslogtreecommitdiff
path: root/guix/build/guile-build-system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-02 20:59:34 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-02 22:01:34 +0200
commit30eb73836684ff8502063c43f3b315174e0d3a0b (patch)
tree111c3265fec772b5a42b3e6d9f08477115d57a86 /guix/build/guile-build-system.scm
parentabeb54c00b320f8c3a220f54b6413837f6deac35 (diff)
build-system/guile: Add #:not-compiled-file-regexp.
* guix/build/guile-build-system.scm (build): Add #:not-compiled-file-regexp and honor it. * guix/build-system/guile.scm (guile-build): Likewise. (guile-cross-build): Likewise.
Diffstat (limited to 'guix/build/guile-build-system.scm')
-rw-r--r--guix/build/guile-build-system.scm30
1 files changed, 19 insertions, 11 deletions
diff --git a/guix/build/guile-build-system.scm b/guix/build/guile-build-system.scm
index 69819c87f1..eb7a91840e 100644
--- a/guix/build/guile-build-system.scm
+++ b/guix/build/guile-build-system.scm
@@ -19,10 +19,12 @@
(define-module (guix build guile-build-system)
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
#:use-module (guix build utils)
+ #:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
#:use-module (ice-9 popen)
#:use-module (ice-9 rdelim)
+ #:use-module (ice-9 regex)
#:use-module (guix build utils)
#:export (target-guile-effective-version
%standard-phases
@@ -134,9 +136,12 @@ Raise an error if one of the processes exit with non-zero."
(source-directory ".")
(compile-flags '())
(scheme-file-regexp %scheme-file-regexp)
+ (not-compiled-file-regexp #f)
target
#:allow-other-keys)
- "Build files in SOURCE-DIRECTORY that match SCHEME-FILE-REGEXP."
+ "Build files in SOURCE-DIRECTORY that match SCHEME-FILE-REGEXP. Files
+matching NOT-COMPILED-FILE-REGEXP, if true, are not compiled but are
+installed; this is useful for files that are meant to be included."
(let* ((out (assoc-ref outputs "out"))
(guile (assoc-ref (or native-inputs inputs) "guile"))
(effective (target-guile-effective-version guile))
@@ -171,16 +176,19 @@ Raise an error if one of the processes exit with non-zero."
(with-directory-excursion source-directory
(find-files "." scheme-file-regexp))))
(invoke-each
- (map (lambda (file)
- (cons* guild
- "guild" "compile"
- "-L" source-directory
- "-o" (string-append go-dir
- (file-sans-extension file)
- ".go")
- (string-append source-directory "/" file)
- flags))
- source-files)
+ (filter-map (lambda (file)
+ (and (or (not not-compiled-file-regexp)
+ (not (string-match not-compiled-file-regexp
+ file)))
+ (cons* guild
+ "guild" "compile"
+ "-L" source-directory
+ "-o" (string-append go-dir
+ (file-sans-extension file)
+ ".go")
+ (string-append source-directory "/" file)
+ flags)))
+ source-files)
#:max-processes (parallel-job-count)
#:report-progress report-build-progress)