gnu: Add r-bslib.

* gnu/packages/cran.scm (r-bslib): New variable.
This commit is contained in:
Ricardo Wurmus 2021-02-18 17:48:56 +01:00
parent 281df0d225
commit 22f78a3c81
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1433,6 +1433,80 @@ (define-public r-sass
language, which is stable, powerful, and CSS compatible.")
(license license:expat)))
;; This package includes minified JavaScript files. When upgrading please
;; check that there are no new minified JavaScript files.
(define-public r-bslib
(package
(name "r-bslib")
(version "0.2.4")
(source
(origin
(method url-fetch)
(uri (cran-uri "bslib" version))
(sha256
(base32
"0qlpv2lqr3hjykszmnll7vi4zhmrz4rgcfl0sifxc6cha6jy2nac"))
(snippet
'(for-each delete-file
'("inst/lib/bs-a11y-p/plugins/js/bootstrap-accessibility.min.js"
"inst/lib/bs-colorpicker/js/bootstrap-colorpicker.min.js"
"inst/lib/bs-sass/assets/javascripts/bootstrap.min.js"
"inst/lib/bs/dist/js/bootstrap.bundle.min.js")))))
(properties `((upstream-name . "bslib")))
(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
`(("bs-a11y-p/plugins/js/bootstrap-accessibility.js"
"bs-a11y-p/plugins/js/bootstrap-accessibility.min.js")
("bs-colorpicker/js/bootstrap-colorpicker.js"
"bs-colorpicker/js/bootstrap-colorpicker.min.js")
("bs-sass/assets/javascripts/bootstrap.js"
"bs-sass/assets/javascripts/bootstrap.min.js")
(,(assoc-ref inputs "js-bootstrap-bundle")
"bs/dist/js/bootstrap.bundle.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-digest" ,r-digest)
("r-htmltools" ,r-htmltools)
("r-jquerylib" ,r-jquerylib)
("r-jsonlite" ,r-jsonlite)
("r-magrittr" ,r-magrittr)
("r-rlang" ,r-rlang)
("r-sass" ,r-sass)))
(native-inputs
`(("esbuild" ,esbuild)
("js-bootstrap-bundle"
,(origin
(method url-fetch)
(uri "https://raw.githubusercontent.com/twbs/bootstrap/v4.5.3/dist/js/bootstrap.bundle.js")
(sha256
(base32
"1lcsxj7gcm56va3gck47ggpwzjxrzq27sgjzdw6c54qkp0487sak"))))))
(home-page "https://rstudio.github.io/bslib/")
(synopsis "Custom Bootstrap Sass themes for shiny and rmarkdown")
(description
"This package simplifies custom CSS styling of both shiny and rmarkdown
via Bootstrap Sass. It supports both Bootstrap 3 and 4 as well as their
various Bootswatch themes. An interactive widget is also provided for
previewing themes in real time.")
(license license:expat)))
(define-public r-shiny
(package
(name "r-shiny")