Subject: [bug#47789] [PATCH 3/6] gnu: Add java-eclipse-lsp4j packages.

From: Mike Gerwitz <[email-masked]>
Date: Thu, 15 Apr 2021 00:26:41 -0400

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.
---
 gnu/packages/java.scm | 104 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index b0e67b2f6e..e82e828df0 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7547,6 +7547,110 @@ means for generating files and compiling new Java classes based on annotations
 found in your source code.")
     (license license:epl2.0)))
 
+(define 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 obscurely
+       #: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")
+             #t)))))
+    (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")
-- 
Mike Gerwitz
Activist For User Freedom | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
https://mikegerwitz.com