me
/
guix
Archived
1
0
Fork 0

gnu: java-guava: Update to 31.1.

* gnu/packages/patches/java-guava-remove-annotation-deps.patch: New
  file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/java.scm (java-guava): Update to 31.1.
[source]: Use patch.
(java-guava-futures-failureaccess): New variable.
* gnu/packages/bioinformatics.scm (java-picard, java-picard-2.10.3): Fix for
  newer guava.
* gnu/packages/maven.scm (maven): Add java-guava-futures-failureaccess.

Change-Id: Id2553c48e11c6001fb45a0589720cef1551804d9
master
Julien Lepiller 2023-02-25 21:30:29 +01:00
parent f1ed3d4699
commit 7ce7464934
No known key found for this signature in database
GPG Key ID: 53D457B2D636EE82
5 changed files with 78 additions and 15 deletions

View File

@ -1511,6 +1511,7 @@ dist_patch_DATA = \
%D%/packages/patches/java-apache-ivy-port-to-latest-bouncycastle.patch \ %D%/packages/patches/java-apache-ivy-port-to-latest-bouncycastle.patch \
%D%/packages/patches/java-commons-collections-fix-java8.patch \ %D%/packages/patches/java-commons-collections-fix-java8.patch \
%D%/packages/patches/java-commons-lang-fix-dependency.patch \ %D%/packages/patches/java-commons-lang-fix-dependency.patch \
%D%/packages/patches/java-guava-remove-annotation-deps.patch \
%D%/packages/patches/java-jeromq-fix-tests.patch \ %D%/packages/patches/java-jeromq-fix-tests.patch \
%D%/packages/patches/java-openjfx-build-jdk_version.patch \ %D%/packages/patches/java-openjfx-build-jdk_version.patch \
%D%/packages/patches/java-powermock-fix-java-files.patch \ %D%/packages/patches/java-powermock-fix-java-files.patch \

View File

@ -7303,6 +7303,10 @@ geographic distributions.")
(modify-phases %standard-phases (modify-phases %standard-phases
;; FIXME: this phase fails with "duplicate entry: htsjdk/samtools/AbstractBAMFileIndex$1.class" ;; FIXME: this phase fails with "duplicate entry: htsjdk/samtools/AbstractBAMFileIndex$1.class"
(delete 'generate-jar-indices) (delete 'generate-jar-indices)
(add-after 'unpack 'fix-guava
(lambda _
(substitute* "src/java/picard/cmdline/CommandLineParser.java"
(("CharMatcher.ASCII") "CharMatcher.ascii()"))))
(add-after 'unpack 'use-our-htsjdk (add-after 'unpack 'use-our-htsjdk
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "build.xml" (substitute* "build.xml"
@ -7362,6 +7366,10 @@ VCF.")
(delete 'generate-jar-indices) (delete 'generate-jar-indices)
(add-after 'unpack 'remove-useless-build.xml (add-after 'unpack 'remove-useless-build.xml
(lambda _ (delete-file "build.xml") #t)) (lambda _ (delete-file "build.xml") #t))
(add-after 'unpack 'fix-guava
(lambda _
(substitute* "src/main/java/picard/cmdline/CommandLineParser.java"
(("CharMatcher.ASCII") "CharMatcher.ascii()"))))
;; This is necessary to ensure that htsjdk is found when using ;; This is necessary to ensure that htsjdk is found when using
;; picard.jar as an executable. ;; picard.jar as an executable.
(add-before 'build 'edit-classpath-in-manifest (add-before 'build 'edit-classpath-in-manifest

View File

@ -6249,8 +6249,7 @@ used by programmers to guide the static analysis.")
(define-public java-guava (define-public java-guava
(package (package
(name "java-guava") (name "java-guava")
;; This is the last release of Guava that can be built with Java 7. (version "31.1")
(version "20.0")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
@ -6259,7 +6258,9 @@ used by programmers to guide the static analysis.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"00h5cawdjic1vind3yivzh1f58flvm1yfmhsyqwyvmbvj1vakysp")))) "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
(patches
(search-patches "java-guava-remove-annotation-deps.patch"))))
(build-system ant-build-system) (build-system ant-build-system)
(arguments (arguments
`(#:tests? #f ; no tests included `(#:tests? #f ; no tests included
@ -6273,27 +6274,26 @@ used by programmers to guide the static analysis.")
;; Remove annotations to avoid extra dependencies: ;; Remove annotations to avoid extra dependencies:
;; * "j2objc" annotations are used when converting Java to ;; * "j2objc" annotations are used when converting Java to
;; Objective C; ;; Objective C;
;; * "errorprone" annotations catch common Java mistakes at
;; compile time;
;; * "IgnoreJRERequirement" is used for Android. ;; * "IgnoreJRERequirement" is used for Android.
;; * "Nullable" is used to catch NPE at build time.
(substitute* (find-files "." "\\.java$") (substitute* (find-files "." "\\.java$")
(("import com.google.j2objc.*") "") (("import com.google.j2objc.*") "")
(("import com.google.errorprone.annotation.*") "") (("import org.checkerframework.checker.*") "")
(("import org.codehaus.mojo.animal_sniffer.*") "") (("@ReflectionSupport.*") "")
(("@CanIgnoreReturnValue") "")
(("@LazyInit") "")
(("@WeakOuter") "") (("@WeakOuter") "")
(("@RetainedWith") "") (("@RetainedWith") "")
(("@Weak") "") (("@Weak") "")
(("@ForOverride") "")
(("@J2ObjCIncompatible") "") (("@J2ObjCIncompatible") "")
(("@IgnoreJRERequirement") ""))) (("@IgnoreJRERequirement") "")
#t)) (("@Nullable") "")))))
;; This is required by guava, but this is just an empty stub
(add-before 'install 'install-listenablefuture-stub
(install-pom-file "futures/listenablefuture9999/pom.xml"))
(replace 'install (install-from-pom "guava/pom.xml"))))) (replace 'install (install-from-pom "guava/pom.xml")))))
(inputs (inputs
(list java-jsr305)) (list java-error-prone-annotations java-jsr305))
(propagated-inputs (propagated-inputs
(list java-guava-parent-pom)) (list java-guava-futures-failureaccess java-guava-parent-pom))
(home-page "https://github.com/google/guava") (home-page "https://github.com/google/guava")
(synopsis "Google core libraries for Java") (synopsis "Google core libraries for Java")
(description "Guava is a set of core libraries that includes new (description "Guava is a set of core libraries that includes new
@ -6303,6 +6303,21 @@ concurrency, I/O, hashing, primitives, reflection, string processing, and much
more!") more!")
(license license:asl2.0))) (license license:asl2.0)))
(define-public java-guava-futures-failureaccess
(package
(inherit java-guava)
(name "java-guava-futures-failureaccess")
(arguments
`(#:tests? #f; no tests
#:jar-name "guava-futures-failureaccess.jar"
#:source-dir "futures/failureaccess/src"
#:phases
(modify-phases %standard-phases
(replace 'install
(install-from-pom "futures/failureaccess/pom.xml")))))
(propagated-inputs
`(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
(define java-guava-parent-pom (define java-guava-parent-pom
(package (package
(inherit java-guava) (inherit java-guava)

View File

@ -2170,7 +2170,8 @@ layer for plugins that need to keep Maven2 compatibility.")))
"java-javax-inject" "java-plexus-component-annotations" "java-javax-inject" "java-plexus-component-annotations"
"java-plexus-utils" "java-plexus-interpolation" "java-plexus-utils" "java-plexus-interpolation"
"java-plexus-sec-dispatcher" "java-plexus-cipher" "java-guava" "java-plexus-sec-dispatcher" "java-plexus-cipher" "java-guava"
"java-jansi" "java-jsr250" "java-cdi-api" "java-commons-cli" "java-guava-futures-failureaccess" "java-jansi"
"java-jsr250" "java-cdi-api" "java-commons-cli"
"java-commons-io" "java-commons-lang3" "java-slf4j-api")))) "java-commons-io" "java-commons-lang3" "java-slf4j-api"))))
(substitute* "apache-maven/src/bin/mvn" (substitute* "apache-maven/src/bin/mvn"
(("cygwin=false;") (("cygwin=false;")
@ -2239,6 +2240,7 @@ layer for plugins that need to keep Maven2 compatibility.")))
java-plexus-sec-dispatcher java-plexus-sec-dispatcher
java-plexus-cipher java-plexus-cipher
java-guava java-guava
java-guava-futures-failureaccess
java-jansi java-jansi
java-jsr250 java-jsr250
java-cdi-api java-cdi-api

View File

@ -0,0 +1,37 @@
From 41d216ca7993991d32a077d0650ccfad8a846942 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 25 Feb 2023 10:02:11 +0100
Subject: [PATCH] Remove annotation dependencies
This is used to prevent a failure when guix creates the Maven directory
structure and fails to find these dependencies.
---
guava/pom.xml | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/guava/pom.xml b/guava/pom.xml
index 81a2005..5237047 100644
--- a/guava/pom.xml
+++ b/guava/pom.xml
@@ -31,18 +31,6 @@
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
- <dependency>
- <groupId>org.checkerframework</groupId>
- <artifactId>checker-qual</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.errorprone</groupId>
- <artifactId>error_prone_annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.j2objc</groupId>
- <artifactId>j2objc-annotations</artifactId>
- </dependency>
<!-- TODO(cpovirk): does this comment belong on the <dependency> in <profiles>? -->
<!-- TODO(cpovirk): want this only for dependency plugin but seems not to work there? Maven runs without failure, but the resulting Javadoc is missing the hoped-for inherited text -->
</dependencies>
--
2.38.1