unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#66879] [PATCH 2/5] guix: ant: Optional build with java modules.
       [not found] <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu>
@ 2023-11-01 12:57 ` Julien Lepiller
  2023-11-01 12:57 ` [bug#66879] [PATCH 3/5] gnu: Add java-jakarta-json Julien Lepiller
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: Julien Lepiller @ 2023-11-01 12:57 UTC (permalink / raw)
  To: 66879; +Cc: Björn Höfling, Julien Lepiller

Modules were introduced in Java 9 and are not supported by the default
icedtea compiler, so this feature is disabled by default.

* guix/build-system/ant.scm (ant-build): Add use-java-modules?
parameter.
* guix/build/ant-build-system.scm (default-build.xml)
(configure): Use it.

Change-Id: I3b99238e4cd262332fa5c818be1af5477c7374fd
---
 guix/build-system/ant.scm       |  2 ++
 guix/build/ant-build-system.scm | 31 +++++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm
index e191fd3c99..84bf951fab 100644
--- a/guix/build-system/ant.scm
+++ b/guix/build-system/ant.scm
@@ -103,6 +103,7 @@ (define* (ant-build name inputs
                     (build-target "jar")
                     (jar-name #f)
                     (main-class #f)
+                    (use-java-modules? #f)
                     (test-include (list "**/*Test.java"))
                     (test-exclude (list "**/Abstract*.java"))
                     (source-dir "src")
@@ -131,6 +132,7 @@ (define* (ant-build name inputs
                      #:build-target #$build-target
                      #:jar-name #$jar-name
                      #:main-class #$main-class
+                     #:use-java-modules? #$use-java-modules?
                      #:test-include (list #$@test-include)
                      #:test-exclude (list #$@test-exclude)
                      #:source-dir #$source-dir
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d29912bf59..ced34177f4 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -37,6 +37,7 @@ (define-module (guix build ant-build-system)
 
 (define* (default-build.xml jar-name prefix #:optional
                             (source-dir ".") (test-dir "./test") (main-class #f)
+                            (use-java-modules? #f)
                             (test-include '("**/*Test.java"))
                             (test-exclude '("**/Abstract*Test.java")))
   "Create a simple build.xml with standard targets for Ant."
@@ -65,7 +66,7 @@ (define* (default-build.xml jar-name prefix #:optional
                               (value "first")))
                  (property (@ (environment "env")))
                  (path (@ (id "classpath"))
-                       (pathelement (@ (location "${env.CLASSPATH}"))))
+                       (pathelement (@ (path "${env.CLASSPATH}"))))
 
                  (target (@ (name "manifest"))
                          (mkdir (@ (dir "${manifest.dir}")))
@@ -79,18 +80,30 @@ (define* (default-build.xml jar-name prefix #:optional
                          (mkdir (@ (dir "${classes.dir}")))
                          (javac (@ (includeantruntime "false")
                                    (srcdir ,source-dir)
-                                   (destdir "${classes.dir}")
-                                   (classpath (@ (refid "classpath"))))))
+                                   (destdir "${classes.dir}"))
+                          ,(if use-java-modules?
+                             `((modulepath (@ (refid "classpath"))))
+                             '())
+                          (classpath (@ (refid "classpath")))))
 
                  (target (@ (name "compile-tests"))
                          (mkdir (@ (dir "${test.classes.dir}")))
                          (javac (@ (includeantruntime "false")
                                    (srcdir ,test-dir)
                                    (destdir "${test.classes.dir}"))
-                                (classpath
-                                 (pathelement (@ (path "${env.CLASSPATH}")))
-                                 (pathelement (@ (location "${classes.dir}")))
-                                 (pathelement (@ (location "${test.classes.dir}"))))))
+                           ,(if use-java-modules?
+                                `((classpath
+                                    (pathelement
+                                      (@ (path "${env.CLASSPATH}")))
+                                    (pathelement
+                                      (@ (location "${classes.dir}")))
+                                    (pathelement
+                                      (@ (location "${test.classes.dir}")))))
+                                '())
+                           (classpath
+                            (pathelement (@ (path "${env.CLASSPATH}")))
+                            (pathelement (@ (location "${classes.dir}")))
+                            (pathelement (@ (location "${test.classes.dir}"))))))
 
                  (target (@ (name "check")
                             (depends "compile-tests"))
@@ -156,13 +169,15 @@ (define* (configure #:key inputs outputs (jar-name #f)
                     (source-dir "src")
                     (test-dir "src/test")
                     (main-class #f)
+                    (use-java-modules? #f)
                     (test-include '("**/*Test.java"))
                     (test-exclude '("**/Abstract*.java")) #:allow-other-keys)
   (when jar-name
     (default-build.xml jar-name
                        (string-append (assoc-ref outputs "out")
                                       "/share/java")
-                       source-dir test-dir main-class test-include test-exclude))
+                       source-dir test-dir main-class use-java-modules?
+                       test-include test-exclude))
   (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
   (setenv "CLASSPATH" (generate-classpath inputs))
   #t)
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#66879] [PATCH 3/5] gnu: Add java-jakarta-json.
       [not found] <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu>
  2023-11-01 12:57 ` [bug#66879] [PATCH 2/5] guix: ant: Optional build with java modules Julien Lepiller
@ 2023-11-01 12:57 ` Julien Lepiller
  2023-11-01 12:57 ` [bug#66879] [PATCH 4/5] gnu: Add java-parsson Julien Lepiller
  2023-11-01 12:57 ` [bug#66879] [PATCH 5/5] gnu: josm: Update to 18822 Julien Lepiller
  3 siblings, 0 replies; 4+ messages in thread
From: Julien Lepiller @ 2023-11-01 12:57 UTC (permalink / raw)
  To: 66879; +Cc: Björn Höfling, Julien Lepiller

* gnu/packages/java.scm (java-jakarta-json): New variable.

Change-Id: I2c123710f9d31bf71e8fb86ff0d336b6fcfa9674
---
 gnu/packages/java.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 567fb05f77..d80e0e9be8 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -13653,6 +13653,33 @@ (define-public java-jsonp-impl
 parse, generate, transform and query) JSON messages.  This package contains
 a reference implementation of that API.")))
 
+(define-public java-jakarta-json
+  (package
+    (name "java-jakarta-json")
+    (version "2.1.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/jakartaee/jsonp-api")
+                     (commit (string-append version "-RELEASE"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:jar-name "jakarta-json.jar"
+       #:source-dir "api/src/main/java"
+       #:tests? #f; no tests
+       #:jdk ,openjdk11))
+    (home-page "https://github.com/jakartaee/jsonp-api")
+    (synopsis "Portable API for JSON handling in Java")
+    (description "This project contains API and Compatible Implementation of
+Jakarta JSON Processing specification.  Jakarta JSON Processing provides
+portable APIs to parse, generate, transform, and query JSON documents.")
+    ;; with classpath exception
+    (license license:epl2.0)))
+
 (define-public java-xmp
   (package
     (name "java-xmp")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#66879] [PATCH 4/5] gnu: Add java-parsson.
       [not found] <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu>
  2023-11-01 12:57 ` [bug#66879] [PATCH 2/5] guix: ant: Optional build with java modules Julien Lepiller
  2023-11-01 12:57 ` [bug#66879] [PATCH 3/5] gnu: Add java-jakarta-json Julien Lepiller
@ 2023-11-01 12:57 ` Julien Lepiller
  2023-11-01 12:57 ` [bug#66879] [PATCH 5/5] gnu: josm: Update to 18822 Julien Lepiller
  3 siblings, 0 replies; 4+ messages in thread
From: Julien Lepiller @ 2023-11-01 12:57 UTC (permalink / raw)
  To: 66879; +Cc: Björn Höfling, Julien Lepiller

* gnu/packages/java.scm (java-parsson): New variable.

Change-Id: Ie564924329e4e0a866e6ed5fe9135c841fb66ae8
---
 gnu/packages/java.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d80e0e9be8..13b5961c3c 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -13680,6 +13680,43 @@ (define-public java-jakarta-json
     ;; with classpath exception
     (license license:epl2.0)))
 
+(define-public java-parsson
+  (package
+    (name "java-parsson")
+    (version "1.1.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/eclipse-ee4j/parsson")
+                     (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:jar-name "parsson.jar"
+       #:source-dir "impl/src/main/java"
+       #:test-dir "impl/src/test"
+       #:use-java-modules? #t
+       #:jdk ,openjdk11
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-resources
+           (lambda _
+             (copy-recursively "impl/src/main/resources"
+                               "build/classes"))))))
+    (inputs
+      (list java-jakarta-json))
+    (native-inputs
+      (list java-junit))
+    (home-page "https://github.com/eclipse-ee4j/parsson")
+    (synopsis "Implementation of Jakarta JSON API")
+    (description "Eclipse Parsson is an implementation of the Jakarta JSON
+Processing specification.")
+    ;; with classpath exception
+    (license license:epl2.0)))
+
 (define-public java-xmp
   (package
     (name "java-xmp")
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#66879] [PATCH 5/5] gnu: josm: Update to 18822.
       [not found] <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu>
                   ` (2 preceding siblings ...)
  2023-11-01 12:57 ` [bug#66879] [PATCH 4/5] gnu: Add java-parsson Julien Lepiller
@ 2023-11-01 12:57 ` Julien Lepiller
  3 siblings, 0 replies; 4+ messages in thread
From: Julien Lepiller @ 2023-11-01 12:57 UTC (permalink / raw)
  To: 66879; +Cc: Andreas Enge, Efraim Flashner, Eric Bavier

* gnu/packages/geo.scm (josm): Update to 18822.
[inputs]: Use new json implementation.
[arguments]: Use openjdk11 to prevent warning at startup.

Change-Id: I393e0ed765d1d0da7870595d2eccefae17836eb9
---
 gnu/packages/geo.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index a33d446201..dbc8440141 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1940,7 +1940,7 @@ (define-public java-opening-hours-parser
 (define-public josm
   (package
     (name "josm")
-    (version "18646")
+    (version "18822")
     (source (origin
               (method svn-fetch)
               (uri (svn-reference
@@ -1949,7 +1949,7 @@ (define-public josm
                      (recursive? #f)))
               (sha256
                (base32
-                "0zr3p1i39wi0f29lgb3xrnv6lijrq5ia8jxn4wnq1yz0xdlbg98i"))
+                "0b4q6n3jbqrh7dsfmcf2g0xdd1wjj62sjq8lwvggvrpqlk1fyn1b"))
               (file-name (string-append name "-" version "-checkout"))
               (modules '((guix build utils)))
             (snippet
@@ -1963,17 +1963,18 @@ (define-public josm
      (list java-commons-jcs
            java-commons-compress
            java-jmapviewer
-           java-jsonp-api
-           java-jsonp-impl ; runtime dependency
+           java-jakarta-json
            java-jsr305
            java-metadata-extractor
            java-opening-hours-parser
            java-openjfx-media
+           java-parsson ; runtime dependency
            java-signpost-core
            java-svg-salamander))
     (arguments
      `(#:tests? #f
        #:jar-name "josm.jar"
+       #:jdk ,openjdk11
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'rm-build.xml
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-01 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1ba00a1093d068dafaef44959ee55a0999695d90.1698843445.git.julien@lepiller.eu>
2023-11-01 12:57 ` [bug#66879] [PATCH 2/5] guix: ant: Optional build with java modules Julien Lepiller
2023-11-01 12:57 ` [bug#66879] [PATCH 3/5] gnu: Add java-jakarta-json Julien Lepiller
2023-11-01 12:57 ` [bug#66879] [PATCH 4/5] gnu: Add java-parsson Julien Lepiller
2023-11-01 12:57 ` [bug#66879] [PATCH 5/5] gnu: josm: Update to 18822 Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).