guix-commits
[Top][All Lists]
Advanced

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

01/04: gnu: Add r-jquerylib.


From: guix-commits
Subject: 01/04: gnu: Add r-jquerylib.
Date: Thu, 18 Feb 2021 11:52:58 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit 8dac2e0d1e2486f68ef8348c415a962035fc9f41
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Feb 18 17:47:55 2021 +0100

    gnu: Add r-jquerylib.
    
    * gnu/packages/cran.scm (r-jquerylib): New variable.
---
 gnu/packages/cran.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index e025ded..0daf67e 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -1344,6 +1344,65 @@ are used.  Fastmap avoids this memory leak issue by 
implementing the map using
 data structures in C++.")
     (license license:expat)))
 
+;; This package includes minified JavaScript files.  When upgrading please
+;; check that there are no new minified JavaScript files.
+(define-public r-jquerylib
+  (package
+    (name "r-jquerylib")
+    (version "0.1.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "jquerylib" version))
+       (sha256
+        (base32
+         "1s0d6mws13hwkx07jqmry7vp30a05b2p9w7ir68bmkhasidwkzdq"))
+       (snippet
+        '(for-each delete-file
+                   '("inst/lib/jquery-1.12.4.min.js"
+                     "inst/lib/jquery-2.2.4.min.js"
+                     "inst/lib/jquery-3.5.1.min.js")))))
+    (properties `((upstream-name . "jquerylib")))
+    (build-system r-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (guix build r-build-system)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'process-javascript
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "inst/lib/"
+               (call-with-values
+                   (lambda ()
+                     (unzip2
+                      `(("jquery-1.12.4.js"
+                         "jquery-1.12.4.min.js")
+                        ("jquery-2.2.4.js"
+                         "jquery-2.2.4.min.js")
+                        ("jquery-3.5.1.js"
+                         "jquery-3.5.1.min.js"))))
+                 (lambda (sources targets)
+                   (for-each (lambda (source target)
+                               (format #t "Processing ~a --> ~a~%"
+                                       source target)
+                               (invoke "esbuild" source "--minify"
+                                       (string-append "--outfile=" target)))
+                             sources targets)))))))))
+    (propagated-inputs
+     `(("r-htmltools" ,r-htmltools)))
+    (native-inputs
+     `(("esbuild" ,esbuild)))
+    (home-page "https://cran.r-project.org/package=jquerylib";)
+    (synopsis "Obtain jQuery as an HTML dependency object")
+    (description
+     "Obtain any major version of jQuery and use it in any webpage generated
+by htmltools (e.g. shiny, htmlwidgets, and rmarkdown).  Most R users don't
+need to use this package directly, but other R packages (e.g. shiny,
+rmarkdown, etc.) depend on this package to avoid bundling redundant copies of
+jQuery.")
+    (license license:expat)))
+
 (define-public r-shiny
   (package
     (name "r-shiny")



reply via email to

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