summary refs log tree commit diff
path: root/gnu/packages/java.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-03-07 19:50:44 +0100
committerRicardo Wurmus <rekado@elephly.net>2017-05-10 21:43:51 +0200
commit4f3e47ea82e72cedeb1fef51534f380105fdaf1e (patch)
tree2b10d50fcfe14e4613f2d26922c18057a0b9d10c /gnu/packages/java.scm
parent0d4a0d60f17ff20522fcb05dc0dd002951e8b1b7 (diff)
downloadguix-4f3e47ea82e72cedeb1fef51534f380105fdaf1e.tar.gz
gnu: Add java-guava.
* gnu/packages/java.scm (java-guava): New variable.
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r--gnu/packages/java.scm52
1 files changed, 52 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 32a7804e72..62f6b55263 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1875,6 +1875,58 @@ in the @code{java.lang} package.  The following classes are included:
 It provides packages in the @code{javax.annotations} namespace.")
     (license license:asl2.0)))
 
+(define-public java-guava
+  (package
+    (name "java-guava")
+    ;; This is the last release of Guava that can be built with Java 7.
+    (version "20.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/google/guava/"
+                                  "releases/download/v" version
+                                  "/guava-" version "-sources.jar"))
+              (sha256
+               (base32
+                "1gawrs5gi6j5hcfxdgpnfli75vb9pfi4sn09pnc8xacr669yajwr"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:tests? #f                      ; no tests included
+       #:jar-name "guava.jar"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trim-sources
+           (lambda _
+             (with-directory-excursion "src/com/google/common"
+               ;; Remove annotations to avoid extra dependencies:
+               ;; * "j2objc" annotations are used when converting Java to
+               ;;   Objective C;
+               ;; * "errorprone" annotations catch common Java mistakes at
+               ;;   compile time;
+               ;; * "IgnoreJRERequirement" is used for Android.
+               (substitute* (find-files "." "\\.java$")
+                 (("import com.google.j2objc.*") "")
+                 (("import com.google.errorprone.annotation.*") "")
+                 (("import org.codehaus.mojo.animal_sniffer.*") "")
+                 (("@CanIgnoreReturnValue") "")
+                 (("@LazyInit") "")
+                 (("@WeakOuter") "")
+                 (("@RetainedWith") "")
+                 (("@Weak") "")
+                 (("@ForOverride") "")
+                 (("@J2ObjCIncompatible") "")
+                 (("@IgnoreJRERequirement") "")))
+             #t)))))
+    (inputs
+     `(("java-jsr305" ,java-jsr305)))
+    (home-page "https://github.com/google/guava")
+    (synopsis "Google core libraries for Java")
+    (description "Guava is a set of core libraries that includes new
+collection types (such as multimap and multiset), immutable collections, a
+graph library, functional types, an in-memory cache, and APIs/utilities for
+concurrency, I/O, hashing, primitives, reflection, string processing, and much
+more!")
+    (license license:asl2.0)))
+
 (define-public java-commons-cli
   (package
     (name "java-commons-cli")