add java packages, mostly not working though

Julien LepillerSun Jul 30 10:40:51+0200 2017

73e983c

add java packages, mostly not working though

more/packages/java.scm

2929
  #:use-module (guix build-system trivial)
3030
  #:use-module (gnu packages autotools)
3131
  #:use-module (gnu packages base)
32+
  #:use-module (gnu packages compression)
3233
  #:use-module (gnu packages java))
3334
35+
(define-public java-tomcat
36+
  (package
37+
    (name "java-tomcat")
38+
    (version "8.5.16")
39+
    (source (origin
40+
              (method url-fetch)
41+
              (uri (string-append "http://download.nextag.com/apache/tomcat/tomcat-8/v"
42+
                                  version "/src/apache-tomcat-" version "-src.tar.gz"))
43+
              (sha256
44+
               (base32
45+
                "08vc859z9f0787nhikbdsj6i441d4qk5xv17c1564hxxg6bmilqd"))))
46+
    (build-system ant-build-system)
47+
    (inputs
48+
     `(("java-eclipse-jdt-core" ,java-eclipse-jdt-core)))
49+
    (native-inputs
50+
     `(("java-junit" ,java-junit)))
51+
    (arguments
52+
     `(#:build-target "package"
53+
       ;#:test-target "test"
54+
       #:tests? #f; requires downloading some files.
55+
       #:phases
56+
       (modify-phases %standard-phases
57+
         (add-after 'unpack 'properties
58+
           (lambda _
59+
             (mkdir "downloads")
60+
             (substitute* "build.xml"
61+
               (("download-compile,") ""))
62+
             (with-output-to-file "build.properties"
63+
               (lambda _
64+
                 (display
65+
                   (string-append "base.path=" (getcwd) "/downloads\n"))))))
66+
         (replace 'install
67+
           (install-jars "output/build/lib")))))
68+
    (home-page "https://tomcat.apache.org")
69+
    (synopsis "Java Servlet, JavaServer Pages, Java Expression Language and Java
70+
WebSocket")
71+
    (description "Apache Tomcat is an open source implementation of the Java
72+
Servlet, JavaServer Pages, Java Expression Language and Java WebSocket
73+
technologies. The Java Servlet, JavaServer Pages, Java Expression Language and
74+
Java WebSocket specifications are developed under the Java Community Process.")
75+
    (license license:asl2.0)))
76+
77+
(define-public java-brotli-dec
78+
  (package
79+
    (name "java-brotli-dec")
80+
    (version "0.6.0")
81+
    (source (origin
82+
              (method url-fetch)
83+
              (uri (string-append "https://github.com/google/brotli/archive/v"
84+
                                  version ".tar.gz"))
85+
              (sha256
86+
               (base32
87+
                "03zfr6lw6ry643l6pbg0myg52clypxd0y0igd84dslchf3svvkb9"))))
88+
    (build-system ant-build-system)
89+
    (native-inputs
90+
     `(("junit" ,java-junit)))
91+
    (arguments
92+
     `(#:jar-name "brotli-dec.jar"
93+
       #:tests? #f; no test target
94+
       #:source-dir "java"))
95+
    (home-page "https://brotli.org")
96+
    (synopsis "Lossless compression algorithm")
97+
    (description "Brotli is a generic-purpose lossless compression algorithm
98+
that compresses data using a combination of a modern variant of the LZ77
99+
algorithm, Huffman coding and 2nd order context modeling, with a compression
100+
ratio comparable to the best currently available general-purpose compression
101+
methods.  It is similar in speed with deflate but offers more dense compression.")
102+
    (license license:expat)))
103+
104+
(define-public java-commons-compress-latest
105+
  (package
106+
    (inherit java-commons-compress)
107+
    (version "1.14")
108+
    (source (origin
109+
              (method url-fetch)
110+
              (uri (string-append "mirror://apache/commons/compress/source/"
111+
                                  "commons-compress-" version "-src.tar.gz"))
112+
              (sha256
113+
               (base32
114+
                "1msfjbknfgx78j96fsiqk44r45plz10x9sw88flrpf3yaf4d3br1"))))
115+
    (inputs
116+
     `(("dec" ,java-brotli-dec)
117+
       ,@(package-inputs java-commons-compress)))))
118+
34119
(define-public java-jmapviewer
35120
  (package
36121
    (name "java-jmapviewer")

67152
(define-public java-josm
68153
  (package
69154
    (name "java-josm")
70-
    (version "12275")
155+
    (version "12450")
71156
    (source (origin
72157
              (method git-fetch)
73158
              (uri (git-reference
74159
                    (url "https://github.com/openstreetmap/josm.git")
75-
                    (commit "f190ffc3ec16835c39150476e21d08d5557ed466")))
160+
                    (commit "61a9c27e59976805b7cce4fae5a48c8e04b19373")))
76161
              ;;(uri (svn-reference
77162
              ;;      (url "https://svn.openstreetmap.org/applications/editors/josm")
78163
              ;;      (revision 12039)))
79164
              (sha256
80165
               (base32
81-
                "191isyn9v396s3c6888brq1yl2chzs7myl3qbk5c7d8msxi4wv49"))
166+
                "1hab27b8s6h2b1g07pghr4nkx6rx2gx75488rwppdfc0ymzpjzrp"))
82167
              (file-name (string-append name "-" version))))
83168
    (build-system ant-build-system)
84169
    (native-inputs
85170
     `(("java-javacc" ,java-javacc)))
86171
    (propagated-inputs
87172
     `(("java-jmapviewer" ,java-jmapviewer)
173+
       ("java-tomcat" ,java-tomcat)
174+
       ("java-brotli-dec" ,java-brotli-dec)
175+
       ("java-xz" ,java-xz)
176+
       ("java-velocity" ,java-velocity)
88177
       ("java-commons-collections" ,java-commons-collections)
89-
       ("java-commons-compress" ,java-commons-compress)))
178+
       ("java-commons-logging-minimal" ,java-commons-logging-minimal)
179+
       ("java-commons-compress" ,java-commons-compress-latest)))
90180
    (arguments
91181
     `(;#:build-target "dist"
92182
       #:tests? #f

113203
               (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
114204
               (zero? (system* "javacc" "-DEBUG_PARSER=false"
115205
                               "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
116-
                               "-GRAMMAR_ENCODING=UTF-8" (string-append "-OUTPUT_DIRECTORY=" out)
206+
                               "-GRAMMAR_ENCODING=UTF-8"
207+
                               (string-append "-OUTPUT_DIRECTORY=" out)
117208
                               file)))))
118209
)))
119210
         ;(add-before 'build 'fix-compiler

162253
          `(modify-phases ,phases
163254
            (add-before 'build 'add-manifest
164255
              (lambda _
165-
                (call-with-output-file "MANIFEST.MF"
256+
                (mkdir-p "build/conf")
257+
                (call-with-output-file "build/conf/MANIFEST.MF"
166258
                  (lambda (file)
167259
                    (format file "Manifest-Version: 1.0\n")
168260
                    (format file "Ant-Version: Apache Ant 1.9.9\n")
169-
                    (format file "Created-By: 1.8.0_131-b11 (Oracle Corporation)")))))))))))
261+
                    (format file "Created-By: 1.8.0_131-b11 (Oracle Corporation)")))))
262+
            (replace 'install
263+
              (install-jars "build"))))))))
264+
265+
(define-public java-jdom2
266+
  (package
267+
    (name "java-jdom")
268+
    (version "2.0.6")
269+
    (source (origin
270+
              (method url-fetch)
271+
              (uri (string-append "https://github.com/hunterhacker/jdom/archive/JDOM-"
272+
                                  version ".tar.gz"))
273+
              (sha256
274+
               (base32
275+
                "0p8n7inqq2a25wk9ljinl3ixlx1x2la9qaman8ngd75xxjb02yc1"))))
276+
    (build-system ant-build-system)
277+
    (arguments
278+
     `(#:build-target "package"
279+
       #:tests? #f; junit run with "package" target
280+
       #:phases
281+
       (modify-phases %standard-phases
282+
         (replace 'install
283+
           (install-jars "build")))))
284+
    (home-page "http://jdom.org/")
285+
    (synopsis "Access, manipulate, and output XML data")
286+
    (description " Java-based solution for accessing, manipulating, and
287+
outputting XML data from Java code.")
288+
    (license license:bsd-4)))
289+
290+
(define-public java-jakarta-oro
291+
  (package
292+
    (name "java-jakarta-oro")
293+
    (version "2.0.8")
294+
    (source (origin
295+
              (method url-fetch)
296+
              (uri (string-append "https://archive.apache.org/dist/jakarta/oro/"
297+
                                  "jakarta-oro-" version ".tar.gz"))
298+
              (sha256
299+
               (base32
300+
                "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))))
301+
    (build-system ant-build-system)
302+
    (arguments
303+
     `(#:build-target "package"
304+
       #:tests? #f; junit run with "package" target
305+
       #:phases
306+
       (modify-phases %standard-phases
307+
         (add-after 'unpack 'remove-bin
308+
           (lambda _
309+
             (delete-file (string-append "jakarta-oro-" ,version ".jar"))))
310+
         (replace 'install
311+
           (install-jars ,(string-append "jakarta-oro-" version))))))
312+
    (home-page "https://jakarta.apache.org/oro/")
313+
    (synopsis "")
314+
    (description "")
315+
    (license license:asl2.0)))
316+
317+
(define-public java-jdom
318+
  (package
319+
    (name "java-jdom")
320+
    (version "1.1.3")
321+
    (source (origin
322+
              (method url-fetch)
323+
              (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
324+
                                  version ".tar.gz"))
325+
              (sha256
326+
               (base32
327+
                "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
328+
    (build-system ant-build-system)
329+
    (arguments
330+
     `(#:build-target "package"
331+
       #:tests? #f; junit run with "package" target
332+
       #:phases
333+
       (modify-phases %standard-phases
334+
         (replace 'install
335+
           (install-jars "build")))))
336+
    (home-page "http://jdom.org/")
337+
    (synopsis "Access, manipulate, and output XML data")
338+
    (description " Java-based solution for accessing, manipulating, and
339+
outputting XML data from Java code.")
340+
    (license license:bsd-4)))
341+
342+
(define-public java-commons-logging
343+
  (package
344+
    (inherit java-commons-logging-minimal)
345+
    (arguments
346+
     `(#:tests? #f ; avoid dependency on logging frameworks
347+
       #:jar-name "commons-logging.jar"
348+
       #:phases
349+
       (modify-phases %standard-phases
350+
         (add-after 'unpack 'delete-adapters-and-tests
351+
           (lambda _
352+
             ;; Delete all adapters except for NoOpLog, SimpleLog, and
353+
             ;; LogFactoryImpl.  NoOpLog is required to build; LogFactoryImpl
354+
             ;; is used by applications; SimpleLog is the only actually usable
355+
             ;; implementation that does not depend on another logging
356+
             ;; framework.
357+
             (for-each
358+
              (lambda (file)
359+
                (delete-file (string-append
360+
                              "src/main/java/org/apache/commons/logging/impl/" file)))
361+
              (list "Jdk13LumberjackLogger.java"
362+
                    "WeakHashtable.java"
363+
                    "Log4JLogger.java"
364+
                    "ServletContextCleaner.java"
365+
                    "Jdk14Logger.java"
366+
                    "AvalonLogger.java"
367+
                    "LogKitLogger.java"))
368+
             (delete-file-recursively "src/test")
369+
             #t)))))
370+
    (inputs
371+
     `(("log4j" ,java-log4j-api)
372+
       ,@(package-inputs java-commons-logging-minimal)))))
170373
171374
(define-public java-velocity
172375
  (package

181384
                "0rk7s04hkrr2k3glccx0yrglzqzj4qbipcrxhglk46yhx92vravc"))))
182385
    (build-system ant-build-system)
183386
    (arguments
184-
     `(#:phases
387+
     `(#:source-dir "src/java"
388+
       #:phases
185389
       (modify-phases %standard-phases
186390
         (add-before 'build 'prepare
187391
           (lambda* (#:key inputs #:allow-other-keys)

195399
     `(("javacc" ,java-javacc)
196400
       ("antlr" ,antlr2)))
197401
    (propagated-inputs
198-
     `(("java-commons-collections" ,java-commons-collections)))
402+
     `(("java-commons-collections" ,java-commons-collections)
403+
       ("java-jakarta-oro" ,java-jakarta-oro)
404+
       ("java-jdom" ,java-jdom)
405+
       ("java-tomcat" ,java-tomcat)
406+
       ("java-log4j-api" ,java-log4j-api)
407+
       ("java-commons-logging-minimal" ,java-commons-logging)
408+
       ("java-commons-lang" ,java-commons-lang)))
199409
    (home-page "https://velocity.apache.org/")
200410
    (synopsis "")
201411
    (description "")