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.
This commit is contained in:
Ludovic Courtès 2015-04-01 15:34:19 +02:00
parent 7be8c63e0d
commit bb42c78a23
7 changed files with 62 additions and 38 deletions

View file

@ -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