2013-05-09 00:44:28 +02:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2016-01-08 19:06:26 +01:00
|
|
|
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
2013-09-08 16:57:37 +02:00
|
|
|
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
|
2013-05-09 00:44:28 +02:00
|
|
|
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
|
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (guix build-system python)
|
|
|
|
#:use-module (guix store)
|
|
|
|
#:use-module (guix utils)
|
utils: Move combinators to (guix combinators).
* guix/utils.scm (compile-time-value, memoize, fold2)
(fold-tree, fold-tree-leaves): Move to...
* guix/combinators: ... here. New file.
* tests/utils.scm ("fold2, 1 list", "fold2, 2 lists")
(fold-tree tests): Move to...
* tests/combinators.scm: ... here. New file.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* gnu/packages.scm, gnu/packages/bootstrap.scm,
gnu/services/herd.scm, guix/build-system/gnu.scm,
guix/build-system/python.scm, guix/derivations.scm,
guix/gnu-maintenance.scm, guix/import/elpa.scm,
guix/scripts/archive.scm, guix/scripts/build.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/scripts/size.scm, guix/scripts/substitute.scm,
guix/serialization.scm, guix/store.scm, guix/ui.scm: Adjust imports
accordingly.
2016-05-04 17:35:47 +02:00
|
|
|
#:use-module (guix combinators)
|
2013-05-09 00:44:28 +02:00
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix derivations)
|
Move search path specifications to (guix search-paths).
* guix/packages.scm (<search-path-specification>,
search-path-specification->sexp, sexp->search-path-specification):
Move to...
* guix/search-paths.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cmake.scm, guix/build-system/glib-or-gtk.scm,
guix/build-system/gnu.scm, guix/build-system/haskell.scm,
guix/build-system/perl.scm, guix/build-system/python.scm,
guix/build-system/ruby.scm, guix/build-system/waf.scm,
guix/profiles.scm, guix/scripts/package.scm: Use it.
2015-05-04 22:11:37 +02:00
|
|
|
#:use-module (guix search-paths)
|
2013-05-09 00:44:28 +02:00
|
|
|
#:use-module (guix build-system)
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (ice-9 match)
|
2016-02-07 22:43:41 +01:00
|
|
|
#:use-module (srfi srfi-1)
|
2013-09-08 16:57:37 +02:00
|
|
|
#:use-module (srfi srfi-26)
|
2015-04-01 15:34:19 +02:00
|
|
|
#:export (%python-build-system-modules
|
|
|
|
package-with-python2
|
2016-02-07 22:43:41 +01:00
|
|
|
strip-python2-variant
|
2016-09-27 11:20:40 +02:00
|
|
|
default-python
|
|
|
|
default-python2
|
2013-09-08 16:57:37 +02:00
|
|
|
python-build
|
2015-10-10 22:50:34 +02:00
|
|
|
python-build-system
|
|
|
|
pypi-uri))
|
2013-05-09 00:44:28 +02:00
|
|
|
|
|
|
|
;; Commentary:
|
|
|
|
;;
|
|
|
|
;; Standard build procedure for Python packages using 'setup.py'. This is
|
|
|
|
;; implemented as an extension of 'gnu-build-system'.
|
|
|
|
;;
|
|
|
|
;; Code:
|
|
|
|
|
2016-01-08 19:06:26 +01:00
|
|
|
(define* (pypi-uri name version #:optional (extension ".tar.gz"))
|
2015-10-10 22:50:34 +02:00
|
|
|
"Return a URI string for the Python package hosted on the Python Package
|
2016-01-08 19:06:26 +01:00
|
|
|
Index (PyPI) corresponding to NAME and VERSION. EXTENSION is the file name
|
|
|
|
extension, such as '.tar.gz'."
|
2016-06-23 13:23:28 +02:00
|
|
|
(string-append "https://pypi.io/packages/source/"
|
2015-10-10 22:50:34 +02:00
|
|
|
(string-take name 1) "/" name "/"
|
2016-01-08 19:06:26 +01:00
|
|
|
name "-" version extension))
|
2015-10-10 22:50:34 +02:00
|
|
|
|
2015-04-01 15:34:19 +02:00
|
|
|
(define %python-build-system-modules
|
|
|
|
;; Build-side modules imported by default.
|
|
|
|
`((guix build python-build-system)
|
|
|
|
,@%gnu-build-system-modules))
|
|
|
|
|
2013-05-30 00:47:34 +02:00
|
|
|
(define (default-python)
|
|
|
|
"Return the default Python package."
|
|
|
|
;; Lazily resolve the binding to avoid a circular dependency.
|
|
|
|
(let ((python (resolve-interface '(gnu packages python))))
|
2013-09-04 18:04:15 +02:00
|
|
|
(module-ref python 'python-wrapper)))
|
2013-05-30 00:47:34 +02:00
|
|
|
|
2013-09-08 16:57:37 +02:00
|
|
|
(define (default-python2)
|
|
|
|
"Return the default Python 2 package."
|
|
|
|
(let ((python (resolve-interface '(gnu packages python))))
|
|
|
|
(module-ref python 'python-2)))
|
|
|
|
|
2016-02-07 22:43:41 +01:00
|
|
|
(define* (package-with-explicit-python python old-prefix new-prefix
|
|
|
|
#:key variant-property)
|
2015-10-12 23:44:39 +02:00
|
|
|
"Return a procedure of one argument, P. The procedure creates a package with
|
|
|
|
the same fields as P, which is assumed to use PYTHON-BUILD-SYSTEM, such that
|
|
|
|
it is compiled with PYTHON instead. The inputs are changed recursively
|
|
|
|
accordingly. If the name of P starts with OLD-PREFIX, this is replaced by
|
2016-02-07 22:43:41 +01:00
|
|
|
NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
|
|
|
|
|
|
|
|
When VARIANT-PROPERTY is present, it is used as a key to search for
|
|
|
|
pre-defined variants of this transformation recorded in the 'properties' field
|
|
|
|
of packages. The property value must be the promise of a package. This is a
|
|
|
|
convenient way for package writers to force the transformation to use
|
|
|
|
pre-defined variants."
|
2015-10-12 23:44:39 +02:00
|
|
|
(define transform
|
|
|
|
;; Memoize the transformations. Failing to do that, we would build a huge
|
|
|
|
;; object graph with lots of duplicates, which in turns prevents us from
|
|
|
|
;; benefiting from memoization in 'package-derivation'.
|
|
|
|
(memoize ;FIXME: use 'eq?'
|
|
|
|
(lambda (p)
|
|
|
|
(let* ((rewrite-if-package
|
|
|
|
(lambda (content)
|
|
|
|
;; CONTENT may be a file name, in which case it is returned,
|
|
|
|
;; or a package, which is rewritten with the new PYTHON and
|
|
|
|
;; NEW-PREFIX.
|
|
|
|
(if (package? content)
|
|
|
|
(transform content)
|
|
|
|
content)))
|
|
|
|
(rewrite
|
|
|
|
(match-lambda
|
|
|
|
((name content . rest)
|
|
|
|
(append (list name (rewrite-if-package content)) rest)))))
|
2014-12-23 19:11:03 +01:00
|
|
|
|
2016-02-07 22:43:41 +01:00
|
|
|
(cond
|
|
|
|
;; If VARIANT-PROPERTY is present, use that.
|
|
|
|
((and variant-property
|
|
|
|
(assoc-ref (package-properties p) variant-property))
|
|
|
|
=> force)
|
|
|
|
|
|
|
|
;; Otherwise build the new package object graph.
|
|
|
|
((eq? (package-build-system p) python-build-system)
|
|
|
|
(package
|
|
|
|
(inherit p)
|
|
|
|
(location (package-location p))
|
|
|
|
(name (let ((name (package-name p)))
|
|
|
|
(string-append new-prefix
|
|
|
|
(if (string-prefix? old-prefix name)
|
|
|
|
(substring name
|
|
|
|
(string-length old-prefix))
|
|
|
|
name))))
|
|
|
|
(arguments
|
|
|
|
(let ((python (if (promise? python)
|
|
|
|
(force python)
|
|
|
|
python)))
|
|
|
|
(ensure-keyword-arguments (package-arguments p)
|
|
|
|
`(#:python ,python))))
|
|
|
|
(inputs (map rewrite (package-inputs p)))
|
|
|
|
(propagated-inputs (map rewrite (package-propagated-inputs p)))
|
|
|
|
(native-inputs (map rewrite (package-native-inputs p)))))
|
|
|
|
(else
|
|
|
|
p))))))
|
2015-10-12 23:44:39 +02:00
|
|
|
|
|
|
|
transform)
|
2013-09-08 16:57:37 +02:00
|
|
|
|
|
|
|
(define package-with-python2
|
2015-03-12 19:31:07 +01:00
|
|
|
;; Note: delay call to 'default-python2' until after the 'arguments' field
|
|
|
|
;; of packages is accessed to avoid a circular dependency when evaluating
|
|
|
|
;; the top-level of (gnu packages python).
|
2015-10-12 23:44:39 +02:00
|
|
|
(package-with-explicit-python (delay (default-python2))
|
2016-02-07 22:43:41 +01:00
|
|
|
"python-" "python2-"
|
|
|
|
#:variant-property 'python2-variant))
|
|
|
|
|
|
|
|
(define (strip-python2-variant p)
|
|
|
|
"Remove the 'python2-variant' property from P."
|
|
|
|
(package
|
|
|
|
(inherit p)
|
|
|
|
(properties (alist-delete 'python2-variant (package-properties p)))))
|
2013-09-08 16:57:37 +02:00
|
|
|
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
(define* (lower name
|
2014-10-05 16:32:25 +02:00
|
|
|
#:key source inputs native-inputs outputs system target
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
(python (default-python))
|
|
|
|
#:allow-other-keys
|
|
|
|
#:rest arguments)
|
|
|
|
"Return a bag for NAME."
|
|
|
|
(define private-keywords
|
|
|
|
'(#:source #:target #:python #:inputs #:native-inputs))
|
|
|
|
|
|
|
|
(and (not target) ;XXX: no cross-compilation
|
|
|
|
(bag
|
|
|
|
(name name)
|
2014-10-05 16:32:25 +02:00
|
|
|
(system system)
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
(host-inputs `(,@(if source
|
|
|
|
`(("source" ,source))
|
|
|
|
'())
|
|
|
|
,@inputs
|
|
|
|
|
|
|
|
;; Keep the standard inputs of 'gnu-build-system'.
|
|
|
|
,@(standard-packages)))
|
|
|
|
(build-inputs `(("python" ,python)
|
|
|
|
,@native-inputs))
|
|
|
|
(outputs outputs)
|
|
|
|
(build python-build)
|
|
|
|
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
|
|
|
|
|
|
|
(define* (python-build store name inputs
|
2013-05-09 00:44:28 +02:00
|
|
|
#:key
|
|
|
|
(tests? #t)
|
2013-11-20 19:03:26 +01:00
|
|
|
(test-target "test")
|
2016-10-02 14:03:32 +02:00
|
|
|
(use-setuptools? #t)
|
2013-05-09 00:44:28 +02:00
|
|
|
(configure-flags ''())
|
|
|
|
(phases '(@ (guix build python-build-system)
|
|
|
|
%standard-phases))
|
|
|
|
(outputs '("out"))
|
|
|
|
(search-paths '())
|
|
|
|
(system (%current-system))
|
|
|
|
(guile #f)
|
2015-04-01 15:34:19 +02:00
|
|
|
(imported-modules %python-build-system-modules)
|
2013-05-09 00:44:28 +02:00
|
|
|
(modules '((guix build python-build-system)
|
|
|
|
(guix build utils))))
|
|
|
|
"Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE
|
|
|
|
provides a 'setup.py' file as its build system."
|
|
|
|
(define builder
|
|
|
|
`(begin
|
|
|
|
(use-modules ,@modules)
|
|
|
|
(python-build #:name ,name
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
#:source ,(match (assoc-ref inputs "source")
|
|
|
|
(((? derivation? source))
|
|
|
|
(derivation->output-path source))
|
|
|
|
((source)
|
|
|
|
source)
|
|
|
|
(source
|
|
|
|
source))
|
2013-05-09 00:44:28 +02:00
|
|
|
#:configure-flags ,configure-flags
|
|
|
|
#:system ,system
|
2013-11-20 19:03:26 +01:00
|
|
|
#:test-target ,test-target
|
2013-05-09 00:44:28 +02:00
|
|
|
#:tests? ,tests?
|
2016-10-02 14:03:32 +02:00
|
|
|
#:use-setuptools? ,use-setuptools?
|
2013-09-10 11:42:07 +02:00
|
|
|
#:phases ,phases
|
2013-05-09 00:44:28 +02:00
|
|
|
#:outputs %outputs
|
|
|
|
#:search-paths ',(map search-path-specification->sexp
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
search-paths)
|
2013-05-09 00:44:28 +02:00
|
|
|
#:inputs %build-inputs)))
|
|
|
|
|
|
|
|
(define guile-for-build
|
|
|
|
(match guile
|
|
|
|
((? package?)
|
packages: Implement grafts.
Thanks to Mark H. Weaver <mhw@netris.org> for insightful discussions
and suggestions.
* guix/packages.scm (<package>)[graft]: New field.
(patch-and-repack): Invoke 'package-derivation' with #:graft? #f.
(package-source-derivation): Likewise. Do not use (%guile-for-build)
in call to 'patch-and-repack', and we could end up using a grafted
Guile.
(expand-input): Likewise, also for 'package-cross-derivation' call.
(package->bag): Add #:graft? parameter. Honor it. Use 'strip-append'
instead of 'package-full-name'.
(input-graft, input-cross-graft, bag-grafts, package-grafts): New
procedures.
(package-derivation, package-cross-derivation): Add #:graft? parameter
and honor it.
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Add
recursive call on 'graft'.
* guix/build-system/gnu.scm (package-with-explicit-inputs,
package-with-extra-configure-variable, static-package): Likewise.
(gnu-build): Use the ungrafted Guile to avoid full rebuilds.
(gnu-cross-build): Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* tests/packages.scm ("package-derivation, direct graft",
"package-cross-derivation, direct graft", "package-grafts,
indirect grafts", "package-grafts, indirect grafts, cross",
"package-grafts, indirect grafts, propagated inputs",
"package-derivation, indirect grafts"): New tests.
("bag->derivation", "bag->derivation, cross-compilation"): Wrap in
'parameterize'.
* doc/guix.texi (Security Updates): New node.
(Invoking guix build): Document --no-graft.
2014-10-27 18:09:00 +01:00
|
|
|
(package-derivation store guile system #:graft? #f))
|
2013-05-09 00:44:28 +02:00
|
|
|
(#f ; the default
|
gnu: Split (gnu packages base), adding (gnu packages commencement).
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0,
findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet,
binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0,
texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash,
cross-gcc-wrapper, static-bash-for-glibc, glibc-final,
gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++,
gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs,
guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final,
%boot5-inputs, %final-inputs, canonical-package, gcc-toolchain,
gcc-toolchain-4.8, gcc-toolchain-4.9): Move to...
* gnu/packages/commencement.scm: ... here. New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* build-aux/check-final-inputs-self-contained.scm: Adjust accordingly.
* gnu/packages/cross-base.scm: Likewise.
* gnu/packages/make-bootstrap.scm: Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/gnu.scm (standard-packages, gnu-build,
gnu-cross-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/download.scm (url-fetch): Likewise.
* guix/gexp.scm (default-guile): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/monads.scm (run-with-store): Likewise.
* guix/packages.scm (default-guile): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths):
Likewise.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh: Likewise.
* gnu/services/base.scm: Use 'canonical-package' instead of xxx-final.
* gnu/services/xorg.scm: Likewise.
* gnu/system/vm.scm: Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-27 00:25:17 +02:00
|
|
|
(let* ((distro (resolve-interface '(gnu packages commencement)))
|
2013-05-09 00:44:28 +02:00
|
|
|
(guile (module-ref distro 'guile-final)))
|
packages: Implement grafts.
Thanks to Mark H. Weaver <mhw@netris.org> for insightful discussions
and suggestions.
* guix/packages.scm (<package>)[graft]: New field.
(patch-and-repack): Invoke 'package-derivation' with #:graft? #f.
(package-source-derivation): Likewise. Do not use (%guile-for-build)
in call to 'patch-and-repack', and we could end up using a grafted
Guile.
(expand-input): Likewise, also for 'package-cross-derivation' call.
(package->bag): Add #:graft? parameter. Honor it. Use 'strip-append'
instead of 'package-full-name'.
(input-graft, input-cross-graft, bag-grafts, package-grafts): New
procedures.
(package-derivation, package-cross-derivation): Add #:graft? parameter
and honor it.
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Add
recursive call on 'graft'.
* guix/build-system/gnu.scm (package-with-explicit-inputs,
package-with-extra-configure-variable, static-package): Likewise.
(gnu-build): Use the ungrafted Guile to avoid full rebuilds.
(gnu-cross-build): Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* tests/packages.scm ("package-derivation, direct graft",
"package-cross-derivation, direct graft", "package-grafts,
indirect grafts", "package-grafts, indirect grafts, cross",
"package-grafts, indirect grafts, propagated inputs",
"package-derivation, indirect grafts"): New tests.
("bag->derivation", "bag->derivation, cross-compilation"): Wrap in
'parameterize'.
* doc/guix.texi (Security Updates): New node.
(Invoking guix build): Document --no-graft.
2014-10-27 18:09:00 +01:00
|
|
|
(package-derivation store guile system #:graft? #f)))))
|
2013-05-09 00:44:28 +02:00
|
|
|
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
(build-expression->derivation store name builder
|
|
|
|
#:inputs inputs
|
|
|
|
#:system system
|
|
|
|
#:modules imported-modules
|
|
|
|
#:outputs outputs
|
|
|
|
#:guile-for-build guile-for-build))
|
2013-05-09 00:44:28 +02:00
|
|
|
|
|
|
|
(define python-build-system
|
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.
2014-10-03 18:06:16 +02:00
|
|
|
(build-system
|
|
|
|
(name 'python)
|
|
|
|
(description "The standard Python build system")
|
|
|
|
(lower lower)))
|
2013-05-09 00:44:28 +02:00
|
|
|
|
|
|
|
;;; python.scm ends here
|