mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
build/python-build-system: Fix easy-install.pth collisions.
* guix/build/python-build-system.scm (rename-pth-file): New rename-pth-file phase and corresponding function.
This commit is contained in:
parent
46a3e00b5b
commit
6f8fe4b29e
1 changed files with 26 additions and 9 deletions
|
@ -105,9 +105,26 @@ (define bindirs
|
||||||
files)))
|
files)))
|
||||||
bindirs)))
|
bindirs)))
|
||||||
|
|
||||||
|
(define* (rename-pth-file #:key name inputs outputs #:allow-other-keys)
|
||||||
|
"Rename easy-install.pth to NAME.pth to avoid conflicts between packages
|
||||||
|
installed with setuptools."
|
||||||
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
(python (assoc-ref inputs "python"))
|
||||||
|
(site-packages (string-append out "/lib/python"
|
||||||
|
(get-python-version python)
|
||||||
|
"/site-packages"))
|
||||||
|
(easy-install-pth (string-append site-packages "/easy-install.pth"))
|
||||||
|
(new-pth (string-append site-packages "/" name ".pth")))
|
||||||
|
(when (file-exists? easy-install-pth)
|
||||||
|
(rename-file easy-install-pth new-pth))
|
||||||
|
#t))
|
||||||
|
|
||||||
(define %standard-phases
|
(define %standard-phases
|
||||||
;; 'configure' and 'build' phases are not needed. Everything is done during
|
;; 'configure' and 'build' phases are not needed. Everything is done during
|
||||||
;; 'install'.
|
;; 'install'.
|
||||||
|
(alist-cons-before
|
||||||
|
'strip 'rename-pth-file
|
||||||
|
rename-pth-file
|
||||||
(alist-cons-after
|
(alist-cons-after
|
||||||
'install 'wrap
|
'install 'wrap
|
||||||
wrap
|
wrap
|
||||||
|
@ -117,7 +134,7 @@ (define %standard-phases
|
||||||
'check check
|
'check check
|
||||||
(alist-replace 'install install
|
(alist-replace 'install install
|
||||||
(alist-delete 'configure
|
(alist-delete 'configure
|
||||||
gnu:%standard-phases))))))
|
gnu:%standard-phases)))))))
|
||||||
|
|
||||||
(define* (python-build #:key inputs (phases %standard-phases)
|
(define* (python-build #:key inputs (phases %standard-phases)
|
||||||
#:allow-other-keys #:rest args)
|
#:allow-other-keys #:rest args)
|
||||||
|
|
Loading…
Reference in a new issue