java.scm
| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (more packages java) |
| 20 | #:use-module ((guix licenses) #:prefix license:) |
| 21 | #:use-module (gnu packages) |
| 22 | #:use-module (guix packages) |
| 23 | #:use-module (guix download) |
| 24 | #:use-module (guix git-download) |
| 25 | #:use-module (guix utils) |
| 26 | #:use-module (guix build-system ant) |
| 27 | #:use-module (guix build-system gnu) |
| 28 | #:use-module (guix build-system trivial) |
| 29 | #:use-module (gnu packages java)) |
| 30 | |
| 31 | (define-public josm |
| 32 | (package |
| 33 | (name "josm") |
| 34 | (version "c86ae64ca82a5bb9dd1972c7023797eb9a2577f5") |
| 35 | (source (origin |
| 36 | (method git-fetch) |
| 37 | (uri (git-reference |
| 38 | (url "https://github.com/openstreetmap/josm.git") |
| 39 | (commit version))) |
| 40 | (sha256 |
| 41 | (base32 |
| 42 | "07z2q4csq9gdpg4lp1zpvcl5z5sqn0fnqah94ya3sirm6bh4k74j")) |
| 43 | (file-name (string-append name "-" version)))) |
| 44 | (build-system ant-build-system) |
| 45 | (arguments |
| 46 | `(#:build-target "dist" |
| 47 | #:tests? #f |
| 48 | #:jdk ,icedtea-8 |
| 49 | #:phases |
| 50 | (modify-phases %standard-phases |
| 51 | (add-before 'build 'fix-compiler |
| 52 | (lambda* _ |
| 53 | (substitute* "build.xml" |
| 54 | (("UNKNOWN") "11639") |
| 55 | ((".*com.google.errorprone.ErrorProneAntCompilerAdapter.*") "") |
| 56 | (("compiler=\"[^\"]*\" ") "")))) |
| 57 | (replace 'install |
| 58 | (lambda* (#:key outputs #:allow-other-keys) |
| 59 | (let* ((out (assoc-ref outputs "out")) |
| 60 | (bin (string-append out "/bin")) |
| 61 | (lib (string-append out "/lib/josm"))) |
| 62 | (mkdir-p bin) |
| 63 | (mkdir-p lib) |
| 64 | (copy-file "dist/josm-custom.jar" |
| 65 | (string-append lib "/josm.jar")) |
| 66 | (with-output-to-file (string-append bin "/josm") |
| 67 | (lambda _ |
| 68 | (display |
| 69 | (string-append "#!/bin/sh\n" |
| 70 | "java -jar " lib "/josm.jar")))) |
| 71 | (chmod (string-append bin "/josm") #o755))))))) |
| 72 | (home-page "https://josm.openstreetmap.de") |
| 73 | (synopsis "OSM editor") |
| 74 | (description "OSM editor.") |
| 75 | (license license:gpl2+))) |
| 76 | |
| 77 | (define-public java-commons-cli |
| 78 | (package |
| 79 | (name "java-commons-cli") |
| 80 | (version "1.4") |
| 81 | (source (origin |
| 82 | (method url-fetch) |
| 83 | (uri (string-append "http://mirrors.ircam.fr/pub/apache/commons/" |
| 84 | "cli/source/commons-cli-" version "-src.tar.gz")) |
| 85 | (file-name (string-append name "-" version ".tar.gz")) |
| 86 | (sha256 |
| 87 | (base32 |
| 88 | "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1")))) |
| 89 | (build-system ant-build-system) |
| 90 | (arguments |
| 91 | `(#:jar-name "commons-cli-1.4.jar" |
| 92 | #:tests? #f)) |
| 93 | (native-inputs |
| 94 | `(("junit" ,java-junit))) |
| 95 | (home-page "") |
| 96 | (synopsis "") |
| 97 | (description "") |
| 98 | (license license:asl2.0))) |
| 99 | |
| 100 | (define-public java-asm |
| 101 | (package |
| 102 | (name "java-asm") |
| 103 | (version "5.2") |
| 104 | (source (origin |
| 105 | (method url-fetch) |
| 106 | (uri (string-append "http://download.forge.ow2.org/asm/asm-" |
| 107 | version ".tar.gz")) |
| 108 | (file-name (string-append name "-" version ".tar.gz")) |
| 109 | (sha256 |
| 110 | (base32 |
| 111 | "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr")))) |
| 112 | (build-system ant-build-system) |
| 113 | (arguments |
| 114 | `(#:jar-name "asm-5.2.jar" |
| 115 | #:tests? #f)) |
| 116 | (native-inputs |
| 117 | `(("junit" ,java-junit))) |
| 118 | (home-page "") |
| 119 | (synopsis "") |
| 120 | (description "") |
| 121 | (license license:asl2.0))) |
| 122 | |
| 123 | ;; Can only be built with gradle. |
| 124 | (define-public groovy |
| 125 | (package |
| 126 | (name "groovy") |
| 127 | (version "2.4.10") |
| 128 | (source (origin |
| 129 | (method url-fetch) |
| 130 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
| 131 | "2_4_10.tar.gz")) |
| 132 | (file-name (string-append name "-" version ".tar.gz")) |
| 133 | (sha256 |
| 134 | (base32 |
| 135 | "0wapzqwpx4bh2fsqpzf3haakjz6wvfjx1vd9a4spavhlrjqk2pbb")))) |
| 136 | (build-system ant-build-system) |
| 137 | (arguments |
| 138 | `(#:jar-name "groovy.jar" |
| 139 | #:tests? #f)) |
| 140 | (native-inputs |
| 141 | `(("junit" ,java-junit))) |
| 142 | (inputs |
| 143 | `(("commons-cli" ,java-commons-cli) |
| 144 | ("asm" ,java-asm))) |
| 145 | (home-page "") |
| 146 | (synopsis "") |
| 147 | (description "") |
| 148 | (license license:asl2.0))) |
| 149 | |
| 150 | ;; requires jline, commons-cli, javax.servlet, org.fusesource.jansi, org.livetribe, |
| 151 | ;; com.thoughtworks.xstream, org.apache.ivy, bsf, org.apache.ant, junit, |
| 152 | ;; asm, antlr |
| 153 | (define-public groovy-1.8.9 |
| 154 | (package |
| 155 | (inherit groovy) |
| 156 | (name "groovy") |
| 157 | (version "1.8.9") |
| 158 | (source (origin |
| 159 | (method url-fetch) |
| 160 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
| 161 | "1_8_9.tar.gz")) |
| 162 | (file-name (string-append name "-" version ".tar.gz")) |
| 163 | (sha256 |
| 164 | (base32 |
| 165 | "16z3jv5yw11wwwzbs6x41g83gqazhngg30ys2kpy7cpfm3rsqi71")))))) |
| 166 | ;(arguments |
| 167 | ; `(#:build-target "createJars")))) |
| 168 | |
| 169 | ;; requires groovy 2.4.7. |
| 170 | (define-public gradle |
| 171 | (package |
| 172 | (name "gradle") |
| 173 | (version "3.4.1") |
| 174 | (source (origin |
| 175 | (method url-fetch) |
| 176 | (uri (string-append "https://github.com/gradle/gradle/archive/v" |
| 177 | version ".tar.gz")) |
| 178 | (file-name (string-append name "-" version ".tar.gz")) |
| 179 | (sha256 |
| 180 | (base32 "0fq30k51mkixg31z3d4fjq3zbnyjml4i530px6n1n947mqk3rgyl")))) |
| 181 | (build-system ant-build-system) |
| 182 | (arguments |
| 183 | `(#:phases |
| 184 | (modify-phases %standard-phases |
| 185 | (replace 'build |
| 186 | (lambda* _ |
| 187 | (system* "sh" "-x" "gradlew" "prBuild" "-x" "integTest" "--continue" |
| 188 | "--stacktrace")))))) |
| 189 | ;(system* "sh" "-x" "travisci_build.sh")))))) |
| 190 | (home-page "") |
| 191 | (synopsis "Build system") |
| 192 | (description "Build system") |
| 193 | (license license:asl2.0))) |
| 194 | |
| 195 | ;; Requires gradle. |
| 196 | (define-public android-anysoft-keyboard |
| 197 | (package |
| 198 | (name "android-anysoft-keyboard") |
| 199 | (version "1.8-r9") |
| 200 | (source (origin |
| 201 | (method url-fetch) |
| 202 | (uri (string-append "https://github.com/AnySoftKeyboard/" |
| 203 | "AnySoftKeyboard/archive/" version ".tar.gz")) |
| 204 | (file-name (string-append name "-" version ".tar.gz")) |
| 205 | (sha256 |
| 206 | (base32 |
| 207 | "1mrin9mw1rs23d25v8yx4jprx7j05zir6756sqvk4myxbkcp8mag")))) |
| 208 | (build-system ant-build-system) |
| 209 | (home-page "https://anysoftkeyboard.github.io/") |
| 210 | (synopsis "Alternative on-screen keyboard for multiple languages") |
| 211 | (description "Alternative on-screen keyboard for multiple languages.") |
| 212 | (license license:asl2.0))) |
| 213 |