gnu: r-shinytree: Update to 0.3.1.

* gnu/packages/cran.scm (r-shinytree): Update to 0.3.1.
[source]: Simplify snippet.
[arguments]: Use esbuild for minification; drop trailing #T from build phase.
[native-inputs]: Replace node-uglify-js with esbuild.
This commit is contained in:
Ricardo Wurmus 2023-08-28 13:27:00 +02:00
parent 3a2f1d98eb
commit 382eba2656
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -4605,32 +4605,29 @@ (define-public r-shinyhelper
(define-public r-shinytree (define-public r-shinytree
(package (package
(name "r-shinytree") (name "r-shinytree")
(version "0.2.7") (version "0.3.1")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (cran-uri "shinyTree" version)) (uri (cran-uri "shinyTree" version))
(sha256 (sha256
(base32 (base32
"0jfx2capckv7hf2yx3fn8i4rcmhi222ah91jnmhg497x8wgz31s3")) "0krffsgdv99cvyzdspb9l7cdnq1vibsbmpd4w48r5pi4v8jbvfj6"))
(modules '((guix build utils)))
(snippet (snippet
'(begin ;; Delete minified JavaScript
;; Delete minified JavaScript '(for-each delete-file
(for-each delete-file '("inst/www/jsTree-3.3.7/libs/require.js"
'("inst/www/jsTree-3.3.7/libs/require.js" "inst/www/jsTree-3.3.7/libs/jquery.js"
"inst/www/jsTree-3.3.7/libs/jquery.js" "inst/www/jsTree-3.3.7/jstree.min.js")))))
"inst/www/jsTree-3.3.7/jstree.min.js"))
#t))))
(properties `((upstream-name . "shinyTree"))) (properties `((upstream-name . "shinyTree")))
(build-system r-build-system) (build-system r-build-system)
(arguments (arguments
`(#:modules ((guix build utils) (list
#:modules '((guix build utils)
(guix build r-build-system) (guix build r-build-system)
(srfi srfi-1) (srfi srfi-1))
(ice-9 popen)) #:phases
#:phases '(modify-phases %standard-phases
(modify-phases %standard-phases
(add-after 'unpack 'replace-minified-javascript (add-after 'unpack 'replace-minified-javascript
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(with-directory-excursion "inst/www/jsTree-3.3.7/" (with-directory-excursion "inst/www/jsTree-3.3.7/"
@ -4648,18 +4645,15 @@ (define-public r-shinytree
(for-each (lambda (source target) (for-each (lambda (source target)
(format #t "Processing ~a --> ~a~%" (format #t "Processing ~a --> ~a~%"
source target) source target)
(let ((minified (open-pipe* OPEN_READ "uglifyjs" source))) (invoke "esbuild" source "--minify"
(call-with-output-file target (string-append "--outfile=" target)))
(lambda (port) sources targets)))))))))
(dump-port minified port)))))
sources targets))))
#t)))))
(propagated-inputs (propagated-inputs
(list r-htmlwidgets r-jsonlite r-promises r-shiny r-stringr)) (list r-htmlwidgets r-jsonlite r-promises r-shiny r-stringr))
(inputs (inputs
(list js-requirejs)) (list js-requirejs))
(native-inputs (native-inputs
`(("uglifyjs" ,node-uglify-js) `(("esbuild" ,esbuild)
("js-jquery" ("js-jquery"
,(origin ,(origin
(method url-fetch) (method url-fetch)