aboutsummaryrefslogtreecommitdiff
path: root/gn
diff options
context:
space:
mode:
Diffstat (limited to 'gn')
-rw-r--r--gn/packages/javascript.scm24
-rw-r--r--gn/packages/ratspub.scm80
2 files changed, 83 insertions, 21 deletions
diff --git a/gn/packages/javascript.scm b/gn/packages/javascript.scm
index 79a8060..95d4154 100644
--- a/gn/packages/javascript.scm
+++ b/gn/packages/javascript.scm
@@ -1121,3 +1121,27 @@ widgets, and themes built on top of the jQuery JavaScript Library.")
(name "js-jquery-ui")
(arguments `(#:javascript-files '("ui/jquery-ui.js")))
(build-system minify-build-system)))
+
+(define-public js-popper
+ (package
+ (name "js-popper")
+ (version "2.0.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/popperjs/popper-core")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0lzy981p9nja2l3xa2zvals6q31v3bzpxxa85yn9pm7wkj3vglf2"))))
+ (build-system minify-build-system)
+ (arguments
+ `(#:javascript-files '("src/popper.js")))
+ (home-page "https://popper.js.org/")
+ (synopsis "Tooltip and popover positioning engine")
+ (description
+ "Given an element, such as a button, and a tooltip element describing it,
+Popper will automatically put the tooltip in the right place near the button.")
+ (license license:expat)))
diff --git a/gn/packages/ratspub.scm b/gn/packages/ratspub.scm
index 694379a..3e5727c 100644
--- a/gn/packages/ratspub.scm
+++ b/gn/packages/ratspub.scm
@@ -6,6 +6,8 @@
#:use-module (gnu packages admin)
#:use-module (gnu packages bioinformatics)
#:use-module (gn packages javascript)
+ #:use-module (gnu packages time)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gn packages web))
@@ -13,16 +15,16 @@
(define-public ratspub
(package
(name "ratspub")
- (version "0.1")
+ (version "0.2.2")
(source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/chen42/ratspub.git")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0cm9g38fxpa52458mdmhzhghj5c7b8l3k1b764zs9hdrki5s7wi7"))))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/chen42/ratspub.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q111fsch69kjv96d0pld9agqpwazh9p47vsvig63hmmjp72wa84"))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; no test suite
@@ -34,12 +36,24 @@
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(inetutils (assoc-ref inputs "inetutils")))
- (substitute* "templates/cytoscape.html"
+ (substitute* '("templates/cytoscape.html"
+ "templates/tableview.html"
+ "templates/tableview0.html"
+ "templates/userarchive.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"))
+ (("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css.*")
+ "/static/bootstrap.min.css\">\n")
+ (("https://.*.bootstrapcdn.com/bootstrap/4.*/js/bootstrap.min.js.*")
+ "/static/bootstrap.min.js\"></script>\n")
+ (("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css")
+ "/static/font-awesome.min.css")
+ (("https://code.jquery.com/jquery-3.2.1.slim.min.js.*")
+ "/static/jquery.slim.min.js\"></script>\n")
+ ;(("https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js.*")
+ ; "/static/popper.min.js\"></script>\n")
+ )
(substitute* "ratspub.py"
(("hostname") (string-append inetutils "/bin/hostname"))))
#t))
@@ -51,34 +65,58 @@
(add-after 'install 'install-javascript
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
+ (awesome (assoc-ref inputs "font-awesome"))
+ (bootstrap (assoc-ref inputs "bootstrap"))
(cytoscape (assoc-ref inputs "cytoscape"))
- (bootstrap (assoc-ref inputs "bootstrap")))
+ (jquery (assoc-ref inputs "jquery"))
+ ;(js-popper (assoc-ref inputs "js-popper"))
+ )
+ (symlink (string-append awesome
+ "/share/web/font-awesomecss/font-awesome.min.css")
+ (string-append out "/static/font-awesome.min.css"))
+ (symlink (string-append bootstrap
+ "/share/web/bootstrap/css/bootstrap.min.css")
+ (string-append out "/static/bootstrap.min.css"))
+ (symlink (string-append bootstrap
+ "/share/web/bootstrap/js/bootstrap.min.js")
+ (string-append out "/static/bootstrap.min.js"))
(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")))
+ (symlink (string-append jquery
+ "/share/web/jquery/jquery.slim.min.js")
+ (string-append out "/static/jquery.slim.min.js"))
+ ;(symlink (string-append js-popper
+ ; "/share/web/popper/popper.min.js")
+ ; (string-append out "/static/popper.min.js"))
+ )
#t))
(add-after 'install 'wrap-executable
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(path (getenv "PYTHONPATH")))
(wrap-program (string-append out "/server.py")
- `("PATH" ":" prefix (,(dirname (which "edirect.pl"))
+ `("PATH" ":" prefix (,(dirname (which "edirect.pl"))
,(dirname (which "dirname"))
,(dirname (which "grep"))
,(dirname (which "sed"))))
- `("PYTHONPATH" ":" prefix (,path))))
+ `("PYTHONPATH" ":" prefix (,path))))
#t)))))
(inputs
`(("edirect" ,edirect)
("inetutils" ,inetutils)
+ ("python-bcrypt" ,python-bcrypt)
("python-flask" ,python-flask)
- ("python-nltk" ,python-nltk)))
+ ("python-flask-sqlalchemy" ,python-flask-sqlalchemy)
+ ("python-nltk" ,python-nltk)
+ ("python-pytz" ,python-pytz)))
(native-inputs
- `(("cytoscape" ,javascript-cytoscape)
- ("bootstrap" ,web-bootstrap)))
+ `(("bootstrap" ,web-bootstrap)
+ ("cytoscape" ,javascript-cytoscape)
+ ("font-awesome" ,web-font-awesome)
+ ("jquery" ,web-jquery)
+ ;("js-popper" ,js-popper)
+ ))
(home-page "http://rats.pub/")
(synopsis "Relationship with Addiction Through Searches of PubMed")
(description