aboutsummaryrefslogtreecommitdiff
path: root/guix/build-system/perl.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-10-03 18:06:16 +0200
committerLudovic Courtès <ludo@gnu.org>2014-10-05 21:58:42 +0200
commit0d5a559f0f81e14c695e5aab178b30edf66088f3 (patch)
treefe43647edc18b8a85885436f9a40a6ff4281e19f /guix/build-system/perl.scm
parent2348fd0f51b6eeabde2e384ef495b3a0adbd6bfb (diff)
downloadguix-0d5a559f0f81e14c695e5aab178b30edf66088f3.tar
guix-0d5a559f0f81e14c695e5aab178b30edf66088f3.tar.gz
build-system: Introduce "bags" as an intermediate representation.
* guix/build-system.scm (<build-system>)[build, cross-build]: Remove. [lower]: New field. (<bag>): New record type. (make-bag): New procedure. * guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs, bag-transitive-host-inputs, bag-transitive-target-inputs, package->bag): New procedures. (package-derivation): Use it; use the bag, apply its build procedure, etc. (package-cross-derivation): Likewise. * gnu/packages/bootstrap.scm (raw-build, make-raw-bag): New procedure. (%bootstrap-guile): Use them. * guix/build-system/trivial.scm (lower): New procedure. (trivial-build, trivial-cross-build): Remove 'source' parameter. Pass INPUTS as is. (trivial-build-system): Adjust accordingly. * guix/build-system/gnu.scm (%store, inputs-search-paths, standard-search-paths, expand-inputs, standard-inputs): Remove. (gnu-lower): New procedure. (gnu-build): Remove 'source' and #:implicit-inputs? parameters. Remove 'implicit-inputs' and 'implicit-search-paths' variables. Get the source from INPUT-DRVS. (gnu-cross-build): Likewise. (standard-cross-packages): Remove call to 'standard-packages'. (standard-cross-inputs, standard-cross-search-paths): Remove. (gnu-build-system): Remove 'build' and 'cross-build'; add 'lower'. * guix/build-system/cmake.scm (lower): New procedure. (cmake-build): Remove 'source' and #:cmake parameters. Use INPUTS and SEARCH-PATHS as is. Get the source from INPUTS. * guix/build-system/perl.scm: Likewise. * guix/build-system/python.scm: Likewise. * guix/build-system/ruby.scm: Likewise. * gnu/packages/cross-base.scm (cross-gcc): Change "cross-linux-headers" to "linux-headers". (cross-libc)[xlinux-headers]: Pass #:implicit-cross-inputs? #f. Likewise. In 'propagated-inputs', change "cross-linux-headers" to "linux-headers". * guix/git-download.scm (git-fetch): Use 'standard-packages' instead of 'standard-inputs'. * tests/builders.scm ("gnu-build-system"): Remove use of 'build-system-builder'. ("gnu-build"): Remove 'source' and #:implicit-inputs? arguments to 'gnu-build'. * tests/packages.scm ("search paths"): Adjust to new build system API. ("package-cross-derivation, no cross builder"): Likewise. * doc/guix.texi (Build Systems): Add paragraph on bags.
Diffstat (limited to 'guix/build-system/perl.scm')
-rw-r--r--guix/build-system/perl.scm75
1 files changed, 44 insertions, 31 deletions
diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm
index 600e597ce8..6cf8cbe13a 100644
--- a/guix/build-system/perl.scm
+++ b/guix/build-system/perl.scm
@@ -42,9 +42,33 @@
(let ((module (resolve-interface '(gnu packages perl))))
(module-ref module 'perl)))
-(define* (perl-build store name source inputs
+(define* (lower name
+ #:key source inputs native-inputs outputs target
+ (perl (default-perl))
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:source #:target #:perl #:inputs #:native-inputs))
+
+ (and (not target) ;XXX: no cross-compilation
+ (bag
+ (name name)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+
+ ;; Keep the standard inputs of 'gnu-build-system'.
+ ,@(standard-packages)))
+ (build-inputs `(("perl" ,perl)
+ ,@native-inputs))
+ (outputs outputs)
+ (build perl-build)
+ (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (perl-build store name inputs
#:key
- (perl (default-perl))
(search-paths '())
(tests? #t)
(parallel-build? #t)
@@ -62,20 +86,19 @@
(guix build utils))))
"Build SOURCE using PERL, and with INPUTS. This assumes that SOURCE
provides a `Makefile.PL' file as its build system."
- (define perl-search-paths
- (append (package-native-search-paths perl)
- (standard-search-paths)))
-
(define builder
`(begin
(use-modules ,@modules)
(perl-build #:name ,name
- #:source ,(if (derivation? source)
- (derivation->output-path source)
- source)
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
#:search-paths ',(map search-path-specification->sexp
- (append perl-search-paths
- search-paths))
+ search-paths)
#:make-maker-flags ,make-maker-flags
#:phases ,phases
#:system ,system
@@ -95,27 +118,17 @@ provides a `Makefile.PL' file as its build system."
(guile (module-ref distro 'guile-final)))
(package-derivation store guile system)))))
- (let ((perl (package-derivation store perl system)))
- (build-expression->derivation store name builder
- #:system system
- #:inputs
- `(,@(if source
- `(("source" ,source))
- '())
- ("perl" ,perl)
- ,@inputs
-
- ;; Keep the standard inputs of
- ;; `gnu-build-system'.
- ,@(standard-inputs system))
-
- #:modules imported-modules
- #:outputs outputs
- #:guile-for-build guile-for-build)))
+ (build-expression->derivation store name builder
+ #:system system
+ #:inputs inputs
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
(define perl-build-system
- (build-system (name 'perl)
- (description "The standard Perl build system")
- (build perl-build)))
+ (build-system
+ (name 'perl)
+ (description "The standard Perl build system")
+ (lower lower)))
;;; perl.scm ends here