about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner2020-02-06 04:37:45 -0600
committerEfraim Flashner2020-02-06 04:39:55 -0600
commit676e398c80788583aa5c555ffb03c5fcf433a9f3 (patch)
tree691285f4e3b77327d6291322c4bfd501a4e44127
parent5eb0b0bdba3374cee96006cd1006603bbe13e36b (diff)
downloadguix-bioinformatics-676e398c80788583aa5c555ffb03c5fcf433a9f3.tar.gz
gn: ratspub: Patch javascript references
-rw-r--r--gn/packages/ratspub.scm28
1 files changed, 18 insertions, 10 deletions
diff --git a/gn/packages/ratspub.scm b/gn/packages/ratspub.scm
index 81959a0..29e1313 100644
--- a/gn/packages/ratspub.scm
+++ b/gn/packages/ratspub.scm
@@ -33,17 +33,13 @@
          (add-after 'unpack 'patch-sources
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out       (assoc-ref outputs "out"))
-                   (cytoscape (assoc-ref inputs "cytoscape"))
-                   (bootstrap (assoc-ref inputs "bootstrap"))
                    (inetutils (assoc-ref inputs "inetutils")))
-               ;; Source cannot find the substituted css currently.
-               ;(substitute* "templates/cytoscape.html"
-               ;  (("script src=.*")
-               ;   (string-append "script src=\"" cytoscape
-               ;                  "/share/genenetwork2/javascript/cytoscape/cytoscape.min.js\"></script>\n")))
-               ;(substitute* "templates/layout.html"
-               ;  (("https://stackpath.bootstrapcdn.com/bootstrap/.*")
-               ;   (string-append bootstrap "/share/web/bootstrap/css/bootstrap.min.css\">\n")))
+               (substitute* "templates/cytoscape.html"
+                 (("script src=.*")
+                  "script src=\"/static/cytoscape.min.js\"></script>\n"))
+               (substitute* "templates/layout.html"
+                 (("https://stackpath.bootstrapcdn.com/bootstrap/.*")
+                  "/static/bootstrap.min.css\">\n"))
                (substitute* "ratspub.py"
                  (("hostname") (string-append inetutils "/bin/hostname"))))
              #t))
@@ -52,6 +48,18 @@
              (let ((out (assoc-ref outputs "out")))
                (copy-recursively "." out))
              #t))
+         (add-after 'install 'install-javascript
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out       (assoc-ref outputs "out"))
+                   (cytoscape (assoc-ref inputs "cytoscape"))
+                   (bootstrap (assoc-ref inputs "bootstrap")))
+               (symlink (string-append cytoscape
+                                       "/share/genenetwork2/javascript/cytoscape/cytoscape.min.js")
+                        (string-append out "/static/cytoscape.min.js"))
+               (symlink (string-append bootstrap
+                                       "/share/web/bootstrap/css/bootstrap.min.css")
+                        (string-append out "/static/bootstrap.min.css")))
+             #t))
          (add-after 'install 'wrap-executable
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out  (assoc-ref outputs "out"))