gnu: python-numpy: Give sh store location instead of setting $SHELL.

* gnu/packages/python.scm (python-numpy): [arguments] Don't set $SHELL in the
  environment, but embed the store location of bash-minimal as a default
  shell.  Otherwise, we have to set $SHELL for every package which uses
  numpy's distutils.
This commit is contained in:
Thomas Danckaert 2017-10-01 14:32:04 +02:00
parent 48b68c6178
commit 1033cdbb0c
No known key found for this signature in database
GPG key ID: 5C3B064C724A5726

View file

@ -3742,8 +3742,6 @@ (define-public python-numpy
(modify-phases %standard-phases
(add-before 'build 'set-environment-variables
(lambda* (#:key inputs #:allow-other-keys)
;; numpy's distutils uses $SHELL to run external commands.
(setenv "SHELL" "bash")
(call-with-output-file "site.cfg"
(lambda (port)
(format port
@ -3762,6 +3760,11 @@ (define-public python-numpy
(assoc-ref inputs "openblas")
(assoc-ref inputs "lapack")
(assoc-ref inputs "lapack"))))
;; Make /gnu/store/...-bash-.../bin/sh the default shell, instead of
;; /bin/sh.
(substitute* "numpy/distutils/exec_command.py"
(("(os.environ.get\\('SHELL', ')(/bin/sh'\\))" match match-start match-end)
(string-append match-start (assoc-ref inputs "bash") match-end)))
;; Use "gcc" executable, not "cc".
(substitute* "numpy/distutils/system_info.py"
(("c = distutils\\.ccompiler\\.new_compiler\\(\\)")