From c944663d2d64824d7f947dc3f65bd5489fa1f8df Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 21 Sep 2023 15:31:42 +0300 Subject: rtg: Update package definition. --- gn/packages/java.scm | 85 ++++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 39 deletions(-) (limited to 'gn/packages/java.scm') diff --git a/gn/packages/java.scm b/gn/packages/java.scm index cdd9d00..c8e1e9b 100644 --- a/gn/packages/java.scm +++ b/gn/packages/java.scm @@ -19,6 +19,7 @@ (define-module (gn packages java) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix download) #:use-module (guix git-download) @@ -27,11 +28,11 @@ #:use-module (guix build-system ant) #:use-module (gnu packages) #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages bioinformatics) #:use-module (gnu packages certs) #:use-module (gnu packages compression) #:use-module (gnu packages gcc) - #:use-module (gnu packages icu4c) #:use-module (gnu packages java) #:use-module (gnu packages java-compression) #:use-module (gnu packages perl) @@ -325,8 +326,7 @@ piece of information.") (("\"git\"") "\"echo\"") (("\\$\\{vcs\\.cmd\\.out\\}") "${product.version}") (("\\$\\{build\\.time\\}") "1970-01-01") - (("-\\$\\{rtg\\.vcs\\.commit\\.revision\\}") "")) - #t)) + (("-\\$\\{rtg\\.vcs\\.commit\\.revision\\}") "")))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) @@ -337,52 +337,59 @@ piece of information.") (invoke "unzip" (string-append pkg "-nojre.zip")) (copy-recursively (string-append pkg "/") ".") (delete-file-recursively pkg) - (delete-file (string-append pkg "-nojre.zip"))) - #t))) + (delete-file (string-append pkg "-nojre.zip")))))) (add-after 'install 'create-rtg.cfg - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (with-output-to-file (string-append out "/rtg.cfg") (lambda _ (format #t "RTG_JAVA=\"~a\"~@ RTG_TALKBACK=false~@ RTG_USAGE=false~%" - (which "java")))) - #t))) - (add-after 'install 'install-completions - (lambda* (#:key outputs #:allow-other-keys) - (install-file "installer/resources/common/scripts/rtg-bash-completion" - (string-append (assoc-ref outputs "out") - "/share/bash-completion/completions")) - #t)) + (search-input-file inputs "/bin/java"))))))) + (add-after 'install 'create-wrapper-script + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (wrapper (string-append out "/bin/rtg"))) + ;; We want an executable in the bin directory without rewriting + ;; the existing wrapper script. + (mkdir-p (dirname wrapper)) + (with-output-to-file wrapper + (lambda _ + (format #t "#!~a~@ + exec -a \"$0\" \"~a/rtg\" \"$@\"~%" + (search-input-file inputs "/bin/bash") + out))) + (chmod wrapper #o555)))) + (add-after 'install 'install-completions + (lambda* (#:key outputs #:allow-other-keys) + (install-file "installer/resources/common/scripts/rtg-bash-completion" + (string-append (assoc-ref outputs "out") + "/share/bash-completion/completions")))) (delete 'generate-jar-indices)))) ; manually installed (inputs - `(("java-commons-collections" ,java-commons-collections) - ("java-commons-compress" ,java-commons-compress) - ("java-commons-lang" ,java-commons-lang) - ;("java-graal-sdk" ,java-graal-sdk) - ;("java-gzipfix" ,java-gzipfix) - ;("java-htsjdk" ,java-sam-rtg) - ("java-icu4j" ,java-icu4j) - ;("java-js" ,java-js) - ;("java-js-scriptengine" ,java-js-scriptengine) - ;("java-json-simple" ,java-json-simple) - ;("java-regex" ,java-regex) - ;("java-rplot" ,java-rplot) - ("java-snappy" ,java-snappy) - ;("java-truffle-api" ,java-truffle-api) - ;("java-velocity" ,java-velocity) - ;("java-velocity-tools-generic" ,java-velocity-tools-generic) - )) + (list bash-minimal ; for the wrapper script + java-commons-collections + java-commons-compress + java-commons-lang + ;java-gzipfix + ;java-sam-rtg + ;java-json-simple + ;java-rplot + java-snappy + ;java-velocity + ;java-velocity-tools-generic + )) (native-inputs - `(;("java-findbugs-annotations" ,java-findbugs-annotations) - ;("java-findbugs-jsr305" ,java-findbugs-jsr305) - ;("java-jumble-annotations" ,java-jumble-annotations) - ;; for tests - ("java-hamcrest-core" ,java-hamcrest-core) - ("java-junit" ,java-junit) - ;("java-spelling" ,java-spelling) - ("unzip" ,unzip))) + (list ;java-findbugs-annotations + ;java-findbugs-jsr305 + ;java-jumble-annotations + ;; for tests + java-hamcrest-core + java-junit + ;java-spelling + ;; For the 'install phase. + unzip)) (home-page "https://github.com/RealTimeGenomics/rtg-tools/") (synopsis "Utilities for accurate VCF comparison and manipulation") (description "RTG Tools is a subset of RTG Core that includes several useful -- cgit v1.2.3 From 0aaadc958165761b467be003b4ab4de59028414a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 24 Sep 2023 11:00:08 +0300 Subject: rtg-tools: Use a smaller java implementation --- gn/packages/java.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gn/packages/java.scm') diff --git a/gn/packages/java.scm b/gn/packages/java.scm index c8e1e9b..f39c5c7 100644 --- a/gn/packages/java.scm +++ b/gn/packages/java.scm @@ -32,12 +32,20 @@ #:use-module (gnu packages bioinformatics) #:use-module (gnu packages certs) #:use-module (gnu packages compression) + #:use-module (gnu packages cups) #:use-module (gnu packages gcc) #:use-module (gnu packages java) #:use-module (gnu packages java-compression) #:use-module (gnu packages perl) #:use-module (srfi srfi-1)) +;; This is an attempt to make a smaller version of openjdk +(define openjdk11-minimal + (package/inherit openjdk11 + (inputs + (modify-inputs (package-inputs openjdk11) + (replace "cups" cups-minimal))))) + ;; ---------------------------------------------------------------------------- ;; WORKING PACKAGES ;; ---------------------------------------------------------------------------- @@ -316,7 +324,8 @@ piece of information.") (base32 "13fjhhcjgnynxscaymkn3rpdciplbg2m2qmihc7fxsylgn4m6gxk")))) (build-system ant-build-system) (arguments - `(#:build-target "zip-nojre" + `(#:jdk ,openjdk11-minimal + #:build-target "zip-nojre" #:test-target "runalltests" #:phases (modify-phases %standard-phases -- cgit v1.2.3