guix-commits
[Top][All Lists]
Advanced

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

02/06: gnu: jupyter-guile-kernel: Add dependencies to the search path.


From: Ludovic Courtès
Subject: 02/06: gnu: jupyter-guile-kernel: Add dependencies to the search path.
Date: Tue, 11 Sep 2018 11:47:03 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 8539eb5c464015cf3b4417d859b275f105991d77
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 11 15:10:46 2018 +0200

    gnu: jupyter-guile-kernel: Add dependencies to the search path.
    
    This allows:
    
      guix environment --ad-hoc jupyter jupyter-guile-kernel \
        -- jupyter notebook
    
    to work out-of-the-box.
    
    * gnu/packages/guile.scm (jupyter-guile-kernel)[arguments]: In
    'install-kernel' phase, add '-L' and '-C' flags to 'kernel.json'.
    [propagated-inputs]: Remove.
    [inputs]: Add GUILE-JSON and GUILE-SIMPLE-ZMQ.
---
 gnu/packages/guile.scm | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 16db4ea..4ee887b 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -2130,9 +2130,13 @@ messaging library.")
 
                     (add-after 'install 'install-kernel
                       (lambda* (#:key inputs outputs #:allow-other-keys)
-                        (let* ((out (assoc-ref outputs "out"))
-                               (dir (string-append
-                                     out "/share/jupyter/kernels/guile")))
+                        (let* ((out   (assoc-ref outputs "out"))
+                               (json  (assoc-ref inputs "guile-json"))
+                               (zmq   (assoc-ref inputs "guile-simple-zmq"))
+                               (deps  (list json zmq))
+                               (dir   (string-append
+                                       out "/share/jupyter/kernels/guile"))
+                               (effective (target-guile-effective-version)))
                           ;; Install kernel.
                           (install-file "src/kernel.json" dir)
 
@@ -2146,13 +2150,30 @@ messaging library.")
                              (string-append "\"" (assoc-ref inputs "guile")
                                             "/bin/guile\""))
                             (("-s")
-                             (string-append "--no-auto-compile\", \"-s")))
+                             ;; Add '-L' and '-C' flags so that the kernel
+                             ;; finds its dependencies.
+                             (let ((-L (map (lambda (item)
+                                              (string-append "\"" item
+                                                             
"/share/guile/site/"
+                                                             effective "\""))
+                                            deps))
+                                   (-C (map (lambda (item)
+                                              (string-append "\"" item
+                                                             "/lib/guile/"
+                                                             effective
+                                                             "/site-ccache\""))
+                                            deps)))
+                              (string-append "--no-auto-compile\""
+                                             (string-join -L ", \"-L\", "
+                                                          'prefix)
+                                             (string-join -C ", \"-C\", "
+                                                          'prefix)
+                                             ", \"-s"))))
                           #t))))))
       (inputs
        `(("openssl" ,openssl)
-         ("guile" ,guile-2.2)))
-      (propagated-inputs
-       `(("guile-json" ,guile-json)
+         ("guile" ,guile-2.2)
+         ("guile-json" ,guile-json)
          ("guile-simple-zmq" ,guile-simple-zmq)))
       (synopsis "Guile kernel for the Jupyter Notebook")
       (description



reply via email to

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