[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/08: build-system: Factorize the list of modules imported on the build
From: |
Ludovic Courtès |
Subject: |
04/08: build-system: Factorize the list of modules imported on the build side. |
Date: |
Wed, 01 Apr 2015 15:11:14 +0000 |
civodul pushed a commit to branch core-updates
in repository guix.
commit bb42c78a23a96ef79c2b5e3b98c55eef53eac9fe
Author: Ludovic Courtès <address@hidden>
Date: Wed Apr 1 15:34:19 2015 +0200
build-system: Factorize the list of modules imported on the build side.
* guix/build-system/gnu.scm (%default-modules): Rename to...
(%gnu-build-system-modules): ... this.
(%default-modules): New variable.
(dist-package, gnu-build): Use %GNU-BUILD-SYSTEM-MODULES for
#:imported-modules.
(gnu-cross-build): Likewise, and use %DEFAULT-MODULES for #:modules.
* guix/build-system/cmake.scm (%cmake-build-system-modules): New
variable.
(cmake-build): Use it for #:imported-modules.
* guix/build-system/glib-or-gtk.scm (%default-imported-modules): Rename
to...
(%glib-or-gtk-build-system-modules): ... this. Refer to
%GNU-BUILD-SYSTEM-MODULES. Adjust uses.
* guix/build-system/perl.scm (%perl-build-system-modules): New
variable.
(perl-build): Use it for #:imported-modules.
* guix/build-system/python.scm (%python-build-system-modules): New
variable.
(python-build): Use it for #:imported-modules.
* guix/build-system/ruby.scm (%ruby-build-system-modules): New variable.
(ruby-build): Use it for #:imported-modules.
* guix/build-system/waf.scm (%waf-build-system-modules): New variable.
(waf-build): Use it for #:imported-modules.
---
guix/build-system/cmake.scm | 14 +++++++++-----
guix/build-system/glib-or-gtk.scm | 14 +++++++-------
guix/build-system/gnu.scm | 20 ++++++++++++--------
guix/build-system/perl.scm | 14 +++++++++-----
guix/build-system/python.scm | 12 ++++++++----
guix/build-system/ruby.scm | 14 +++++++++-----
guix/build-system/waf.scm | 12 ++++++++----
7 files changed, 62 insertions(+), 38 deletions(-)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 0425e9f..2e67842 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
;;; Copyright © 2013 Cyril Roelandt <address@hidden>
;;;
;;; This file is part of GNU Guix.
@@ -25,7 +25,8 @@
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (ice-9 match)
- #:export (cmake-build
+ #:export (%cmake-build-system-modules
+ cmake-build
cmake-build-system))
;; Commentary:
@@ -35,6 +36,11 @@
;;
;; Code:
+(define %cmake-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build cmake-build-system)
+ ,@%gnu-build-system-modules))
+
(define (default-cmake)
"Return the default CMake package."
@@ -86,9 +92,7 @@
(phases '(@ (guix build cmake-build-system)
%standard-phases))
(system (%current-system))
- (imported-modules '((guix build cmake-build-system)
- (guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %cmake-build-system-modules)
(modules '((guix build cmake-build-system)
(guix build utils))))
"Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE
diff --git a/guix/build-system/glib-or-gtk.scm
b/guix/build-system/glib-or-gtk.scm
index 7a90587..85d0196 100644
--- a/guix/build-system/glib-or-gtk.scm
+++ b/guix/build-system/glib-or-gtk.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
;;; Copyright © 2013 Cyril Roelandt <address@hidden>
;;; Copyright © 2014 Federico Beffa <address@hidden>
;;;
@@ -26,7 +26,8 @@
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (ice-9 match)
- #:export (glib-or-gtk-build
+ #:export (%glib-or-gtk-build-system-modules
+ glib-or-gtk-build
glib-or-gtk-build-system))
;; Commentary:
@@ -67,11 +68,10 @@
'((guix build glib-or-gtk-build-system)
(guix build utils)))
-(define %default-imported-modules
+(define %glib-or-gtk-build-system-modules
;; Build-side modules imported and used by default.
- '((guix build gnu-build-system)
- (guix build glib-or-gtk-build-system)
- (guix build utils)))
+ `((guix build glib-or-gtk-build-system)
+ ,@%gnu-build-system-modules))
(define (default-glib)
"Return the default glib package from which we use
@@ -136,7 +136,7 @@
%standard-phases))
(glib-or-gtk-wrap-excluded-outputs ''())
(system (%current-system))
- (imported-modules %default-imported-modules)
+ (imported-modules
%glib-or-gtk-build-system-modules)
(modules %default-modules)
allowed-references)
"Build SOURCE with INPUTS. See GNU-BUILD for more details."
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index c91ad2e..e4cbd29 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -24,7 +24,8 @@
#:use-module (guix packages)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:export (gnu-build
+ #:export (%gnu-build-system-modules
+ gnu-build
gnu-build-system
standard-packages
package-with-explicit-inputs
@@ -41,11 +42,16 @@
;;
;; Code:
-(define %default-modules
+(define %gnu-build-system-modules
;; Build-side modules imported and used by default.
'((guix build gnu-build-system)
(guix build utils)))
+(define %default-modules
+ ;; Modules in scope in the build-side environment.
+ '((guix build gnu-build-system)
+ (guix build utils)))
+
(define* (package-with-explicit-inputs p inputs
#:optional
(loc (current-source-location))
@@ -182,7 +188,7 @@ runs `make distcheck' and whose result is one or more
source tarballs."
(let* ((args (default-keyword-arguments (package-arguments p)
`(#:phases #f
#:modules ,%default-modules
- #:imported-modules ,%default-modules))))
+ #:imported-modules ,%gnu-build-system-modules))))
(substitute-keyword-arguments args
((#:modules modules)
`((guix build gnu-dist)
@@ -280,7 +286,7 @@ standard packages used as implicit inputs of the GNU build
system."
(phases '%standard-phases)
(locale "en_US.UTF-8")
(system (%current-system))
- (imported-modules %default-modules)
+ (imported-modules %gnu-build-system-modules)
(modules %default-modules)
(substitutable? #t)
allowed-references)
@@ -414,10 +420,8 @@ is one of `host' or `target'."
(phases '%standard-phases)
(locale "en_US.UTF-8")
(system (%current-system))
- (imported-modules '((guix build gnu-build-system)
- (guix build utils)))
- (modules '((guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %gnu-build-system-modules)
+ (modules %default-modules)
(substitutable? #t)
allowed-references)
"Cross-build NAME for TARGET, where TARGET is a GNU triplet. INPUTS are
diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm
index e0f8643..7833153 100644
--- a/guix/build-system/perl.scm
+++ b/guix/build-system/perl.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,7 +24,8 @@
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (ice-9 match)
- #:export (perl-build
+ #:export (%perl-build-system-modules
+ perl-build
perl-build-system))
;; Commentary:
@@ -35,6 +36,11 @@
;;
;; Code:
+(define %perl-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build perl-build-system)
+ ,@%gnu-build-system-modules))
+
(define (default-perl)
"Return the default Perl package."
@@ -83,9 +89,7 @@
(outputs '("out"))
(system (%current-system))
(guile #f)
- (imported-modules '((guix build perl-build-system)
- (guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %perl-build-system-modules)
(modules '((guix build perl-build-system)
(guix build utils))))
"Build SOURCE using PERL, and with INPUTS. This assumes that SOURCE
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index 3710865..d498cf6 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -27,7 +27,8 @@
#:use-module (guix build-system gnu)
#:use-module (ice-9 match)
#:use-module (srfi srfi-26)
- #:export (package-with-python2
+ #:export (%python-build-system-modules
+ package-with-python2
python-build
python-build-system))
@@ -38,6 +39,11 @@
;;
;; Code:
+(define %python-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build python-build-system)
+ ,@%gnu-build-system-modules))
+
(define (default-python)
"Return the default Python package."
;; Lazily resolve the binding to avoid a circular dependency.
@@ -132,9 +138,7 @@ prepended to the name."
(search-paths '())
(system (%current-system))
(guile #f)
- (imported-modules '((guix build python-build-system)
- (guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %python-build-system-modules)
(modules '((guix build python-build-system)
(guix build utils))))
"Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE
diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm
index 08301ec..83bc93d 100644
--- a/guix/build-system/ruby.scm
+++ b/guix/build-system/ruby.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 David Thompson <address@hidden>
-;;; Copyright © 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2014, 2015 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,9 +25,15 @@
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
#:use-module (ice-9 match)
- #:export (ruby-build
+ #:export (%ruby-build-system-modules
+ ruby-build
ruby-build-system))
+(define %ruby-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build ruby-build-system)
+ ,@%gnu-build-system-modules))
+
(define (default-ruby)
"Return the default Ruby package."
;; Lazily resolve the binding to avoid a circular dependency.
@@ -72,9 +78,7 @@
(search-paths '())
(system (%current-system))
(guile #f)
- (imported-modules '((guix build ruby-build-system)
- (guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %ruby-build-system-modules)
(modules '((guix build ruby-build-system)
(guix build utils))))
"Build SOURCE using RUBY and INPUTS."
diff --git a/guix/build-system/waf.scm b/guix/build-system/waf.scm
index 494cb95..c67f649 100644
--- a/guix/build-system/waf.scm
+++ b/guix/build-system/waf.scm
@@ -27,7 +27,8 @@
#:select (default-python default-python2))
#:use-module (ice-9 match)
#:use-module (srfi srfi-26)
- #:export (waf-build
+ #:export (%waf-build-system-modules
+ waf-build
waf-build-system))
;; Commentary:
@@ -38,6 +39,11 @@
;;
;; Code:
+(define %waf-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build waf-build-system)
+ ,@%gnu-build-system-modules))
+
(define* (lower name
#:key source inputs native-inputs outputs system target
(python (default-python))
@@ -75,9 +81,7 @@
(search-paths '())
(system (%current-system))
(guile #f)
- (imported-modules '((guix build waf-build-system)
- (guix build gnu-build-system)
- (guix build utils)))
+ (imported-modules %waf-build-system-modules)
(modules '((guix build waf-build-system)
(guix build utils))))
"Build SOURCE with INPUTS. This assumes that SOURCE provides a 'waf' file
- branch core-updates updated (4c0d38b -> 112da58), Ludovic Courtès, 2015/04/01
- 03/08: gremlin: Guard against invalid ELF segments., Ludovic Courtès, 2015/04/01
- 01/08: gnu: node: Remove unneeded import., Ludovic Courtès, 2015/04/01
- 05/08: gnu: Remove unneeded uses of #:imported-modules., Ludovic Courtès, 2015/04/01
- 04/08: build-system: Factorize the list of modules imported on the build side.,
Ludovic Courtès <=
- 02/08: gremlin: Add libnsl to libc's library list., Ludovic Courtès, 2015/04/01
- 06/08: gnu: Refer to %GNU-BUILD-SYSTEM-MODULES instead of listing modules., Ludovic Courtès, 2015/04/01
- 07/08: utils: Make the second 'find-files' argument optional., Ludovic Courtès, 2015/04/01
- 08/08: build-system/gnu: Add 'validate-runpath' phase., Ludovic Courtès, 2015/04/01