From 676e398c80788583aa5c555ffb03c5fcf433a9f3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 6 Feb 2020 04:37:45 -0600 Subject: gn: ratspub: Patch javascript references --- gn/packages/ratspub.scm | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'gn/packages') 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\">\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\">\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")) -- cgit v1.2.3