From 97a43db8b4416a1450aa61737edba9cf4126cf1c Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sat, 17 Apr 2021 16:33:06 +1000 Subject: gnu: openjdk: Clean up runtime dependencies between Java versions. * gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11): Do not consider icedtea/openjdk input paths when rewriting JNI libraries. Signed-off-by: Andreas Enge --- gnu/packages/java.scm | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 207f1365136..3c4013ab6fa 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus ;;; Copyright © 2016 Leo Famulari ;;; Copyright © 2016, 2017 Roel Janssen -;;; Copyright © 2017, 2019 Carlo Zancanaro +;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro ;;; Copyright © 2017-2020 Julien Lepiller ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2016, 2017, 2018 Alex Vong @@ -1792,8 +1792,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (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 @@ -1931,12 +1936,18 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (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 @@ -2139,8 +2150,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (let* ((library-path (search-path-as-string->list - (getenv "LIBRARY_PATH"))) + (use-modules (srfi srfi-1)) + (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 -- cgit v1.3 From d830106c0e06ea6f5a148316f2729ac2b54f0b91 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 21 Apr 2021 00:29:42 +0200 Subject: gnu: ant: Update to 1.10.10. * gnu/packages/java.scm (ant): Update to 1.10.10. --- gnu/packages/java.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 3c4013ab6fa..9f67cc4e210 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2017-2020 Julien Lepiller ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2016, 2017, 2018 Alex Vong -;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Gábor Boskovits ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018, 2019, 2020 Efraim Flashner @@ -2494,14 +2494,14 @@ new Date();")) (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 -- cgit v1.3 From 698c4365baaad7eac7e5f38bd6527cf517200052 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 20 Apr 2021 21:22:20 +1000 Subject: gnu: openjdk: Fix library substitution when libraries aren't found. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11)[arguments]: Change 'find-library' to always return a string. Change 'find-library' callers to use 'string-append' rather than 'format'. Starting from 97a43db8b4416a1450aa61737edba9cf4126cf1c, 'find-library' could return #f and JNI substitutions would emit a literal "#f". Co-authored-by: Ludovic Courtès --- gnu/packages/java.scm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 9f67cc4e210..3c5a438492c 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1800,9 +1800,10 @@ new Date();")) (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 @@ -1810,9 +1811,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) @@ -1955,9 +1956,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) @@ -2158,9 +2159,10 @@ new Date();")) (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 @@ -2168,9 +2170,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) -- cgit v1.3 From e511a1d32745e3edf429a01b8864dc2f18adf83f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 21 Apr 2021 12:52:21 +0200 Subject: gnu: openjdk: Avoid non-top-level 'use-modules'. * gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11)[arguments]: Replace non-top-level 'use-modules' by '@'. --- gnu/packages/java.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 3c5a438492c..f5e59b97758 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1792,10 +1792,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (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")))) @@ -1937,10 +1940,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (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")))) @@ -2151,10 +2157,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (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")))) -- cgit v1.3 From f8acd1aeefe2ff5183f58c7e10a1cec4793cffb7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 21 Apr 2021 12:53:54 +0200 Subject: gnu: openjdk: Disallow references to the JDK used for build. This ensures JDKs don't unintentionally keep references to the one used to build them, as reported at and fixed by 97a43db8b4416a1450aa61737edba9cf4126cf1c. * gnu/packages/java.scm (icedtea-8)[arguments]: Add #:disallowed-references. (openjdk9)[arguments]: Likewise. (openjdk10)[arguments]: Likewise. (openjdk11)[arguments]: Likewise. --- gnu/packages/java.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index f5e59b97758..d1cb3fbe110 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1749,6 +1749,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) @@ -1902,6 +1905,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 @@ -2097,7 +2103,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") @@ -2127,6 +2135,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 -- cgit v1.3 From 27ee59d6a00243e7461f85823be118aed5d8bbd6 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 4 May 2021 20:57:36 +0200 Subject: gnu: java-javaparser: Upgrade os.name to ‘Guix’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/java.scm (java-javaparser)[arguments]: Drop ‘SD’. --- gnu/packages/java.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index d1cb3fbe110..cdfaae136d5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -13748,7 +13748,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 -- cgit v1.3 From 45915d331a30d1d2a256b917fd3eb9a9eec17f10 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:23:42 -0400 Subject: gnu: Add java-gson-2.8.6. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This introduces a new package rather than upgrading the exist java-gson package because it is built using OpenJDK11; I didn't want to have to propagate that JDK dependency to the other packages that use it. OpenJDK 11 was chosen becuase this dependency was introduced for tla2tools. * gnu/packages/java.scm (java-gson-2.8.6): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/java.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index cdfaae136d5..c3048a8db07 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2020 Raghav Gururajan ;;; Copyright © 2020 Maxim Cournoyer ;;; Copyright © 2021 Vincent Legoll +;;; Copyright © 2021 Mike Gerwitz ;;; ;;; This file is part of GNU Guix. ;;; @@ -11762,6 +11763,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") -- cgit v1.3 From 58b0258a20989dce0645bcaeaadcf00a92c60bc1 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:23:53 -0400 Subject: gnu: Add java-eclipse-xtext-xbase-lib. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This package is a component of xtext-lib. The rest of xtext-lib was not added. * gnu/packages/java.scm (java-eclipse-xtext-xbase-lib): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/java.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index c3048a8db07..4520ff9d835 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -7585,6 +7585,36 @@ 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-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") -- cgit v1.3 From e28ea146933f9805f422efd25def19cfee86f1dd Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:24:04 -0400 Subject: gnu: Add java-eclipse-lsp4j packages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All of these packages are components of java-eclipse-lsp4j, packaged independently. This contains only what was needed for tla2tools, and so there are parts of java-eclipse-lsp4j that are not packaged. Note that this does not package the latest version (0.12.0 at the time of writing)---it depends on the Xtend language, which is a huge packaging effort. 0.10.0 is the version expected by tla2tools, for which this dependency was introduced. * gnu/packages/java.scm (java-eclipse-lsp4j-common): New variable. (java-eclipse-lsp4j-jsonrpc): New variable. (java-eclipse-lsp4j-jsonrpc-debug): New variable. (java-eclipse-lsp4j-generator): New variable. (java-eclipse-lsp4j-debug): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/java.scm | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 4520ff9d835..b2a5cf0cc64 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -7585,6 +7585,109 @@ 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") -- cgit v1.3 From 1700dfefbe17efd759569e3907f7739ee71b0e8d Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:24:15 -0400 Subject: gnu: Add java-jline-terminal. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is part of JLine 3. I was able to get this working properly under Guix by providing ncurses' infocmp, as well as ensuring the *.caps files were present in the JAR, but similar methods didn't work for the tests; if you have Java knowledge, I'd appreciate the help getting those tests enabled. * gnu/packages/java.scm (java-jline-terminal): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/java.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index b2a5cf0cc64..68ab8683ab5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -71,6 +71,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) @@ -12503,6 +12504,63 @@ 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-xmlunit (package (name "java-xmlunit") -- cgit v1.3 From 674b4bd1a611f55be401c53e065359ae6e9dec54 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:24:26 -0400 Subject: gnu: Add java-jline-reader. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This package is part of JLine 3. * gnu/packages/java.scm (java-jline-reader): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/java.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 68ab8683ab5..d73f1acbf83 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -12561,6 +12561,47 @@ 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") -- cgit v1.3 From f30e8f29096e3ae2a4de689690daf5fa27a8c91b Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 15 Apr 2021 21:24:39 -0400 Subject: gnu: Add tla2tools. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This introduces tla2tools.jar, which contains the TLA+ model checker and simulator (TLC); a TLA+ REPL; a semantic analyzer (SANY); the TLATeX typesetting system; PlusCal translator; and more. I have added five wrapper scripts for convenience, rather than invoking `java' manually. The wrapper scripts are not comprehensive; users who are familiar with tla2tools.jar, or have read the book Specifying Systems, may still invoke the commands in the traditional way. The minimum JDK version is 11. I chose to stick with that rather than bumping it to 14 (which is the largest version currently in Guix) because each OpenJDK version in Guix depends on the version before it, and so it needlessly results in many 100s of MiB of unnecessary dependencies. Note that this is _not_ the TLA+ Toolbox, which is the GUI commonly used with TLA+. * gnu/packages/java.scm (tla2tools): New variable. * gnu/packages/patches/tla2tools-build-xml.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 3 +- gnu/packages/java.scm | 132 +++++++++++++++++++++++++ gnu/packages/patches/tla2tools-build-xml.patch | 109 ++++++++++++++++++++ 3 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/tla2tools-build-xml.patch (limited to 'gnu/packages/java.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 72bc31588dc..37166bb2fc9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Andreas Enge # Copyright © 2016 Mathieu Lirzin # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver @@ -1734,6 +1734,7 @@ dist_patch_DATA = \ %D%/packages/patches/tipp10-remove-license-code.patch \ %D%/packages/patches/tipp10-qt5.patch \ %D%/packages/patches/tk-find-library.patch \ + %D%/packages/patches/tla2tools-build-xml.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index d73f1acbf83..a167aafc38f 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -14066,3 +14066,135 @@ 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 + (let* ((version "1.8.0") + (tag (string-append "v" version))) + (package + (name "tla2tools") + (version version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tlaplus/tlaplus") + (commit tag))) + (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\\}") ,tag)))) + (add-before 'check 'prepare-tests + (lambda _ + ;; 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)))) diff --git a/gnu/packages/patches/tla2tools-build-xml.patch b/gnu/packages/patches/tla2tools-build-xml.patch new file mode 100644 index 00000000000..0bba82072a3 --- /dev/null +++ b/gnu/packages/patches/tla2tools-build-xml.patch @@ -0,0 +1,109 @@ +tla2tools comes packaged with three separate javax.mail JARs, which it +expects to be available to include in the JAR produced by the `dist' target. +However, the `java-javax-mail' packaged with Guix contains all of these +dependencies in a single JAR, so the other two are unneeded. This patch +removes references to them. + +The JAR also was expected to contain classes that are built as part of the +test suite. That does not seem useful, nor is it available during the +`compile' phase, so that portion is removed. + +There are a number of Git attributes that are set in the final manifest. +The branch name is kept, but the others are removed. The build user is set +statically to "guix". + +Finally, since we already have a patch, two targets `jar' and `check' are +added to satisfy `ant-build-system' and keep the package definition more +lean. + +diff --git a/tlatools/org.lamport.tlatools/customBuild.xml b/tlatools/org.lamport.tlatools/customBuild.xml +index f0ba77cb7..748e60d95 100644 +--- a/tlatools/org.lamport.tlatools/customBuild.xml ++++ b/tlatools/org.lamport.tlatools/customBuild.xml +@@ -36,6 +36,17 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -217,17 +228,7 @@ + + + +- +- +- +- +- +- +- +- +- +- +- ++ + + + +@@ -259,17 +260,7 @@ + + + +- +- +- +- +- +- +- +- +- +- +- ++ + + + +@@ -373,14 +364,8 @@ + src/tla2sany/parser/Token.09-09-07, + src/tla2sany/parser/TokenMgrError.09-09-07"/> + +- +- +- +- +- +- + +- ++ + + + +@@ -389,14 +374,8 @@ + + + +- + +- + +- +- +- +- + + + -- cgit v1.3