From 0e892feec8936bfe852bbaec680bb6de5f4747ee Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 16 Oct 2019 12:43:56 +0300 Subject: gn: rn6-assembly-error-app: Create launcher script. * gn/packages/bioinformatics.scm (rn6-assembly-error-app)[arguments]: Remove some library substitutions. Fix location of png directory. Create launcher script. [inputs]: Add r-minimal. Move r-ggplot2, r-shiny ... [propagated-inputs]: ... to here. Add r. --- gn/packages/bioinformatics.scm | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'gn/packages') diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm index 612ce3e..e537aa8 100644 --- a/gn/packages/bioinformatics.scm +++ b/gn/packages/bioinformatics.scm @@ -741,29 +741,37 @@ different datasets. (use-modules (guix build utils)) (let* ((out (assoc-ref %outputs "out")) (targetdir (string-append out "/share/" ,name)) - (ggplot2 (assoc-ref %build-inputs "r-ggplot2")) - (shiny (assoc-ref %build-inputs "r-shiny")) + (app (string-append out "/bin/" ,name)) + (Rbin (string-append (assoc-ref %build-inputs "r-min") + "/bin/Rscript")) (convert (string-append (assoc-ref %build-inputs "imagemagick") "/bin/convert")) (source (assoc-ref %build-inputs "source"))) - ;; Copied from https://stackoverflow.com/questions/2698269/how-do-you-change-library-location-in-r (copy-recursively source targetdir) (substitute* (string-append targetdir "/server.r") - (("library\\(\"shiny\"" prefix) - (string-append prefix ",lib.loc=" shiny "/site-library\"")) - (("library\\(\"ggplot2\"" prefix) - (string-append prefix ",lib.loc=" ggplot2 "/site-library\"")) - (("convert") convert) - ) + (("./pngs") (string-append targetdir "/pngs")) + (("convert") convert)) + (mkdir-p (string-append out "/bin")) + (call-with-output-file app + (lambda (port) + (format port +"#!~a +library(shiny) +setwd(\"~a\") +runApp(launch.browser=0, port=4202)~%\n" + Rbin targetdir))) + (chmod app #o555) #t)))) (native-inputs `(("source" ,source))) (inputs `(("imagemagick" ,imagemagick) + ("r-min" ,r-minimal))) + (propagated-inputs + `(("freetype" ,freetype) + ("r" ,r) ("r-ggplot2" ,r-ggplot2) ("r-shiny" ,r-shiny))) - (propagated-inputs - `(("freetype" ,freetype))) - (home-page "http://rn6err.opar.io/") ; or similar + (home-page "http://rn6err.opar.io/") (synopsis "Display potential assembly errors in rn6") (description "Display potential assembly errors in rn6.") -- cgit v1.2.3