aboutsummaryrefslogtreecommitdiff
path: root/guix/build-system/trivial.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-24 23:53:06 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-24 23:53:06 +0200
commit5dce82180bf59b39184226830b74f33080fe00f3 (patch)
treea4c3a6b4a5bc3a7a9e913ab7829c1e7de3b7d716 /guix/build-system/trivial.scm
parentcba363bea8b93d367d0e64e94a8b31ef91707329 (diff)
downloadgnu-guix-5dce82180bf59b39184226830b74f33080fe00f3.tar
gnu-guix-5dce82180bf59b39184226830b74f33080fe00f3.tar.gz
build-system/trivial: Implement the cross-build protocol.
* guix/build-system/trivial.scm (guile-for-build): New procedure. (trivial-build): Use it. (trivial-cross-build): New procedure. (trivial-build-system): Use it.
Diffstat (limited to 'guix/build-system/trivial.scm')
-rw-r--r--guix/build-system/trivial.scm40
1 files changed, 27 insertions, 13 deletions
diff --git a/guix/build-system/trivial.scm b/guix/build-system/trivial.scm
index 2eb15aa2e0..af54f51419 100644
--- a/guix/build-system/trivial.scm
+++ b/guix/build-system/trivial.scm
@@ -25,31 +25,45 @@
#:use-module (ice-9 match)
#:export (trivial-build-system))
+(define (guile-for-build store guile system)
+ (match guile
+ ((? package?)
+ (package-derivation store guile system))
+ ((and (? string?) (? derivation-path?))
+ guile)
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages base)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system)))))
+
(define* (trivial-build store name source inputs
#:key
outputs guile system builder (modules '())
search-paths)
"Run build expression BUILDER, an expression, for SYSTEM. SOURCE is
ignored."
- (define guile-for-build
- (match guile
- ((? package?)
- (package-derivation store guile system))
- ((and (? string?) (? derivation-path?))
- guile)
- (#f ; the default
- (let* ((distro (resolve-interface '(gnu packages base)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system)))))
-
(build-expression->derivation store name system builder inputs
#:outputs outputs
#:modules modules
- #:guile-for-build guile-for-build))
+ #:guile-for-build
+ (guile-for-build store guile system)))
+
+(define* (trivial-cross-build store name target source inputs native-inputs
+ #:key
+ outputs guile system builder (modules '())
+ search-paths native-search-paths)
+ "Like `trivial-build', but in a cross-compilation context."
+ (build-expression->derivation store name system
+ `(begin (define %target ,target) ,builder)
+ (append native-inputs inputs)
+ #:outputs outputs
+ #:modules modules
+ #:guile-for-build
+ (guile-for-build store guile system)))
(define trivial-build-system
(build-system (name 'trivial)
(description
"Trivial build system, to run arbitrary Scheme build expressions")
(build trivial-build)
- (cross-build trivial-build)))
+ (cross-build trivial-cross-build)))