More sbt dependencies

Julien LepillerThu Jan 17 00:04:01+0100 2019

74bfa6c

More sbt dependencies

java-fmpp-remove-imageinfo.patch unknown status 1

1+
See https://github.com/freemarker/fmpp/pull/18
2+
3+
  In order to leverage the package dependency we removed
4+
  `org.devlib.schmidt.imageinfo.ImageInfo` class and replaced it with more
5+
  standard one javax.imageio.ImageIO in Fedora. We suggest you do the same here.
6+
7+
The old class comes from a package whose latest release is in 2008 and whose
8+
homepage doesn't exist anymore. There doesn't seem to be any corresponding
9+
sources anymore.
10+
11+
From 14dae73c5e5f162e6ddb59430cbfc7c555429140 Mon Sep 17 00:00:00 2001
12+
From: Tomas Repik <trepik@redhat.com>
13+
Date: Mon, 5 Dec 2016 13:17:54 +0100
14+
Subject: [PATCH] removed org.devlib.schmidt.imageinfo.ImageInfo dependency
15+
 from sources
16+
17+
---
18+
 .../java/fmpp/dataloaders/HtmlUtilsDataLoader.java | 399 ++++++++++-----------
19+
 1 file changed, 196 insertions(+), 203 deletions(-)
20+
21+
diff --git a/src/main/java/fmpp/dataloaders/HtmlUtilsDataLoader.java b/src/main/java/fmpp/dataloaders/HtmlUtilsDataLoader.java
22+
index 3dcb613..6c32065 100644
23+
--- a/src/main/java/fmpp/dataloaders/HtmlUtilsDataLoader.java
24+
+++ b/src/main/java/fmpp/dataloaders/HtmlUtilsDataLoader.java
25+
@@ -1,12 +1,12 @@
26+
 /*
27+
  * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky
28+
- * 
29+
+ *
30+
  * Licensed under the Apache License, Version 2.0 (the "License");
31+
  * you may not use this file except in compliance with the License.
32+
  * You may obtain a copy of the License at
33+
- * 
34+
+ *
35+
  * http://www.apache.org/licenses/LICENSE-2.0
36+
- * 
37+
+ *
38+
  * Unless required by applicable law or agreed to in writing, software
39+
  * distributed under the License is distributed on an "AS IS" BASIS,
40+
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41+
@@ -14,8 +14,8 @@
42+
  * limitations under the License.
43+
  */
44+
 
45+
-package fmpp.dataloaders;
46+
-
47+
+package fmpp.dataloaders;
48+
+
49+
 import java.io.File;
50+
 import java.io.FileNotFoundException;
51+
 import java.io.IOException;
52+
@@ -25,8 +25,7 @@ import java.util.HashMap;
53+
 import java.util.Iterator;
54+
 import java.util.List;
55+
 import java.util.Map;
56+
-
57+
-import org.devlib.schmidt.imageinfo.ImageInfo;
58+
+import javax.imageio.ImageIO;
59+
 
60+
 import fmpp.Engine;
61+
 import fmpp.tdd.DataLoader;
62+
@@ -36,199 +35,193 @@ import freemarker.template.TemplateModelException;
63+
 import freemarker.template.TemplateNumberModel;
64+
 import freemarker.template.TemplateScalarModel;
65+
 import freemarker.template.TemplateTransformModel;
66+
-
67+
-/**
68+
- * Returns a hash that contains useful directives for HTML generation.
69+
- * <ul>
70+
- *   <li>img: Same as HTML img, but automatically calculates the width and/or
71+
- *       height attributes if they are missing.
72+
- * </ul> 
73+
- */
74+
-public class HtmlUtilsDataLoader implements DataLoader {
75+
-    private boolean xHtml = false;
76+
-    private String eTagClose;
77+
-
78+
-    private Engine engine;
79+
-    
80+
-    private static final int MAX_CACHE_SIZE = 100;
81+
-    private Map imageInfoCache = new HashMap();
82+
-    private CachedImageInfo first;
83+
-    private CachedImageInfo last;
84+
-    private ImageInfo imageInfo = new ImageInfo();
85+
-    
86+
-    public Object load(Engine e, List args) throws Exception {
87+
-        if (args.size() != 0) {
88+
-            throw new IllegalArgumentException(
89+
-                "data loader does not have arguments");
90+
-        }
91+
-        engine = e;
92+
-        if (xHtml) {
93+
-            eTagClose = " />";
94+
-        } else {
95+
-            eTagClose = ">";
96+
-        }
97+
-        
98+
-        Map map = new HashMap();
99+
-        
100+
-        map.put("img", new ImgTransform());
101+
-        
102+
-        return map;
103+
-    }
104+
-    
105+
-    public void setXHtml(boolean xHtml) {
106+
-        this.xHtml = xHtml;
107+
-    }
108+
-    
109+
-    private CachedImageInfo getImageInfo(File f)
110+
-            throws IOException, TemplateModelException {
111+
-        String cacheKey = f.getCanonicalPath();
112+
-        
113+
-        CachedImageInfo inf = (CachedImageInfo) imageInfoCache.get(cacheKey);
114+
-        if (inf != null) {
115+
-            long lmd = new File(cacheKey).lastModified();
116+
-            if (inf.lmd == lmd && lmd != 0L && inf.lmd != 0L) {
117+
-                if (inf != last) {
118+
-                    if (inf.prev != null) {
119+
-                        inf.prev.next = inf.next;
120+
-                    } else {
121+
-                        first = inf.next;
122+
-                    }
123+
-                    if (inf.next != null) {
124+
-                        inf.next.prev = inf.prev;
125+
-                    } else {
126+
-                        last = inf.prev;
127+
-                    }
128+
-                    
129+
-                    inf.prev = last;
130+
-                    inf.next = null;
131+
-                    last = inf;
132+
-                    inf.prev.next = last;
133+
-                }
134+
-                return inf; //!
135+
-            } else {
136+
-                imageInfoCache.remove(cacheKey);
137+
-                if (inf.prev != null) {
138+
-                    inf.prev.next = inf.next;
139+
-                } else {
140+
-                    first = inf.next;
141+
-                }
142+
-                if (inf.next != null) {
143+
-                    inf.next.prev = inf.prev;
144+
-                } else {
145+
-                    last = inf.prev;
146+
-                }
147+
-            }
148+
-        }
149+
-        
150+
-        RandomAccessFile raf;
151+
-        try {
152+
-            raf = new RandomAccessFile(f, "r");
153+
-        } catch (FileNotFoundException e) {
154+
-            throw new TemplateModelException("Image file not found: " + f.getAbsolutePath(), e);
155+
-        }
156+
-        try {
157+
-            imageInfo.setCollectComments(false);
158+
-            imageInfo.setInput(raf);
159+
-            if (!imageInfo.check()) {
160+
-                throw new TemplateModelException("Failed to analyse image file: " + cacheKey);
161+
-            }
162+
-        } finally {
163+
-            raf.close();
164+
-        }
165+
-        inf = new CachedImageInfo();
166+
-        inf.lmd = f.lastModified();
167+
-        inf.width = imageInfo.getWidth();
168+
-        inf.height = imageInfo.getHeight();
169+
-        inf.path = cacheKey;
170+
-        if (last != null) {
171+
-            last.next = inf;
172+
-        }
173+
-        inf.prev = last;
174+
-        inf.next = null;
175+
-        last = inf;
176+
-        if (inf.prev == null) {
177+
-            first = inf;
178+
-        }
179+
-        imageInfoCache.put(cacheKey, inf);
180+
-        if (imageInfoCache.size() > MAX_CACHE_SIZE) {
181+
-            imageInfoCache.remove(first.path);
182+
-            first.next.prev = null;
183+
-            first = first.next;
184+
-        }
185+
-        
186+
-        return inf;
187+
-    }
188+
-
189+
-    private class CachedImageInfo {
190+
-        private CachedImageInfo prev;
191+
-        private CachedImageInfo next;
192+
-        private String path;
193+
-        private long lmd;
194+
-        private int width;
195+
-        private int height;
196+
-    }
197+
-
198+
-    private class ImgTransform implements TemplateTransformModel {
199+
-        public Writer getWriter(Writer out, Map args)
200+
-                throws TemplateModelException, IOException {
201+
-            boolean detectHeight = true;
202+
-            boolean detectWidth = true;
203+
-            String src = null;
204+
-            
205+
-            out.write("<img");
206+
-        
207+
-            Iterator it = args.entrySet().iterator();
208+
-            while (it.hasNext()) {
209+
-                Map.Entry e = (Map.Entry) it.next();
210+
-                String pname = (String) e.getKey();
211+
-                Object obj = e.getValue();
212+
-                String pvalue;
213+
-                if (obj instanceof TemplateScalarModel) {
214+
-                    pvalue = ((TemplateScalarModel) obj).getAsString(); 
215+
-                } else if (obj instanceof TemplateNumberModel) {
216+
-                    pvalue = ((TemplateNumberModel) obj).getAsNumber()
217+
-                            .toString();
218+
-                } else if (obj instanceof TemplateBooleanModel) {
219+
-                    pvalue = null;
220+
-                    if (((TemplateBooleanModel) obj).getAsBoolean()) {
221+
-                        out.write(" " + pname);
222+
-                    }
223+
-                } else {
224+
-                    throw new TemplateModelException(
225+
-                            "Argument to img must be string, "
                             + "number or boolean"); 
226+
-                }
227+
-                if (pvalue != null) {
228+
-                    pname = pname.toLowerCase();
229+
-                    out.write(" " + pname + "=\""
230+
-                            + StringUtil.htmlEnc(pvalue) + "\"");
231+
-                    if (pname.equals("src")) {
232+
-                        src = pvalue;
233+
-                    } else if (pname.equals("width")) {
234+
-                        detectWidth = false;
235+
-                    } else if (pname.equals("height")) {
236+
-                        detectHeight = false;
237+
-                    }
238+
-                }
239+
-            }
240+
-            if (detectWidth || detectHeight) {
241+
-                if (src == null) {
242+
-                    throw new TemplateModelException(
243+
-                            "The src attribute of img is missing");
244+
-                }
245+
-                CachedImageInfo inf;
246+
-                inf = getImageInfo(engine.getTemplateEnvironment()
247+
-                        .resolveSourcePath(src));
248+
-                if (detectWidth) {
249+
-                    out.write(" width=\"" + inf.width + "\"");
250+
-                }
251+
-                if (detectHeight) {
252+
-                    out.write(" height=\"" + inf.height + "\"");
253+
-                }
254+
-            }
255+
-
256+
-            out.write(eTagClose);
257+
-            
258+
-            return null;
259+
-        }
260+
-    }
261+
-}
262+
+
263+
+/**
264+
+ * Returns a hash that contains useful directives for HTML generation.
265+
+ * <ul>
266+
+ *   <li>img: Same as HTML img, but automatically calculates the width and/or
267+
+ *       height attributes if they are missing.
268+
+ * </ul>
269+
+ */
270+
+public class HtmlUtilsDataLoader implements DataLoader {
271+
+    private boolean xHtml = false;
272+
+    private String eTagClose;
273+
+
274+
+    private Engine engine;
275+
+
276+
+    private static final int MAX_CACHE_SIZE = 100;
277+
+    private Map imageInfoCache = new HashMap();
278+
+    private CachedImageInfo first;
279+
+    private CachedImageInfo last;
280+
+
281+
+    public Object load(Engine e, List args) throws Exception {
282+
+        if (args.size() != 0) {
283+
+            throw new IllegalArgumentException(
284+
+                "data loader does not have arguments");
285+
+        }
286+
+        engine = e;
287+
+        if (xHtml) {
288+
+            eTagClose = " />";
289+
+        } else {
290+
+            eTagClose = ">";
291+
+        }
292+
+
293+
+        Map map = new HashMap();
294+
+
295+
+        map.put("img", new ImgTransform());
296+
+
297+
+        return map;
298+
+    }
299+
+
300+
+    public void setXHtml(boolean xHtml) {
301+
+        this.xHtml = xHtml;
302+
+    }
303+
+
304+
+    private CachedImageInfo getImageInfo(File f)
305+
+            throws IOException, TemplateModelException {
306+
+        String cacheKey = f.getCanonicalPath();
307+
+
308+
+        CachedImageInfo inf = (CachedImageInfo) imageInfoCache.get(cacheKey);
309+
+        if (inf != null) {
310+
+            long lmd = new File(cacheKey).lastModified();
311+
+            if (inf.lmd == lmd && lmd != 0L && inf.lmd != 0L) {
312+
+                if (inf != last) {
313+
+                    if (inf.prev != null) {
314+
+                        inf.prev.next = inf.next;
315+
+                    } else {
316+
+                        first = inf.next;
317+
+                    }
318+
+                    if (inf.next != null) {
319+
+                        inf.next.prev = inf.prev;
320+
+                    } else {
321+
+                        last = inf.prev;
322+
+                    }
323+
+
324+
+                    inf.prev = last;
325+
+                    inf.next = null;
326+
+                    last = inf;
327+
+                    inf.prev.next = last;
328+
+                }
329+
+                return inf; //!
330+
+            } else {
331+
+                imageInfoCache.remove(cacheKey);
332+
+                if (inf.prev != null) {
333+
+                    inf.prev.next = inf.next;
334+
+                } else {
335+
+                    first = inf.next;
336+
+                }
337+
+                if (inf.next != null) {
338+
+                    inf.next.prev = inf.prev;
339+
+                } else {
340+
+                    last = inf.prev;
341+
+                }
342+
+            }
343+
+        }
344+
+
345+
+	int width = 0;
346+
+	int height = 0;
347+
+
348+
+        try {
349+
+	    java.awt.image.BufferedImage img = ImageIO.read(f);
350+
+	    width = img.getWidth();
351+
+	    height = img.getHeight();
352+
+	} catch(Exception e) {
353+
+	    throw new TemplateModelException("Failed to analyse image file:" + cacheKey);
354+
+        }
355+
+        inf = new CachedImageInfo();
356+
+        inf.lmd = f.lastModified();
357+
+        inf.width = width;
358+
+        inf.height = height;
359+
+        inf.path = cacheKey;
360+
+        if (last != null) {
361+
+            last.next = inf;
362+
+        }
363+
+        inf.prev = last;
364+
+        inf.next = null;
365+
+        last = inf;
366+
+        if (inf.prev == null) {
367+
+            first = inf;
368+
+        }
369+
+        imageInfoCache.put(cacheKey, inf);
370+
+        if (imageInfoCache.size() > MAX_CACHE_SIZE) {
371+
+            imageInfoCache.remove(first.path);
372+
+            first.next.prev = null;
373+
+            first = first.next;
374+
+        }
375+
+
376+
+        return inf;
377+
+    }
378+
+
379+
+    private class CachedImageInfo {
380+
+        private CachedImageInfo prev;
381+
+        private CachedImageInfo next;
382+
+        private String path;
383+
+        private long lmd;
384+
+        private int width;
385+
+        private int height;
386+
+    }
387+
+
388+
+    private class ImgTransform implements TemplateTransformModel {
389+
+        public Writer getWriter(Writer out, Map args)
390+
+                throws TemplateModelException, IOException {
391+
+            boolean detectHeight = true;
392+
+            boolean detectWidth = true;
393+
+            String src = null;
394+
+
395+
+            out.write("<img");
396+
+
397+
+            Iterator it = args.entrySet().iterator();
398+
+            while (it.hasNext()) {
399+
+                Map.Entry e = (Map.Entry) it.next();
400+
+                String pname = (String) e.getKey();
401+
+                Object obj = e.getValue();
402+
+                String pvalue;
403+
+                if (obj instanceof TemplateScalarModel) {
404+
+                    pvalue = ((TemplateScalarModel) obj).getAsString();
405+
+                } else if (obj instanceof TemplateNumberModel) {
406+
+                    pvalue = ((TemplateNumberModel) obj).getAsNumber()
407+
+                            .toString();
408+
+                } else if (obj instanceof TemplateBooleanModel) {
409+
+                    pvalue = null;
410+
+                    if (((TemplateBooleanModel) obj).getAsBoolean()) {
411+
+                        out.write(" " + pname);
412+
+                    }
413+
+                } else {
414+
+                    throw new TemplateModelException(
415+
+                            "Argument to img must be string, "	                             + "number or boolean");
416+
+                }
417+
+                if (pvalue != null) {
418+
+                    pname = pname.toLowerCase();
419+
+                    out.write(" " + pname + "=\""
420+
+                            + StringUtil.htmlEnc(pvalue) + "\"");
421+
+                    if (pname.equals("src")) {
422+
+                        src = pvalue;
423+
+                    } else if (pname.equals("width")) {
424+
+                        detectWidth = false;
425+
+                    } else if (pname.equals("height")) {
426+
+                        detectHeight = false;
427+
+                    }
428+
+                }
429+
+            }
430+
+            if (detectWidth || detectHeight) {
431+
+                if (src == null) {
432+
+                    throw new TemplateModelException(
433+
+                            "The src attribute of img is missing");
434+
+                }
435+
+                CachedImageInfo inf;
436+
+                inf = getImageInfo(engine.getTemplateEnvironment()
437+
+                        .resolveSourcePath(src));
438+
+                if (detectWidth) {
439+
+                    out.write(" width=\"" + inf.width + "\"");
440+
+                }
441+
+                if (detectHeight) {
442+
+                    out.write(" height=\"" + inf.height + "\"");
443+
+                }
444+
+            }
445+
+
446+
+            out.write(eTagClose);
447+
+
448+
+            return null;
449+
+        }
450+
+    }
451+
+}
452+
-- 
453+
2.11.0
454+

more/packages/java.scm

46284628
              (mkdir-p bin)
46294629
              (symlink (string-append jdk "/bin/java")
46304630
                       (string-append bin "/java"))
4631+
              (symlink (string-append jdk "/bin/jar")
4632+
                       (string-append bin "/jar"))
46314633
              (for-each (lambda (jar)
46324634
                          (let* ((name (substring jar 2 (- (string-length jar) 4)))
46334635
                                 (file (string-append bin "/" name)))

46374639
                              (("#TARGET_JAVA#") (string-append bin "/java"))
46384640
                              (("#PS#") ":")
46394641
                              (("#PROGRAM#") name)
4640-
                              (("mylib=.*") "mylib=\"$mydir/../share/java\"\n"))
4642+
                              (("mylib=.*") "mylib=\"$mydir/../share/java\"\n")
4643+
                              (("unzip") (which "unzip")))
46414644
                            (chmod file #o755)))
46424645
                (with-directory-excursion java
46434646
                  (find-files "." ".*.jar$"))))
46444647
             #t)))))
4648+
    (inputs
4649+
     `(("unzip" ,unzip)))
46454650
    (native-inputs
46464651
     `(("jdk" ,icedtea-8 "jdk")
46474652
       ("ant" ,ant)))

46534658
for compatibility with java 7.  This package is part of the checkerframework.")
46544659
    (license license:gpl2))); GPL 2 only
46554660
4661+
(define-public java-plume-lib-reflection-util
4662+
  (package
4663+
    (name "java-plume-lib-reflection-util")
4664+
    (version "0.0.1.1")
4665+
    (source (origin
4666+
              (method git-fetch)
4667+
              (uri (git-reference
4668+
                     (url "https://github.com/plume-lib/reflection-util.git")
4669+
                     (commit "b0de5e70ad71f75a6fd1918d35fdaeb29e97e189")))
4670+
              (file-name (git-file-name name version))
4671+
              (sha256
4672+
               (base32
4673+
                "0k1ls34ka0vjpyav1kn3ys19wjyp1vrjaha73yr90knpjwij8mi2"))))
4674+
    (build-system ant-build-system)
4675+
    (arguments
4676+
     `(#:jar-name "plume-lib-reflection-util.jar"
4677+
       #:source-dir "src/main/java"))
4678+
    (inputs
4679+
     `(("java-checkerframework-qual-annotation"
4680+
        ,java-checkerframework-qual-annotation)))
4681+
    (native-inputs
4682+
     `(("java-junit" ,java-junit)))
4683+
    (home-page "https://plumelib.org")
4684+
    (synopsis "")
4685+
    (description "")
4686+
    (license license:expat)))
4687+
4688+
(define-public java-plume-lib-util
4689+
  (package
4690+
    (name "java-plume-lib-util")
4691+
    (version "1.0.5")
4692+
    (source (origin
4693+
              (method git-fetch)
4694+
              (uri (git-reference
4695+
                     (url "https://github.com/plume-lib/plume-util.git")
4696+
                     (commit "db6dd1795b942e75360bf93de16f973922d767d8")))
4697+
              (file-name (git-file-name name version))
4698+
              (sha256
4699+
               (base32
4700+
                "1i1hyvyprx879awypb0hjq74k484dw3744ljrhwyxzvvrazr5rc4"))))
4701+
    (build-system ant-build-system)
4702+
    (arguments
4703+
     `(#:jar-name "plume-lib-util.jar"
4704+
       #:source-dir "src/main/java"))
4705+
    (inputs
4706+
     `(("java-checkerframework-qual-annotation"
4707+
        ,java-checkerframework-qual-annotation)
4708+
       ("java-plume-lib-reflection-util" ,java-plume-lib-reflection-util)))
4709+
    (native-inputs
4710+
     `(("java-junit" ,java-junit)))
4711+
    (home-page "https://plumelib.org")
4712+
    (synopsis "")
4713+
    (description "")
4714+
    (license license:expat)))
4715+
46564716
(define-public java-annotation-tools
46574717
  (package
46584718
    (name "java-annotation-tools")

46694729
    (build-system ant-build-system)
46704730
    (arguments
46714731
     `(#:build-target "all"
4672-
       #:jdk ,java-jsr308-langtools))
4732+
       #:jdk ,java-jsr308-langtools
4733+
       #:tests? #f; too complex for now
4734+
       #:phases
4735+
       (modify-phases %standard-phases
4736+
         (replace 'build
4737+
           (lambda* (#:key inputs #:allow-other-keys)
4738+
             (mkdir-p "build/jar")
4739+
             (mkdir-p "build/classes")
4740+
             (apply invoke "javac" "-d" "build/classes"
4741+
                    (find-files "asmx/src" ".*.java$"))
4742+
             (invoke "jar" "cf" "build/jar/asmx.jar"
4743+
                     "-C" "build/classes" ".")
4744+
             (delete-file-recursively "build/classes")
4745+
             (mkdir-p "build/classes")
4746+
             (apply invoke "javac" "-d" "build/classes"
4747+
                    "-cp" (string-append "build/jar/asmx.jar:" (getenv "CLASSPATH"))
4748+
                    (find-files "scene-lib/src" ".*.java$"))
4749+
             (invoke "jar" "cf" "build/jar/scenelib.jar"
4750+
                     "-C" "build/classes" ".")
4751+
             (delete-file-recursively "build/classes")
4752+
             (mkdir-p "build/classes")
4753+
             (apply invoke "javac" "-d" "build/classes"
4754+
                    "-cp" (string-append
4755+
                            "build/jar/asmx.jar:build/jar/scenelib.jar:"
4756+
                            (getenv "CLASSPATH"))
4757+
                    (find-files "annotation-file-utilities/src" ".*.java$"))
4758+
             (invoke "jar" "cf" "build/jar/annotation-file-utilities.jar"
4759+
                     "-C" "build/classes" ".")
4760+
             #t))
4761+
           (replace 'install
4762+
             (install-jars "build/jar")))))
4763+
    (inputs
4764+
     `(("java-checkerframework-qual-annotation"
4765+
        ,java-checkerframework-qual-annotation)
4766+
       ("java-guava" ,java-guava)
4767+
       ("java-plume-lib-util" ,java-plume-lib-util)))
46734768
    (home-page "https://checkerframework.org/annotation-file-utilities/")
46744769
    (synopsis "External storage of annotations")
46754770
    (description "Sometimes, it is convenient to specify the annotations

46894784
              (file-name (git-file-name name version))
46904785
              (sha256
46914786
               (base32
4692-
                "0fdf6m9s1bw8k4567vymhz7x6vpx255ks30nsawdsxhi0kqd219s"))))
4787+
                "0fdf6m9s1bw8k4567vymhz7x6vpx255ks30nsawdsxhi0kqd219s"))
4788+
              (modules '((guix build utils)))
4789+
              (snippet
4790+
                `(begin
4791+
                   (for-each delete-file (find-files "." ".*.jar$"))
4792+
                   #t))))
46934793
    (build-system ant-build-system)
46944794
    (arguments
46954795
     `(#:jar-name "checkerframework.jar"

47444844
             (test "checker")
47454845
             #t)))))
47464846
    (inputs
4747-
     `(("java-javaparser" ,java-javaparser)))
4847+
     `(("java-annotation-tools" ,java-annotation-tools)
4848+
       ("java-javaparser" ,java-javaparser)))
47484849
    (home-page "https://checkerframework.org/")
47494850
    (synopsis "Statically detect common mistakes")
47504851
    (description "This framework enhances the Java type system in order to

47544855
               license:gpl2+; with classpath exception
47554856
               license:expat))))
47564857
4757-
(define-public java-truth
4858+
;; Some random annotations required by dependencies of checkerframework
4859+
(define-public java-checkerframework-qual-annotation
47584860
  (package
4759-
    (name "java-truth")
4760-
    (version "0.42")
4861+
    (inherit java-checkerframework)
4862+
    (name "java-checkerframework-qual-annotation")
4863+
    (arguments
4864+
     `(#:tests? #f
4865+
       #:phases
4866+
       (modify-phases %standard-phases
4867+
         (replace 'build
4868+
           (lambda _
4869+
             (define (find-files* dir dirs pattern)
4870+
               (if (null? dirs)
4871+
                 (find-files dir pattern)
4872+
                 (let ((next (car dirs))
4873+
                       (rest (cdr dirs)))
4874+
                   (apply append (map (lambda (dir) (find-files* dir rest pattern)) (find-files dir next #:directories? #t))))))
4875+
             (mkdir-p "build/classes")
4876+
             (mkdir-p "build/jar")
4877+
             (apply invoke "javac" "-d" "build/classes"
4878+
                    "-cp" (getenv "CLASSPATH")
4879+
                    (append
4880+
                      ;; List from checker-qual/build.gradle (copySources)
4881+
                      (find-files "." "^FormatUtil.java")
4882+
                      (find-files "." "^NullnessUtil.java")
4883+
                      (find-files "." "^RegexUtil.java")
4884+
                      (find-files "." "^UnitsTools.java")
4885+
                      (find-files "." "^SignednessUtil.java")
4886+
                      (find-files "." "^I18nFormatUtil.java")
4887+
                      (find-files "." "^Opt.java")
4888+
                      (find-files "." "^PurityUnqualified.java")
4889+
                      (find-files* "." '("^org$" "^checkerframework$" "^qual$")
4890+
                                   ".*.java$")))
4891+
             (invoke "jar" "cf" "build/jar/checkerframework-qual-annotation.jar"
4892+
                     "-C" "build/classes" ".")
4893+
             #t))
4894+
         (replace 'install
4895+
           (install-jars "build/jar")))))
4896+
    (inputs '())
4897+
    (native-inputs '())))
4898+
4899+
;; Some random annotations required by dependencies of checkerframework
4900+
(define-public java-checkerframework-compat-qual-annotation
4901+
  (package
4902+
    (inherit java-checkerframework)
4903+
    (name "java-checkerframework-compat-qual-annotation")
4904+
    ;; Last version to provide this package
4905+
    (version "2.5.5")
47614906
    (source (origin
47624907
              (method git-fetch)
47634908
              (uri (git-reference
4764-
                     (url "https://github.com/google/truth.git")
4765-
                     (commit "5aaf4bc1874583db510bbb209365382e5681d65a")))
4909+
                     (url "https://github.com/typetools/checker-framework.git")
4910+
                     (commit "62602db32dbc0dd64b5aecc8c84671252a50e08b")))
47664911
              (file-name (git-file-name name version))
47674912
              (sha256
47684913
               (base32
4769-
                "1lyjmy66sprxx9hn9krwys4pv2ibjf4d1vqmbyhsx61bb6ji627f"))))
4770-
    (build-system ant-build-system)
4914+
                "0d6ngrv0262ipisfzb2f2wp7ygziqfmgd2hhsxdnip4a69ws1lz2"))
4915+
              (modules '((guix build utils)))
4916+
              (snippet
4917+
                `(begin
4918+
                   (for-each delete-file (find-files "." ".*.jar$"))
4919+
                   #t))))
47714920
    (arguments
4772-
     `(#:jar-name "truth.jar"
4773-
       #:source-dir "core/src/main/java"
4774-
       #:test-dir "core/src/test"))
4775-
    (inputs
4776-
     `(("java-checkerframework" ,java-checkerframework)
4777-
       ("java-diff-utils" ,java-diff-utils)
4778-
       ("java-guava" ,java-guava)
4779-
       ("java-junit" ,java-junit)))
4780-
    (home-page "https://google.github.io/truth")
4781-
    (synopsis "Assertion library for Java")
4782-
    (description "Truth makes your test assertions and failure messages more
4783-
readable.  Similar to AssertJ, it natively supports many JDK and Guava types,
4784-
and it is extensible to others.")
4785-
    (license license:asl2.0)))
4921+
     `(#:tests? #f
4922+
       #:phases
4923+
       (modify-phases %standard-phases
4924+
         (replace 'build
4925+
           (lambda _
4926+
             (define (find-files* dir dirs pattern)
4927+
               (if (null? dirs)
4928+
                 (find-files dir pattern)
4929+
                 (let ((next (car dirs))
4930+
                       (rest (cdr dirs)))
4931+
                   (apply append (map (lambda (dir) (find-files* dir rest pattern)) (find-files dir next #:directories? #t))))))
4932+
             (mkdir-p "build/classes")
4933+
             (mkdir-p "build/jar")
4934+
             (apply invoke "javac" "-d" "build/classes"
4935+
                    "-cp" (getenv "CLASSPATH")
4936+
                    (append
4937+
                      ;; List from checker-qual/build.gradle (copySources)
4938+
                      (find-files* "." '("^org$" "^checkerframework$" "^compatqual$")
4939+
                                   ".*.java$")))
4940+
             (invoke "jar" "cf" "build/jar/checkerframework-qual-annotation.jar"
4941+
                     "-C" "build/classes" ".")
4942+
             #t))
4943+
         (replace 'install
4944+
           (install-jars "build/jar")))))
4945+
    (inputs '())
4946+
    (native-inputs '())))
47864947
47874948
(define-public java-truth
47884949
  (package

48014962
    (arguments
48024963
     `(#:jar-name "truth.jar"
48034964
       #:source-dir "core/src/main/java"
4804-
       #:test-dir "core/src/test"))
4965+
       #:test-dir "core/src/test"
4966+
       #:tests? #f; TODO: require google-testing
4967+
       #:phases
4968+
       (modify-phases %standard-phases
4969+
         (add-before 'build 'remove-duplicate
4970+
           (lambda _
4971+
             (delete-file-recursively
4972+
               "core/src/main/java/com/google/common/truth/super")
4973+
             (delete-file-recursively
4974+
               "core/src/test/java/com/google/common/truth/super")
4975+
             #t)))))
48054976
    (inputs
4806-
     `(("java-diff-utils" ,java-diff-utils)
4807-
       ("java-guava" ,java-guava)
4977+
     `(("java-checkerframework-compat-qual-annotation"
4978+
        ,java-checkerframework-compat-qual-annotation)
4979+
       ("java-diff-utils" ,java-diff-utils)
4980+
       ("java-error-prone-annotations" ,java-error-prone-annotations)
4981+
       ("java-guava-25" ,java-guava-25)
4982+
       ("java-hamcrest-core" ,java-hamcrest-core)
48084983
       ("java-junit" ,java-junit)))
48094984
    (home-page "https://google.github.io/truth")
48104985
    (synopsis "Assertion library for Java")

48295004
    (arguments
48305005
     `(#:jar-name (string-append ,name "-" ,version ".jar")
48315006
       #:source-dir "src/main/java"
5007+
       #:tests? #f; TODO: require google-testing
48325008
       #:jdk ,icedtea-8))
48335009
    (native-inputs
4834-
     `(("guice" ,java-guice)
5010+
     `(("java-guava-25" ,java-guava-25)
48355011
       ("java-junit" ,java-junit)
5012+
       ("java-mockito-1" ,java-mockito-1)
48365013
       ("java-truth" ,java-truth)))
48375014
    (home-page "https://github.com/square/javapoet")
48385015
    (synopsis "")

49175094
(define-public java-error-prone
49185095
  (package
49195096
    (name "java-error-prone")
4920-
    (version "2.0.19")
5097+
    (version "2.3.2")
49215098
    (source (origin
49225099
              (method url-fetch)
49235100
              (uri (string-append "https://github.com/google/error-prone/archive/v"

49255102
              (file-name (string-append name "-" version ".tar.gz"))
49265103
              (sha256
49275104
               (base32
4928-
                "1qm7zpf0m75ps623h90xwb0rfyj4pywybvp005s9ykaqcvp50kzf"))))
5105+
                "0m0gzdhahjmiyr1ccl2zbf35qin3qbjxf3ay42vj49ba4c3yy8s7"))))
49295106
    (build-system ant-build-system)
49305107
    (arguments
49315108
     `(#:tests? #f

49385115
             (mkdir-p "ant/src/main/java/com/google/errorprone/internal")
49395116
             (copy-file
49405117
               "core/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java"
4941-
               "ant/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java"))))))
5118+
               "ant/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java")
5119+
             #t)))))
49425120
    (propagated-inputs '())
49435121
    (home-page "https://github.com/google/guava")
49445122
    (synopsis "")

51705348
               ;; * "IgnoreJRERequirement" is used for Android.
51715349
               (substitute* (find-files "." "\\.java$")
51725350
                 (("import com.google.j2objc.*") "")
5173-
                 (("import com.google.errorprone.annotation.*") "")
51745351
                 (("import org.codehaus.mojo.animal_sniffer.*") "")
5175-
                 (("@CanIgnoreReturnValue") "")
5176-
                 (("@LazyInit") "")
51775352
                 (("@WeakOuter") "")
51785353
                 (("@RetainedWith") "")
51795354
                 (("@Weak") "")
5180-
                 (("@ForOverride") "")
51815355
                 (("@J2ObjCIncompatible") "")
5182-
                 (("@CompatibleWith\\(\"[A-Z]\"\\)") "")
5183-
                 (("@Immutable\\([^\\)]*\\)") "")
5184-
                 (("@Immutable") "")
51855356
                 (("@ReflectionSupport\\([^\\)]*\\)") "")
5186-
                 (("@DoNotMock.*") "")
5187-
                 (("@MustBeClosed") "")
51885357
                 (("@IgnoreJRERequirement") "")))
5189-
             #t)))))))
5358+
             #t)))))
5359+
     (inputs
5360+
      `(("java-checkerframework-qual-annotation"
5361+
         ,java-checkerframework-qual-annotation)
5362+
        ("java-error-prone-annotations" ,java-error-prone-annotations)
5363+
        ("java-jsr305" ,java-jsr305)))))
51905364
51915365
;(define-public java-xml-commons
51925366
;  (package

63316505
    (description "")
63326506
    (license license:asl2.0)))
63336507
6334-
(define-public openjdk9
6335-
  (package
6336-
    (name "openjdk")
6337-
    (version "9+181")
6338-
    (source (origin
6339-
              (method url-fetch)
6340-
              (uri "http://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
6341-
              (file-name (string-append name "-" version ".tar.bz2"))
6342-
              (sha256
6343-
               (base32
6344-
                "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))))
6345-
    (build-system gnu-build-system)
6346-
    (outputs '("out" "jdk" "doc"))
6347-
    (arguments
6348-
     `(#:tests? #f; require jtreg
6349-
       #:imported-modules
6350-
       ((guix build syscalls)
6351-
        ,@%gnu-build-system-modules)
6352-
       #:phases
6353-
       (modify-phases %standard-phases
6354-
         (delete 'patch-source-shebangs)
6355-
         (replace 'configure
6356-
           (lambda* (#:key inputs outputs #:allow-other-keys)
6357-
             (invoke "bash" "./configure"
6358-
                     (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
6359-
                     "--disable-freetype-bundling"
6360-
                     "--disable-warnings-as-errors"
6361-
                     "--disable-hotspot-gtest"
6362-
                     (string-append "--prefix=" (assoc-ref outputs "out")))
6363-
             #t))
6364-
         (replace 'build
6365-
           (lambda _
6366-
             (with-output-to-file ".src-rev"
6367-
               (lambda _
6368-
                 (display ,version)))
6369-
             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
6370-
             (invoke "make" "all")
6371-
             #t))
6372-
         ;; Some of the libraries in the lib/ folder link to libjvm.so.
6373-
         ;; But that shared object is located in the server/ folder, so it
6374-
         ;; cannot be found.  This phase creates a symbolic link in the
6375-
         ;; lib/ folder so that the other libraries can find it.
6376-
         ;;
6377-
         ;; See:
6378-
         ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
6379-
         ;;
6380-
         ;; FIXME: Find the bug in the build system, so that this symlink is
6381-
         ;; not needed.
6382-
         (add-after 'install 'install-libjvm
6383-
           (lambda* (#:key inputs outputs #:allow-other-keys)
6384-
             (let* ((lib-out (string-append (assoc-ref outputs "out")
6385-
                                             "/lib"))
6386-
                    (lib-jdk (string-append (assoc-ref outputs "jdk")
6387-
                                             "/lib")))
6388-
               (symlink (string-append lib-jdk "/server/libjvm.so")
6389-
                        (string-append lib-jdk "/libjvm.so"))
6390-
               (symlink (string-append lib-out "/server/libjvm.so")
6391-
                        (string-append lib-out "/libjvm.so")))
6392-
             #t))
6393-
         (replace 'install
6394-
           (lambda* (#:key outputs #:allow-other-keys)
6395-
             (let ((out (assoc-ref outputs "out"))
6396-
                   (jdk (assoc-ref outputs "jdk"))
6397-
                   (doc (assoc-ref outputs "doc"))
6398-
                   (images (car (find-files "build" ".*-server-release"
6399-
                                            #:directories? #t))))
6400-
               (copy-recursively (string-append images "/images/jdk") jdk)
6401-
               (copy-recursively (string-append images "/images/jre") out)
6402-
               (copy-recursively (string-append images "/images/docs") doc))
6403-
             #t))
6404-
         (add-after 'install 'strip-zip-timestamps
6405-
           (lambda* (#:key outputs #:allow-other-keys)
6406-
             (use-modules (guix build syscalls))
6407-
             (for-each (lambda (zip)
6408-
                         (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
6409-
                           (with-directory-excursion dir
6410-
                             (invoke "unzip" zip))
6411-
                           (delete-file zip)
6412-
                           (for-each (lambda (file)
6413-
                                       (let ((s (lstat file)))
6414-
                                         (unless (eq? (stat:type s) 'symlink)
6415-
                                           (format #t "reset ~a~%" file)
6416-
                                           (utime file 0 0 0 0))))
6417-
                             (find-files dir #:directories? #t))
6418-
                           (with-directory-excursion dir
6419-
                             (let ((files (find-files "." ".*" #:directories? #t)))
6420-
                               (apply invoke "zip" "-0" "-X" zip files)))))
6421-
               (find-files (assoc-ref outputs "doc") ".*.zip$"))
6422-
             #t)))))
6423-
    (inputs
6424-
     `(("alsa-lib" ,alsa-lib)
6425-
       ("cups" ,cups)
6426-
       ("fontconfig" ,fontconfig)
6427-
       ("freetype" ,freetype)
6428-
       ("libelf" ,libelf)
6429-
       ("libice" ,libice)
6430-
       ("libx11" ,libx11)
6431-
       ("libxcomposite" ,libxcomposite)
6432-
       ("libxi" ,libxi)
6433-
       ("libxinerama" ,libxinerama)
6434-
       ("libxrender" ,libxrender)
6435-
       ("libxt" ,libxt)
6436-
       ("libxtst" ,libxtst)))
6437-
    (native-inputs
6438-
     `(("icedtea-8" ,icedtea-8)
6439-
       ("icedtea-8:jdk" ,icedtea-8 "jdk")
6440-
       ("unzip" ,unzip)
6441-
       ("which" ,which)
6442-
       ("zip" ,zip)))
6443-
    (home-page "http://openjdk.java.net/projects/jdk9/")
6444-
    (synopsis "")
6445-
    (description "")
6446-
    (license license:gpl2)))
6447-
6448-
(define-public openjdk10
6449-
  (package
6450-
    (name "openjdk")
6451-
    (version "10+46")
6452-
    (source (origin
6453-
              (method url-fetch)
6454-
              (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
6455-
              (file-name (string-append name "-" version ".tar.bz2"))
6456-
              (sha256
6457-
               (base32
6458-
                "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))))
6459-
    (build-system gnu-build-system)
6460-
    (outputs '("out" "jdk" "doc"))
6461-
    (arguments
6462-
     `(#:tests? #f; require jtreg
6463-
       #:imported-modules
6464-
       ((guix build syscalls)
6465-
        ,@%gnu-build-system-modules)
6466-
       #:phases
6467-
       (modify-phases %standard-phases
6468-
         (delete 'patch-source-shebangs)
6469-
         (replace 'configure
6470-
           (lambda* (#:key inputs outputs #:allow-other-keys)
6471-
             (invoke "bash" "./configure"
6472-
                     (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
6473-
                     "--disable-freetype-bundling"
6474-
                     "--disable-warnings-as-errors"
6475-
                     "--disable-hotspot-gtest"
6476-
                     (string-append "--prefix=" (assoc-ref outputs "out")))
6477-
             #t))
6478-
         (replace 'build
6479-
           (lambda _
6480-
             (with-output-to-file ".src-rev"
6481-
               (lambda _
6482-
                 (display ,version)))
6483-
             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
6484-
             (invoke "make" "all")
6485-
             #t))
6486-
         ;; Some of the libraries in the lib/ folder link to libjvm.so.
6487-
         ;; But that shared object is located in the server/ folder, so it
6488-
         ;; cannot be found.  This phase creates a symbolic link in the
6489-
         ;; lib/ folder so that the other libraries can find it.
6490-
         ;;
6491-
         ;; See:
6492-
         ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
6493-
         ;;
6494-
         ;; FIXME: Find the bug in the build system, so that this symlink is
6495-
         ;; not needed.
6496-
         (add-after 'install 'install-libjvm
6497-
           (lambda* (#:key inputs outputs #:allow-other-keys)
6498-
             (let* ((lib-out (string-append (assoc-ref outputs "out")
6499-
                                             "/lib"))
6500-
                    (lib-jdk (string-append (assoc-ref outputs "jdk")
6501-
                                             "/lib")))
6502-
               (symlink (string-append lib-jdk "/server/libjvm.so")
6503-
                        (string-append lib-jdk "/libjvm.so"))
6504-
               (symlink (string-append lib-out "/server/libjvm.so")
6505-
                        (string-append lib-out "/libjvm.so")))
6506-
             #t))
6507-
         (replace 'install
6508-
           (lambda* (#:key outputs #:allow-other-keys)
6509-
             (let ((out (assoc-ref outputs "out"))
6510-
                   (jdk (assoc-ref outputs "jdk"))
6511-
                   (doc (assoc-ref outputs "doc"))
6512-
                   (images (car (find-files "build" ".*-server-release"
6513-
                                            #:directories? #t))))
6514-
               (copy-recursively (string-append images "/images/jdk") jdk)
6515-
               (copy-recursively (string-append images "/images/jre") out)
6516-
               (copy-recursively (string-append images "/images/docs") doc))
6517-
             #t))
6518-
         (add-after 'install 'strip-zip-timestamps
6519-
           (lambda* (#:key outputs #:allow-other-keys)
6520-
             (use-modules (guix build syscalls))
6521-
             (for-each (lambda (zip)
6522-
                         (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
6523-
                           (with-directory-excursion dir
6524-
                             (invoke "unzip" zip))
6525-
                           (delete-file zip)
6526-
                           (for-each (lambda (file)
6527-
                                       (let ((s (lstat file)))
6528-
                                         (unless (eq? (stat:type s) 'symlink)
6529-
                                           (format #t "reset ~a~%" file)
6530-
                                           (utime file 0 0 0 0))))
6531-
                             (find-files dir #:directories? #t))
6532-
                           (with-directory-excursion dir
6533-
                             (let ((files (find-files "." ".*" #:directories? #t)))
6534-
                               (apply invoke "zip" "-0" "-X" zip files)))))
6535-
               (find-files (assoc-ref outputs "doc") ".*.zip$"))
6536-
             #t)))))
6537-
    (inputs
6538-
     `(("alsa-lib" ,alsa-lib)
6539-
       ("cups" ,cups)
6540-
       ("fontconfig" ,fontconfig)
6541-
       ("freetype" ,freetype)
6542-
       ("libelf" ,libelf)
6543-
       ("libice" ,libice)
6544-
       ("libx11" ,libx11)
6545-
       ("libxcomposite" ,libxcomposite)
6546-
       ("libxi" ,libxi)
6547-
       ("libxinerama" ,libxinerama)
6548-
       ("libxrender" ,libxrender)
6549-
       ("libxt" ,libxt)
6550-
       ("libxtst" ,libxtst)))
6551-
    (native-inputs
6552-
     `(("openjdk9" ,openjdk9)
6553-
       ("openjdk9:jdk" ,openjdk9 "jdk")
6554-
       ("unzip" ,unzip)
6555-
       ("which" ,which)
6556-
       ("zip" ,zip)))
6557-
    (home-page "http://openjdk.java.net/projects/jdk9/")
6558-
    (synopsis "")
6559-
    (description "")
6560-
    (license license:gpl2)))
6561-
65626508
(define-public java-procyon
65636509
  (package
65646510
    (name "java-procyon")

73507296
    (build-system ant-build-system)
73517297
    (arguments
73527298
     `(#:jar-name "caffeine.jar"
7353-
       #:source-dir "caffeine/src/main/java"
7299+
       #:source-dir "caffeine/src/main/java:caffeine/generated-sources"
7300+
       #:test-dir "caffeine/src/test"
7301+
       #:jdk ,openjdk9
73547302
       #:phases
73557303
       (modify-phases %standard-phases
73567304
         (add-before 'build 'generate-javapoet

73597307
             (apply invoke "javac" "-cp" (getenv "CLASSPATH")
73607308
                    "-d" "build/javapoet"
73617309
                    (find-files "caffeine/src/javaPoet" ".*.java$"))
7310+
             (copy-recursively "caffeine/src/javaPoet/resources"
7311+
                               "build/javapoet")
7312+
             (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
7313+
                                                 ":build/javapoet")
7314+
                     "-noverify"
7315+
                     "com.github.benmanes.caffeine.cache.LocalCacheFactoryGenerator"
7316+
                     "caffeine/generated-sources")
7317+
             (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
7318+
                                                 ":build/javapoet")
7319+
                     "-noverify"
7320+
                     "com.github.benmanes.caffeine.cache.NodeFactoryGenerator"
7321+
                     "caffeine/generated-sources")
73627322
             #t)))))
73637323
    (inputs
7364-
     `(("java-jsr305" ,java-jsr305)
7324+
     `(("java-commons-lang3" ,java-commons-lang3)
7325+
       ("java-guava" ,java-guava)
7326+
       ("java-jsr305" ,java-jsr305)
73657327
       ("java-javapoet" ,java-javapoet)))
7328+
    (native-inputs
7329+
     `(("java-hamcrest-all" ,java-hamcrest-all)
7330+
       ("java-mockito-1" ,java-mockito-1)
7331+
       ("java-testng" ,java-testng)))
73667332
    (home-page "")
73677333
    (synopsis "")
73687334
    (description "")