guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/07: gnu: python-ipykernel: Record absolute file name of 'python'.


From: guix-commits
Subject: 01/07: gnu: python-ipykernel: Record absolute file name of 'python'.
Date: Wed, 17 Jul 2019 09:40:09 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit aa856d02b8018eab059d5a337f613692ac5d93fc
Author: Ludovic Court├Ęs <address@hidden>
Date:   Tue Jul 16 23:25:18 2019 +0200

    gnu: python-ipykernel: Record absolute file name of 'python'.
    
    * gnu/packages/python-xyz.scm (python-ipykernel)[arguments]: Add
    'set-python-file-name' phase.
---
 gnu/packages/python-xyz.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5a89243..9de8203 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5157,7 +5157,17 @@ installing @code{kernelspec}s for use with Jupyter 
frontends.")
            (lambda _
              (setenv "HOME" "/tmp")
              (invoke "pytest" "-v")
-             #t)))))
+             #t))
+         (add-after 'install 'set-python-file-name
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Record the absolute file name of the 'python' executable in
+             ;; 'kernel.json'.
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* (string-append out "/share/jupyter"
+                                           "/kernels/python3/kernel.json")
+                 (("\"python\"")
+                  (string-append "\"" (which "python") "\"")))
+               #t))))))
     (propagated-inputs
      `(("python-ipython" ,python-ipython)
        ;; imported at runtime during connect



reply via email to

[Prev in Thread] Current Thread [Next in Thread]