From d6239e12d4daa5b5a3ea3de8228ff0ee148a4078 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 12 Dec 2023 10:39:30 +0100 Subject: [PATCH] gnu: r-rjava: Update to 1.0-10. * gnu/packages/cran.scm (r-rjava): Update to 1.0-10. [source]: Delete bundled minified JavaScript. [arguments]: Use minify-build-system in new phase 'replace-bundled-minified-JavaScript. [native-inputs]: Add esbuild. Change-Id: I6ca7724ea61f53995067cca8d6835fe061621567 --- gnu/packages/cran.scm | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 221a81612c..6c4c367427 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -23579,20 +23579,32 @@ (define-public r-r2html (define-public r-rjava (package (name "r-rjava") - (version "1.0-6") + (version "1.0-10") (source (origin (method url-fetch) (uri (cran-uri "rJava" version)) (sha256 (base32 - "1ijqhvnb8ab38cp9pwdf7zq7xqqlm6x94gkrab2dd98p6d4x1472")))) + "0srrjfqrcp7b6k62qv3d18r97k6kbcz0g4pn2y0rv0f5wlc6i0mm")) + (snippet + '(for-each delete-file + (list "inst/javadoc/jquery/jquery-ui.min.js" + "inst/javadoc/jquery/jszip/dist/jszip.min.js" + "inst/javadoc/jquery/jszip-utils/dist/jszip-utils-ie.min.js" + "inst/javadoc/jquery/jszip-utils/dist/jszip-utils.min.js"))))) (properties `((upstream-name . "rJava"))) (build-system r-build-system) (arguments (list + #:modules '((guix build r-build-system) + (guix build minify-build-system) + (guix build utils) + (ice-9 match)) + #:imported-modules `(,@%r-build-system-modules + (guix build minify-build-system)) #:phases - #~(modify-phases %standard-phases + #~(modify-phases (@ (guix build r-build-system) %standard-phases) (add-after 'unpack 'set-JAVA_HOME (lambda* (#:key inputs #:allow-other-keys) (let ((jdk (assoc-ref inputs "jdk"))) @@ -23604,11 +23616,27 @@ (define-public r-rjava (setenv "JAVA_CPPFLAGS" (string-append "-I" jdk "/include " "-I" jdk "/include/linux")) - (setenv "JAVA_LIBS" (search-input-file inputs "/lib/libjvm.so")))))))) + (setenv "JAVA_LIBS" (search-input-file inputs "/lib/libjvm.so"))))) + (add-after 'unpack 'replace-bundled-minified-JavaScript + (lambda _ + (with-directory-excursion "inst/javadoc" + (for-each (match-lambda + ((source . target) + (minify source #:target target))) + `(("jquery/jquery-ui.js" + . "jquery/jquery-ui.min.js") + ("jquery/jszip/dist/jszip.js" + . "jquery/jszip/dist/jszip.min.js") + ("jquery/jszip-utils/dist/jszip-utils-ie.js" + . "jquery/jszip-utils/dist/jszip-utils-ie.min.js") + ("jquery/jszip-utils/dist/jszip-utils.js" + . "jquery/jszip-utils/dist/jszip-utils.min.js"))))))))) (inputs `(("icu4c" ,icu4c) ("jdk" ,openjdk11 "jdk") ("zlib" ,zlib))) + (native-inputs + (list esbuild)) (home-page "https://www.rforge.net/rJava/") (synopsis "Low-Level R to Java interface") (description