guix: python: Switch to python-wrapper as the default version for the python
build system (switches to Python 3) and compute python-version instead of passing it as a parameter. * guix/build-system/python.scm (default-python): Switch to python-wrapper. * guix/build-system/python.scm (python-build): Drop parameter #:python-version. * guix/build/python-build-system.scm (wrap): Compute python version from input.master
parent
ee3e314bb7
commit
3df47231e6
|
@ -39,13 +39,11 @@
|
||||||
"Return the default Python package."
|
"Return the default Python package."
|
||||||
;; Lazily resolve the binding to avoid a circular dependency.
|
;; Lazily resolve the binding to avoid a circular dependency.
|
||||||
(let ((python (resolve-interface '(gnu packages python))))
|
(let ((python (resolve-interface '(gnu packages python))))
|
||||||
(module-ref python 'python)))
|
(module-ref python 'python-wrapper)))
|
||||||
|
|
||||||
(define* (python-build store name source inputs
|
(define* (python-build store name source inputs
|
||||||
#:key
|
#:key
|
||||||
(python (default-python))
|
(python (default-python))
|
||||||
(python-version
|
|
||||||
(string-take (package-version (default-python)) 3))
|
|
||||||
(tests? #t)
|
(tests? #t)
|
||||||
(configure-flags ''())
|
(configure-flags ''())
|
||||||
(phases '(@ (guix build python-build-system)
|
(phases '(@ (guix build python-build-system)
|
||||||
|
@ -62,6 +60,7 @@
|
||||||
(guix build utils))))
|
(guix build utils))))
|
||||||
"Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE
|
"Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE
|
||||||
provides a 'setup.py' file as its build system."
|
provides a 'setup.py' file as its build system."
|
||||||
|
|
||||||
(define python-search-paths
|
(define python-search-paths
|
||||||
(append (package-native-search-paths python)
|
(append (package-native-search-paths python)
|
||||||
(standard-search-paths)))
|
(standard-search-paths)))
|
||||||
|
@ -78,7 +77,6 @@ provides a 'setup.py' file as its build system."
|
||||||
#:test-target "test"
|
#:test-target "test"
|
||||||
#:tests? ,tests?
|
#:tests? ,tests?
|
||||||
#:outputs %outputs
|
#:outputs %outputs
|
||||||
#:python-version ,python-version
|
|
||||||
#:search-paths ',(map search-path-specification->sexp
|
#:search-paths ',(map search-path-specification->sexp
|
||||||
(append python-search-paths
|
(append python-search-paths
|
||||||
search-paths))
|
search-paths))
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
(zero? (apply system* "python" args)))
|
(zero? (apply system* "python" args)))
|
||||||
(error "no setup.py found")))
|
(error "no setup.py found")))
|
||||||
|
|
||||||
(define* (wrap #:key outputs python-version #:allow-other-keys)
|
(define* (wrap #:key inputs outputs #:allow-other-keys)
|
||||||
(define (list-of-files dir)
|
(define (list-of-files dir)
|
||||||
(map (cut string-append dir "/" <>)
|
(map (cut string-append dir "/" <>)
|
||||||
(or (scandir dir (lambda (f)
|
(or (scandir dir (lambda (f)
|
||||||
|
@ -69,6 +69,8 @@
|
||||||
outputs))
|
outputs))
|
||||||
|
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
(python (assoc-ref inputs "python"))
|
||||||
|
(python-version (string-take (string-take-right python 5) 3))
|
||||||
(var `("PYTHONPATH" prefix
|
(var `("PYTHONPATH" prefix
|
||||||
,(cons (string-append out "/lib/python"
|
,(cons (string-append out "/lib/python"
|
||||||
python-version "/site-packages")
|
python-version "/site-packages")
|
||||||
|
|
Reference in New Issue