unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: Mike Gerwitz <mtg@gnu.org>,47789@debbugs.gnu.org
Subject: [bug#47789] [PATCH 1/6] gnu: Add java-gson-2.8.6.
Date: Thu, 15 Apr 2021 06:46:21 -0400	[thread overview]
Message-ID: <3EDAFE63-04AF-4D94-911E-B38BDFE0204A@lepiller.eu> (raw)
In-Reply-To: <0bb3e905602bcba367d14ad4ff20ef3caa54f72b.1618460450.git.mtg@gnu.org>

Le 15 avril 2021 00:25:10 GMT-04:00, Mike Gerwitz <mtg@gnu.org> a écrit :
>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.
>---
> gnu/packages/java.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
>diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
>index 207f136513..fe75404e9c 100644
>--- a/gnu/packages/java.scm
>+++ b/gnu/packages/java.scm
>@@ -15,6 +15,7 @@
> ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
> ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
> ;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
>+;;; Copyright © 2021 Mike Gerwitz <mtg@gnu.org>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
>@@ -11724,6 +11725,48 @@ 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
>+    (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"))))
>+    (build-system ant-build-system)
>+    (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)))
>+           #t)))))
>+    (native-inputs
>+     `(("java-junit" ,java-junit)
>+       ("java-hamcrest-core" ,java-hamcrest-core)))
>+    (home-page "https://github.com/google/gson")
>+    (synopsis "Java serialization/deserialization library from/to
>JSON")
>+    (description "Gson is a Java library that can be used to convert
>Java
>+Objects into their JSON representation.  It can also be used to
>convert a JSON
>+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)))
>+
> (define-public java-hawtjni
>   (package
>     (name "java-hawtjni")

Hi!

I think it would be easier to inherit from the existing package, right? Why do you need this package at all? I know that mixing JDKs can result in errors if you use a dependency that was built with a more recent JDK that what you use for a package, but the other way around should be fine, no?

What error do you get if you use the existing package?




  parent reply	other threads:[~2021-04-15 10:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  4:22 [bug#47789] [PATCH 0/6] Add TLA+ Tools (tla2tools) Mike Gerwitz
2021-04-15  4:25 ` [bug#47789] [PATCH 1/6] gnu: Add java-gson-2.8.6 Mike Gerwitz
2021-04-15  8:06   ` Maxime Devos
2021-04-16  1:13     ` Mike Gerwitz
2021-04-15 10:46   ` Julien Lepiller [this message]
2021-04-16  0:27     ` Mike Gerwitz
2021-04-15  4:26 ` [bug#47789] [PATCH 2/6] gnu: Add java-eclipse-xtext-xbase-lib Mike Gerwitz
2021-04-15  4:26 ` [bug#47789] [PATCH 3/6] gnu: Add java-eclipse-lsp4j packages Mike Gerwitz
2021-04-15  4:26 ` [bug#47789] [PATCH 4/6] gnu: Add java-jline-terminal Mike Gerwitz
2021-04-15  8:13   ` Maxime Devos
2021-04-16  0:55     ` Mike Gerwitz
2021-04-15  4:27 ` [bug#47789] [PATCH 5/6] gnu: Add java-jline-reader Mike Gerwitz
2021-04-15  4:27 ` [bug#47789] [PATCH 6/6] gnu: Add tla2tools Mike Gerwitz
2021-04-15  8:17   ` Maxime Devos
2021-04-16  0:57     ` Mike Gerwitz
2021-04-16  1:12     ` Mike Gerwitz
2021-04-16  1:23 ` [bug#47789] [PATCH 1/6] gnu: Add java-gson-2.8.6 Mike Gerwitz
2021-04-16  1:23 ` [bug#47789] [PATCH 2/6] gnu: Add java-eclipse-xtext-xbase-lib Mike Gerwitz
2021-04-16  1:24 ` [bug#47789] [PATCH 3/6] gnu: Add java-eclipse-lsp4j packages Mike Gerwitz
2021-04-16  1:24 ` [bug#47789] [PATCH 4/6] gnu: Add java-jline-terminal Mike Gerwitz
2021-04-16  1:24 ` [bug#47789] [PATCH 5/6] gnu: Add java-jline-reader Mike Gerwitz
2021-04-16  1:24 ` [bug#47789] [PATCH 6/6] gnu: Add tla2tools Mike Gerwitz
2021-05-05 15:02   ` bug#47789: [PATCH 0/6] Add TLA+ Tools (tla2tools) Ludovic Courtès
2021-04-16  1:29 ` [bug#47789] " Mike Gerwitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EDAFE63-04AF-4D94-911E-B38BDFE0204A@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=47789@debbugs.gnu.org \
    --cc=mtg@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).