diff options
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r-- | gnu/packages/java.scm | 800 |
1 files changed, 631 insertions, 169 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 207f136513..a404250d38 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -2,11 +2,11 @@ ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <[email protected]> ;;; Copyright © 2016 Leo Famulari <[email protected]> ;;; Copyright © 2016, 2017 Roel Janssen <[email protected]> -;;; Copyright © 2017, 2019 Carlo Zancanaro <[email protected]> -;;; Copyright © 2017-2020 Julien Lepiller <[email protected]> +;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro <[email protected]> +;;; Copyright © 2017-2021 Julien Lepiller <[email protected]> ;;; Copyright © 2017 Thomas Danckaert <[email protected]> ;;; Copyright © 2016, 2017, 2018 Alex Vong <[email protected]> -;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <[email protected]> +;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <[email protected]> ;;; Copyright © 2018, 2019 Gábor Boskovits <[email protected]> ;;; Copyright © 2018 Chris Marusich <[email protected]> ;;; Copyright © 2018, 2019, 2020 Efraim Flashner <[email protected]> @@ -15,6 +15,8 @@ ;;; Copyright © 2020 Raghav Gururajan <[email protected]> ;;; Copyright © 2020 Maxim Cournoyer <[email protected]> ;;; Copyright © 2021 Vincent Legoll <[email protected]> +;;; Copyright © 2021 Mike Gerwitz <[email protected]> +;;; Copyright © 2021 Pierre Langlois <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -42,6 +44,7 @@ #:use-module (guix utils) #:use-module (guix build-system ant) #:use-module (guix build-system gnu) + #:use-module (guix build-system maven) #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages attr) @@ -70,6 +73,7 @@ #:use-module (gnu packages maths) #:use-module (gnu packages maven) #:use-module (gnu packages maven-parent-pom) + #:use-module (gnu packages ncurses) #:use-module (gnu packages nss) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages web) @@ -1749,6 +1753,9 @@ IcedTea build harness.") ((guix build ant-build-system) (guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references ((,icedtea-7 "jdk")) + ,@(substitute-keyword-arguments (package-arguments icedtea-7) ((#:modules modules) `((guix build utils) @@ -1792,12 +1799,21 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (define remove + (@ (srfi srfi-1) remove)) + + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->list + (getenv "LIBRARY_PATH")))) (find-library (lambda (name) - (search-path - library-path - (string-append "lib" name ".so"))))) + (or (search-path + library-path + (string-append "lib" name ".so")) + (string-append "lib" name ".so"))))) (for-each (lambda (file) (catch 'decoding-error @@ -1805,9 +1821,9 @@ new Date();")) (substitute* file (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)" _ name version) - (format #f "\"~a\"" (find-library name))) + (string-append "\"" (find-library name) "\"")) (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name) - (format #f "\"~a\"" (find-library name))))) + (string-append "\"" (find-library name) "\"")))) (lambda _ ;; Those are safe to skip. (format (current-error-port) @@ -1893,6 +1909,9 @@ new Date();")) #:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,icedtea-8 (,icedtea-8 "jdk")) + #:phases (modify-phases %standard-phases (add-after 'patch-source-shebangs 'fix-java-shebangs @@ -1931,12 +1950,21 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (define remove + (@ (srfi srfi-1) remove)) + + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->list + (getenv "LIBRARY_PATH")))) (find-library (lambda (name) - (search-path - library-path - (string-append "lib" name ".so"))))) + (or (search-path + library-path + (string-append "lib" name ".so")) + (string-append "lib" name ".so"))))) (for-each (lambda (file) (catch 'decoding-error @@ -1944,9 +1972,9 @@ new Date();")) (substitute* file (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)" _ name version) - (format #f "\"~a\"" (find-library name))) + (string-append "\"" (find-library name) "\"")) (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name) - (format #f "\"~a\"" (find-library name))))) + (string-append "\"" (find-library name) "\"")))) (lambda _ ;; Those are safe to skip. (format (current-error-port) @@ -2079,7 +2107,9 @@ new Date();")) "--with-libjpeg=system" "--with-native-debug-symbols=zipped" (string-append "--prefix=" (assoc-ref outputs "out"))) - #t)))))) + #t)))) + ((#:disallowed-references _ '()) + `(,openjdk9 (,openjdk9 "jdk"))))) (native-inputs `(("openjdk9" ,openjdk9) ("openjdk9:jdk" ,openjdk9 "jdk") @@ -2109,6 +2139,9 @@ new Date();")) (arguments `(#:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,openjdk10 (,openjdk10 "jdk")) + #:tests? #f; requires jtreg ;; TODO package jtreg #:configure-flags @@ -2139,12 +2172,21 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (define remove + (@ (srfi srfi-1) remove)) + + (define (icedtea-or-openjdk? path) + (or (string-contains path "openjdk") + (string-contains path "icedtea"))) + + (let* ((library-path (remove icedtea-or-openjdk? + (search-path-as-string->list + (getenv "LIBRARY_PATH")))) (find-library (lambda (name) - (search-path - library-path - (string-append "lib" name ".so"))))) + (or (search-path + library-path + (string-append "lib" name ".so")) + (string-append "lib" name ".so"))))) (for-each (lambda (file) (catch 'decoding-error @@ -2152,9 +2194,9 @@ new Date();")) (substitute* file (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)" _ name version) - (format #f "\"~a\"" (find-library name))) + (string-append "\"" (find-library name) "\"")) (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name) - (format #f "\"~a\"" (find-library name))))) + (string-append "\"" (find-library name) "\"")))) (lambda _ ;; Those are safe to skip. (format (current-error-port) @@ -2388,14 +2430,16 @@ new Date();")) (package (inherit openjdk12) (name "openjdk") - (version "13.0") + (version "13.0.7") (source (origin - (method url-fetch) - (uri "http://hg.openjdk.java.net/jdk/jdk13/archive/9c250a7600e1.tar.bz2") - (file-name (string-append name "-" version ".tar.bz2")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jdk13u") + (commit (string-append "jdk-" version "-ga")))) + (file-name (git-file-name name version)) (sha256 (base32 - "0v0ljvx5dyzp96dw4z4ksw3pvasil7783mgnmd1wk9gads5ab8iq")) + "0wrrr0d7lz1v8qqm752mn4gz5l2vpl2kmx4ac3ysvk4mljc924hp")) (modules '((guix build utils))) (snippet `(begin @@ -2430,14 +2474,16 @@ new Date();")) (package (inherit openjdk13) (name "openjdk") - (version "14.0") + (version "14.0.2") (source (origin - (method url-fetch) - (uri "http://hg.openjdk.java.net/jdk/jdk14/archive/bc54620a3848.tar.bz2") - (file-name (string-append name "-" version ".tar.bz2")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jdk14u") + (commit (string-append "jdk-" version "-ga")))) + (file-name (git-file-name name version)) (sha256 (base32 - "0z485pk7r1xpw8004g4nrwrzj17sabgx8yfdbxwfvzkjp8qyajch")) + "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6")) (modules '((guix build utils))) (snippet `(begin @@ -2472,20 +2518,81 @@ new Date();")) ("zip" ,zip))) (home-page "https://openjdk.java.net/projects/jdk/14"))) +(define-public openjdk15 + (package + (inherit openjdk14) + (name "openjdk") + (version "15.0.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jdk15u") + (commit (string-append "jdk-" version "-ga")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "168cr08nywp0q3vyj8njkhsmmnyd8rz9r58hk4xhzdzc6bdfkl1i")))) + (native-inputs + `(("autoconf" ,autoconf) + ("openjdk14:jdk" ,openjdk14 "jdk") + ("pkg-config" ,pkg-config) + ("unzip" ,unzip) + ("which" ,which) + ("zip" ,zip))) + (home-page "https://openjdk.java.net/projects/jdk/15"))) + +(define-public openjdk16 + (package + (inherit openjdk15) + (name "openjdk") + (version "16.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jdk16u") + (commit (string-append "jdk-" version "-ga")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1ggddsbsar4dj2fycfqqqagqil7prhb30afvq6933rz7pa9apm2f")))) + (native-inputs + `(("autoconf" ,autoconf) + ("openjdk15:jdk" ,openjdk15 "jdk") + ("pkg-config" ,pkg-config) + ("unzip" ,unzip) + ("which" ,which) + ("zip" ,zip))) + (arguments + (substitute-keyword-arguments (package-arguments openjdk15) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'make-templates-writable + (lambda _ + ;; The build system copies a few .template files from the + ;; source directory into the build directory and then modifies + ;; them in-place. So these files have to be writable. + (for-each + (lambda (file) + (invoke "chmod" "u+w" file)) + (find-files "src/java.base/share/classes/jdk/internal/misc/" + "\\.template$")) + #t)))))) + (home-page "https://openjdk.java.net/projects/jdk/16"))) + (define-public icedtea icedtea-8) (define-public ant/java8 (package (inherit ant-bootstrap) (name "ant") - (version "1.10.9") + (version "1.10.10") (source (origin (method url-fetch) (uri (string-append "mirror://apache/ant/source/apache-ant-" version "-src.tar.gz")) (sha256 (base32 - "0x78434q5ab193ma7ys27m9kwpdgrfzqj00hrf1szwcgk0lzw01z")) + "1dhkk9ajc378cln6sj9q0ya8bl9dpyji5xcrl1zq41zx1k6j54g5")) (modules '((guix build utils))) (snippet '(begin @@ -3741,25 +3848,11 @@ documentation tools.") (arguments `(#:jar-name "qdox.jar" #:tests? #f; no tests - #:modules - ((guix build ant-build-system) - (guix build java-utils) - (guix build utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "QDox") - (groupId "com.thoughtworks.qdox") - (artifactId "qdox") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version + #:name "QDox")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://github.com/codehaus/qdox") @@ -3785,7 +3878,14 @@ documentation tools.") "/qdox-" version "-sources.jar")) (sha256 (base32 - "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg")))))) + "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg")))) + (arguments + (substitute-keyword-arguments (package-arguments java-qdox) + ((#:phases phases) + `(modify-phases ,phases + (replace 'create-pom + (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version + #:name "QDox")))))))) (define-public java-jarjar (package @@ -5682,7 +5782,13 @@ The jMock library (build-system ant-build-system) (arguments `(#:tests? #f ; there are no tests - #:jar-name "jopt-simple.jar")) + #:jar-name "jopt-simple.jar" + #:phases + (modify-phases %standard-phases + (add-before 'install 'create-pom + (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version)) + (replace 'install + (install-from-pom "pom.xml"))))) (home-page "https://pholser.github.io/jopt-simple/") (synopsis "Java library for parsing command line options") (description "JOpt Simple is a Java library for parsing command line @@ -5694,6 +5800,28 @@ retrieval of options and their arguments simple and expressive, without being overly clever.") (license license:expat))) +;; Required by jmh +(define-public java-jopt-simple-4 + (package + (inherit java-jopt-simple) + (version "4.6") + (source (origin + (method url-fetch) + (uri (string-append "https://repo1.maven.org/maven2/" + "net/sf/jopt-simple/jopt-simple/" + version "/jopt-simple-" + version "-sources.jar")) + (sha256 + (base32 + "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd")))) + (arguments + (substitute-keyword-arguments (package-arguments java-jopt-simple) + ((#:phases phases) + `(modify-phases ,phases + (replace 'create-pom + (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" + ,version)))))))) + (define-public java-commons-math3 (package (name "java-commons-math3") @@ -5728,7 +5856,7 @@ overly clever.") #t)) ;; There is no install target. (replace 'install - (install-jars "target"))))) + (install-from-pom "pom.xml"))))) (native-inputs `(("java-junit" ,java-junit) ("java-hamcrest-core" ,java-hamcrest-core))) @@ -5742,36 +5870,37 @@ available in the Java programming language or Commons Lang.") (define-public java-jmh (package (name "java-jmh") - (version "1.17.5") + (version "1.32") (source (origin - (method hg-fetch) - (uri (hg-reference - (url "http://hg.openjdk.java.net/code-tools/jmh/") - (changeset version))) - (file-name (string-append name "-" version "-checkout")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jmh") + (commit version))) + (file-name (git-file-name name version)) (sha256 (base32 - "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084")))) - (build-system ant-build-system) + "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0")))) + (build-system maven-build-system) (arguments - `(#:jar-name "jmh-core.jar" - #:source-dir "jmh-core/src/main" - #:test-dir "jmh-core/src/test" + `(#:exclude + (("org.apache.maven.plugins" . + ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin" + "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin")) + ("com.mycila.maven-license-plugin" . ("maven-license-plugin")) + ("org.apache.maven.wagon" . ("wagon-ssh"))) + #:maven-plugins + (("maven-enforcer-plugin" ,maven-enforcer-plugin) + ,@(default-maven-plugins)) #:phases (modify-phases %standard-phases - ;; This seems to be a bug in the JDK. It may not be necessary in - ;; future versions of the JDK. - (add-after 'unpack 'fix-bug + (add-after 'unpack 'remove-unnecessary (lambda _ - (with-directory-excursion - "jmh-core/src/main/java/org/openjdk/jmh/runner/options" - (substitute* '("IntegerValueConverter.java" - "ThreadsValueConverter.java") - (("public Class<Integer> valueType") - "public Class<? extends Integer> valueType"))) - #t))))) - (inputs - `(("java-jopt-simple" ,java-jopt-simple) + ;; requires org.apache.maven.archetype:archetype-packaging. + ;; Its subprojects also require groovy, kotlin and scala, + ;; respectively. + (delete-file-recursively "jmh-archetypes")))))) + (propagated-inputs + `(("java-jopt-simple" ,java-jopt-simple-4) ("java-commons-math3" ,java-commons-math3))) (native-inputs `(("java-junit" ,java-junit) @@ -6357,25 +6486,11 @@ bottlenecks move away from the database in an effectively cached system.") `(#:tests? #f ; no tests included #:jdk ,icedtea-8 #:jar-name "jsr250.jar" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "jsr250") - (groupId "javax.annotation") - (artifactId "jsr250-api") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "javax.annotation" "jsr250-api" ,version + #:name "jsr250")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://jcp.org/en/jsr/detail?id=250") @@ -6404,25 +6519,10 @@ namespaces.") (arguments `(#:tests? #f ; no tests included #:jar-name "jsr305.jar" - #:modules ((guix build ant-build-system) - (guix build java-utils) - (guix build maven pom) - (guix build utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "jsr305") - (groupId "com.google.code.findbugs") - (artifactId "jsr305") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version)) (replace 'install (install-from-pom "pom.xml"))))) (home-page "http://findbugs.sourceforge.net/") @@ -7546,6 +7646,139 @@ means for generating files and compiling new Java classes based on annotations found in your source code.") (license license:epl2.0))) +(define-public java-eclipse-lsp4j-common + (package + (name "java-eclipse-lsp4j-common") + (version "0.10.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/eclipse/lsp4j") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98")))) + (build-system ant-build-system) + (home-page "https://eclipse.org/lsp4j/") + (synopsis "LSP4J common package") + (description "Eclipse LSP4J provides Java bindings for the Language +Server Protocol and the Debug Adapter Protocol. This package is a common +definition intended to be inherited by other packages.") + (license license:epl2.0))) + +(define-public java-eclipse-lsp4j-debug + (package + (inherit java-eclipse-lsp4j-common) + (name "java-eclipse-lsp4j-debug") + (arguments + `(#:jar-name "eclipse-lsp4j-debug.jar" + #:jdk ,openjdk11 + #:tests? #f; tests fail with reflection errors + #:source-dir "org.eclipse.lsp4j.debug/src/main/java" + #:test-dir "org.eclipse.lsp4j.debug/src/test" + #:phases + (modify-phases %standard-phases + (add-before 'build 'copy-xtend + (lambda _ + (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen" + "org.eclipse.lsp4j.debug/src/main/java")))))) + (native-inputs + `(("java-junit" ,java-junit))) + (inputs + `(("java-gson" ,java-gson-2.8.6) + ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator) + ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc) + ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug) + ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib))) + (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol") + (description "Eclipse LSP4J provides Java bindings for the Language +Server Protocol and the Debug Adapter Protocol. This package contains its +LSP4J Java bindings for the Debug Server Protocol."))) + +(define-public java-eclipse-lsp4j-generator + (package + (inherit java-eclipse-lsp4j-common) + (name "java-eclipse-lsp4j-generator") + (arguments + `(#:jar-name "eclipse-lsp4j-generator.jar" + #:jdk ,openjdk11 + #:tests? #f; no tests + #:source-dir "org.eclipse.lsp4j.generator/src/main/java")) + (inputs + `(("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc))) + (synopsis "Eclipse LSP4J Generator") + (description "Eclipse LSP4J provides Java bindings for the Language +Server Protocol and the Debug Adapter Protocol. This package contains its +LSP4J code generator for Language Server Protocol classes."))) + +(define-public java-eclipse-lsp4j-jsonrpc + (package + (inherit java-eclipse-lsp4j-common) + (name "java-eclipse-lsp4j-jsonrpc") + (arguments + `(#:jar-name "eclipse-lsp4j-jsonrpc.jar" + #:jdk ,openjdk11 + #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java" + #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test")) + (native-inputs + `(("java-junit" ,java-junit))) + (inputs + `(("java-gson" ,java-gson-2.8.6))) + (synopsis "Java JSON-RPC implementation") + (description "Eclipse LSP4J provides Java bindings for the Language +Server Protocol and the Debug Adapter Protocol. This package contains its +JSON-RPC implementation."))) + +(define-public java-eclipse-lsp4j-jsonrpc-debug + (package + (inherit java-eclipse-lsp4j-common) + (name "java-eclipse-lsp4j-jsonrpc-debug") + (arguments + `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar" + #:jdk ,openjdk11 + #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java" + #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test")) + (native-inputs + `(("java-junit" ,java-junit))) + (inputs + `(("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc) + ("java-gson" ,java-gson-2.8.6))) + (synopsis "Java JSON-RPC implementation (debug protocol)") + (description "Eclipse LSP4J provides Java bindings for the Language +Server Protocol and the Debug Adapter Protocol. This package contains its +JSON-RPC implementation's debug protocol."))) + +(define-public java-eclipse-xtext-xbase-lib + (package + (name "java-eclipse-xtext-xbase-lib") + (version "2.25.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/eclipse/xtext-lib") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "eclipse-xtext-xbase-lib.jar" + #:jdk ,openjdk11 + #:tests? #f; TODO (maybe needs newer guava version?) + #:source-dir "org.eclipse.xtext.xbase.lib/src" + #:test-dir "org.eclipse.xtext.xbase.lib.tests/src")) + (native-inputs + `(("java-junit" ,java-junit))) + (inputs + `(("java-guava" ,java-guava))) + (home-page "https://www.eclipse.org/Xtext/") + (synopsis "Eclipse Xbase Runtime Library") + (description "This package contains runtime libraries for Xbase languages +such as Xtend.") + (license license:epl2.0))) + (define-public java-javax-mail (package (name "java-javax-mail") @@ -7717,14 +7950,14 @@ This is a part of the Apache Commons Project.") (define-public java-commons-codec (package (name "java-commons-codec") - (version "1.14") + (version "1.15") (source (origin (method url-fetch) (uri (string-append "mirror://apache/commons/codec/source/" "commons-codec-" version "-src.tar.gz")) (sha256 (base32 - "11xr0agckkhm91pb5akf2mbk84yd54gyr178wj57gsm97fi7nkh9")))) + "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj")))) (build-system ant-build-system) (arguments `(#:jar-name "java-commons-codec.jar" @@ -7736,13 +7969,19 @@ This is a part of the Apache Commons Project.") (add-before 'build 'copy-resources (lambda _ (copy-recursively "src/main/resources" - "build/classes") - #t)) + "build/classes"))) (add-before 'check 'copy-test-resources (lambda _ (copy-recursively "src/test/resources" - "build/test-classes") - #t)) + "build/test-classes"))) + (add-before 'check 'skip-ravenous-test + (lambda _ + ;; This test admits to being "memory hungry", but reliably fails + ;; even on a machine that should have plenty (12 GiB). Skip it. + (substitute* + "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java" + (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;") + "return;")))) (replace 'install (install-from-pom "pom.xml"))))) (native-inputs `(("java-commons-lang3" ,java-commons-lang3) @@ -10320,25 +10559,10 @@ this is not a static analysis tool.)") #:jdk ,icedtea-8 #:tests? #f; no tests #:source-dir "aopalliance/src/main" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "aopalliance") - (groupId "aopalliance") - (artifactId "aopalliance") - (version "1.0")))))) - #t)) + (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version)) (replace 'install (install-from-pom "pom.xml"))))) (home-page "http://aopalliance.sourceforge.net") @@ -11463,7 +11687,9 @@ protocol-independent framework to build mail and messaging applications.") "**/ClientUtilsTest.java" ;; End with errors that seem related to our powermock "**/KafkaProducerTest.java" - "**/BufferPoolTest.java"))) + "**/BufferPoolTest.java" + ;; Undeterministic failure, seems to affect mostly ci + "**/GarbageCollectedMemoryPoolTest.java"))) (inputs `(("java-slf4j-api" ,java-slf4j-api) ("java-lz4" ,java-lz4))) @@ -11724,6 +11950,37 @@ string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.") (license license:asl2.0))) +;; This requires a different Java version than 2.8.2 above +(define-public java-gson-2.8.6 + (package + (inherit java-gson) + (name "java-gson") + (version "2.8.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/google/gson") + (commit (string-append "gson-parent-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3")))) + (arguments + `(#:jar-name "gson.jar" + #:jdk ,openjdk11 + #:source-dir "gson/src/main/java" + #:test-dir "gson/src/test" + #:phases + (modify-phases %standard-phases + ;; avoid Maven dependency + (add-before 'build 'fill-template + (lambda _ + (with-directory-excursion "gson/src/main" + (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java" + "java/com/google/gson/internal/GsonBuildConfig.java") + (substitute* "java/com/google/gson/internal/GsonBuildConfig.java" + (("\\$\\{project.version\\}") ,version)))))))))) + (define-public java-hawtjni (package (name "java-hawtjni") @@ -11906,29 +12163,14 @@ sequences to format your console output which works on every platform.") (build-system ant-build-system) (arguments `(#:jar-name "java-jboss-el-api_spec.jar" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases ;; the origin of javax.el:javax.el-api is unknown, so we use this package ;; instead, which implements the same thing. We override the pom file ;; to "rename" the package so it can be found by maven. (add-before 'install 'override-pom - (lambda _ - (delete-file "pom.xml") - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `(project - (modelVersion "4.0.0") - (name "el-api") - (groupId "javax.el") - (artifactId "javax.el-api") - (version "3.0"))))) - #t)) + (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0" + #:name "el-api")) (replace 'install (install-from-pom "pom.xml"))))) (inputs @@ -11960,11 +12202,6 @@ JavaServer Pages (JSP).") #:jdk ,icedtea-8 #:source-dir "." #:tests? #f; no tests - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases ;; the origin of javax.interceptor:javax.interceptor-api is unknown, @@ -11972,18 +12209,8 @@ JavaServer Pages (JSP).") ;; We override the pom file to "rename" the package so it can be found ;; by maven. (add-before 'install 'override-pom - (lambda _ - (delete-file "pom.xml") - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `(project - (modelVersion "4.0.0") - (name "interceptor-api") - (groupId "javax.interceptor") - (artifactId "javax.interceptor-api") - (version "3.0"))))) - #t)) + (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api" + "3.0" #:name "interceptor-api")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://github.com/jboss/jboss-interceptors-api_spec") @@ -12300,6 +12527,104 @@ features that bring it on par with the Z shell line editor.") ("java-junit" ,java-junit) ("java-hawtjni" ,java-hawtjni))))) +(define-public java-jline-terminal + (package + (name "java-jline-terminal") + (version "3.14.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jline/jline3") + (commit (string-append "jline-parent-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "jline-terminal.jar" + #:jdk ,openjdk11 + #:tests? #f; TODO: tests fail on *.caps resource lookups + #:source-dir "terminal/src/main/java" + #:test-dir "terminal/src/test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-build-file + (lambda _ + ;; Conflicts with build directory generated by ant-build-system. + (delete-file "build"))) + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java" + (("= \"infocmp\"") + (string-append "= \"" (assoc-ref inputs "ncurses") + "/bin/infocmp\"")) + (("= \"(s?tty)\"" _ cmd) + (string-append "= \"" (assoc-ref inputs "coreutils") + "/bin/" cmd "\""))))) + ;; Resources are not added to the JAR by ant-build-system. + (add-after 'build 'add-resources + (lambda* (#:key jar-name source-dir #:allow-other-keys) + (let ((build (string-append (getcwd) "/build"))) + (with-directory-excursion + (string-append source-dir "/../resources") + (apply invoke "jar" "-uvf" + (string-append build "/jar/" jar-name) + (find-files "."))))))))) + (inputs + `(("ncurses" ,ncurses))); infocmp + (home-page "https://github.com/jline/jline3") + (synopsis "Java JLine Terminal API and implementations") + (description "JLine is a Java library for handling console input. It is +similar in functionality to BSD editline and GNU readline but with additional +features that bring it in par with ZSH line editor. People familiar with the +readline/editline capabilities for modern shells (such as bash and tcsh) will +find most of the command editing features of JLine to be familiar. + +This package includes the @var{Terminal} API and implementations.") + (license license:bsd-3))) + +(define-public java-jline-reader + (package + (name "java-jline-reader") + (version "3.14.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jline/jline3") + (commit (string-append "jline-parent-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "jline-reader.jar" + #:jdk ,openjdk11 + #:source-dir "reader/src/main/java" + #:test-dir "reader/src/test" + #:phases + (modify-phases %standard-phases + (add-before 'build 'remove-build-file + (lambda _ + ;; conflicts with build directory generated by ant-build-system + (delete-file "build")))))) + (native-inputs + `(("java-junit" ,java-junit) + ("java-easymock" ,java-easymock))) + (inputs + `(("java-jline-terminal" ,java-jline-terminal))) + (home-page "https://github.com/jline/jline3") + (synopsis "Java JLine line reader") + (description "JLine is a Java library for handling console input. It is +similar in functionality to BSD editline and GNU readline but with additional +features that bring it in par with ZSH line editor. People familiar with the +readline/editline capabilities for modern shells (such as bash and tcsh) will +find most of the command editing features of JLine to be familiar. + +This package includes the line reader.") + (license license:bsd-3))) + (define-public java-xmlunit (package (name "java-xmlunit") @@ -13710,7 +14035,7 @@ can be interpreted by IDEs and static analysis tools to improve code analysis.") (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix") (("\\$\\{java.version\\}") "1.8") (("\\$\\{os.arch\\}") "any") - (("\\$\\{os.name\\}") "GuixSD") + (("\\$\\{os.name\\}") "Guix") (("\\$\\{os.version\\}") "not available"))) #t)) (add-before 'build 'generate-javacc @@ -13764,3 +14089,140 @@ can be interpreted by IDEs and static analysis tools to improve code analysis.") ;; either lgpl or asl license:lgpl3+ license:asl2.0)))) + +(define-public tla2tools + ;; This package was originally based on the "v1.8.0" tag, but that merely + ;; points to the moving master branch. That might be because the ‘latest + ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than + ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0. + (let* ((release "1.7.1") + (revision "0") + (commit "6932e19083fc6df42473464857fc1280cb5aaecc")) + (package + (name "tla2tools") + (version (git-version release revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tlaplus/tlaplus") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs")) + (patches + (search-patches "tla2tools-build-xml.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove packaged libraries (see 'replace-libs below) + (for-each delete-file (find-files "." ".*.jar$")))))) + (build-system ant-build-system) + (arguments + (let* ((tlatools "tlatools/org.lamport.tlatools/") + (build-xml (string-append tlatools "customBuild.xml"))) + `(#:jdk ,openjdk11 + #:modules ((guix build ant-build-system) + (guix build utils) + (ice-9 match) + (srfi srfi-26)) + #:make-flags '("-f" ,build-xml) + #:phases + (modify-phases %standard-phases + ;; Replace packed libs with references to jars in store + (add-after 'unpack 'replace-libs + (lambda* (#:key inputs #:allow-other-keys) + (define (input-jar input) + (car (find-files (assoc-ref inputs input) "\\.jar$"))) + (for-each + (match-lambda + ((file . input) + (symlink (input-jar input) + (string-append ,tlatools "/lib/" file)))) + '(("gson/gson-2.8.6.jar" . "java-gson") + ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail") + ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal") + ("jline/jline-reader-3.14.1.jar" . "java-jline-reader") + ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" . + "java-eclipse-lsp4j-debug") + ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" . + "java-eclipse-lsp4j-jsonrpc") + ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" . + "java-eclipse-lsp4j-jsonrpc-debug") + ("junit-4.12.jar" . "java-junit") + ("easymock-3.3.1.jar" . "java-easymock"))) + ;; Retain a tiny subset of the original X-Git-* + ;; manifest values just to aid in debugging. + (substitute* ,build-xml + (("\\$\\{git.tag\\}") (string-append "v" ,release))))) + (add-before 'check 'prepare-tests + (lambda _ + ;; The pcal tests write to .cfg files. + (for-each (cut chmod <> #o644) + (find-files (string-append ,tlatools + "/test-model/pcal") + "\\.cfg$")))) + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (let* ((share (string-append %output "/share/java")) + (jar-name "tla2tools.jar"); set in project.properties + (jar (string-append ,tlatools + "/dist/" jar-name)) + (java-cp (string-append share "/" jar-name)) + (bin (string-append %output "/bin")) + (java (string-append (assoc-ref inputs "jdk") + "/bin/java"))) + (install-file jar share) + (mkdir-p bin) + ;; Generate wrapper scripts for bin/, which invoke common + ;; commands within tla2tools.jar. Users can still invoke + ;; tla2tools.jar for the rest. + (for-each + (match-lambda + ((wrapper . class) + (let ((file (string-append bin "/" wrapper))) + (begin + (with-output-to-file file + (lambda _ + (display + (string-append + "#!/bin/sh\n" + java " -cp " java-cp " " class " \"$@\"")))) + (chmod file #o755))))) + ;; bin/wrapper . java-class + '(("pcal" . "pcal.trans") + ("tlatex" . "tla2tex.TLA") + ("tla2sany" . "tla2sany.SANY") + ("tlc2" . "tlc2.TLC") + ("tlc2-repl" . "tlc2.REPL")))))))))) + (native-inputs + `(("java-junit" ,java-junit) + ("java-easymock" ,java-easymock))) + (inputs + `(("java-javax-mail" ,java-javax-mail) + ("java-gson" ,java-gson-2.8.6) + ("java-jline-terminal" ,java-jline-terminal) + ("java-jline-reader" ,java-jline-reader) + ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc) + ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug) + ("java-eclipse-lsp4j-debug" ,java-eclipse-lsp4j-debug))) + (home-page "https://lamport.azurewebsites.net/tla/tools.html") + (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)") + (description "TLA+ is a high-level language for modeling programs and +systems---especially concurrent and distributed ones. It's based on the idea +that the best way to describe things precisely is with simple +mathematics. TLA+ and its tools are useful for eliminating fundamental design +errors, which are hard to find and expensive to correct in code. + +The following TLA+ tools are available in this distribution: + +@itemize +@item The Syntactic Analyzer: A parser and syntax checker for + TLA+ specifications; +@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+ + specifications; +@item TLATeX: A program for typesetting TLA+ specifications; +@item Beta test versions of 1-3 for the TLA+2 language; and +@item The PlusCal translator. +@end itemize") + (license license:expat)))) |