| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages java)
|
| 22 | #:use-module ((guix licenses) #:prefix license:)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module (guix download)
|
| 25 | #:use-module (guix utils)
|
| 26 | #:use-module (guix build-system ant)
|
| 27 | #:use-module (guix build-system gnu)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages attr)
|
| 30 | #:use-module (gnu packages autotools)
|
| 31 | #:use-module (gnu packages base)
|
| 32 | #:use-module (gnu packages bash)
|
| 33 | #:use-module (gnu packages certs)
|
| 34 | #:use-module (gnu packages cpio)
|
| 35 | #:use-module (gnu packages cups)
|
| 36 | #:use-module (gnu packages compression)
|
| 37 | #:use-module (gnu packages fontutils)
|
| 38 | #:use-module (gnu packages gawk)
|
| 39 | #:use-module (gnu packages gcc)
|
| 40 | #:use-module (gnu packages gl)
|
| 41 | #:use-module (gnu packages gnuzilla) |
| 42 | #:use-module (gnu packages ghostscript) |
| 43 | #:use-module (gnu packages gnome)
|
| 44 | #:use-module (gnu packages gtk)
|
| 45 | #:use-module (gnu packages image)
|
| 46 | #:use-module (gnu packages linux) |
| 47 | #:use-module (gnu packages wget)
|
| 48 | #:use-module (gnu packages pkg-config)
|
| 49 | #:use-module (gnu packages perl)
|
| 50 | #:use-module (gnu packages mit-krb5)
|
| 51 | #:use-module (gnu packages xml)
|
| 52 | #:use-module (gnu packages xorg)
|
| 53 | #:use-module (gnu packages zip)
|
| 54 | #:use-module (gnu packages texinfo)
|
| 55 | #:use-module ((srfi srfi-1) #:select (fold alist-delete))
|
| 56 | #:use-module (srfi srfi-11)
|
| 57 | #:use-module (ice-9 match))
|
| 58 |
|
| 59 | (define-public java-swt
|
| 60 | (package
|
| 61 | (name "java-swt")
|
| 62 | (version "4.6")
|
| 63 | (source
|
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | (let ((hash32 "0jmx1h65wqxsyjzs64i2z6ryiynllxzm13cq90fky2qrzagcw1ir")
|
| 70 | (hash64 "0wnd01xssdq9pgx5xqh5lfiy3dmk60dzzqdxzdzf883h13692lgy")
|
| 71 | (file32 "x86")
|
| 72 | (file64 "x86_64"))
|
| 73 | (let-values (((hash file)
|
| 74 | (match (or (%current-target-system) (%current-system))
|
| 75 | ("x86_64-linux" (values hash64 file64))
|
| 76 | (_ (values hash32 file32)))))
|
| 77 | (origin
|
| 78 | (method url-fetch)
|
| 79 | (uri (string-append
|
| 80 | "http://ftp-stud.fht-esslingen.de/pub/Mirrors/"
|
| 81 | "eclipse/eclipse/downloads/drops4/R-" version
|
| 82 | "-201606061100/swt-" version "-gtk-linux-" file ".zip"))
|
| 83 | (sha256 (base32 hash))))))
|
| 84 | (build-system ant-build-system)
|
| 85 | (arguments
|
| 86 | `(#:jar-name "swt.jar"
|
| 87 | #:tests? #f |
| 88 | #:phases
|
| 89 | (modify-phases %standard-phases
|
| 90 | (replace 'unpack
|
| 91 | (lambda* (#:key source #:allow-other-keys)
|
| 92 | (and (mkdir "swt")
|
| 93 | (zero? (system* "unzip" source "-d" "swt"))
|
| 94 | (chdir "swt")
|
| 95 | (mkdir "src")
|
| 96 | (zero? (system* "unzip" "src.zip" "-d" "src")))))
|
| 97 | |
| 98 | |
| 99 | |
| 100 | (add-after 'configure 'unset-classpath
|
| 101 | (lambda _ (unsetenv "CLASSPATH") #t))
|
| 102 | (add-before 'build 'build-native
|
| 103 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 104 | (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
|
| 105 | |
| 106 | |
| 107 | |
| 108 | (mkdir-p lib)
|
| 109 | (setenv "OUTPUT_DIR" lib)
|
| 110 | (with-directory-excursion "src"
|
| 111 | (zero? (system* "bash" "build.sh"))))))
|
| 112 | (add-after 'install 'install-native
|
| 113 | (lambda* (#:key outputs #:allow-other-keys)
|
| 114 | (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
|
| 115 | (for-each (lambda (file)
|
| 116 | (install-file file lib))
|
| 117 | (find-files "." "\\.so$"))
|
| 118 | #t))))))
|
| 119 | (inputs
|
| 120 | `(("xulrunner" ,icecat)
|
| 121 | ("gtk" ,gtk+-2)
|
| 122 | ("libxtst" ,libxtst)
|
| 123 | ("libxt" ,libxt)
|
| 124 | ("mesa" ,mesa)
|
| 125 | ("glu" ,glu)))
|
| 126 | (native-inputs
|
| 127 | `(("pkg-config" ,pkg-config)
|
| 128 | ("unzip" ,unzip)))
|
| 129 | (home-page "https://www.eclipse.org/swt/")
|
| 130 | (synopsis "Widget toolkit for Java")
|
| 131 | (description
|
| 132 | "SWT is a widget toolkit for Java designed to provide efficient, portable
|
| 133 | access to the user-interface facilities of the operating systems on which it
|
| 134 | is implemented.")
|
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | (license (list
|
| 140 | license:epl1.0
|
| 141 | license:mpl1.1
|
| 142 | license:mpl2.0
|
| 143 | license:lgpl2.1+))))
|
| 144 |
|
| 145 | (define-public ant
|
| 146 | (package
|
| 147 | (name "ant")
|
| 148 | (version "1.9.6")
|
| 149 | (source (origin
|
| 150 | (method url-fetch)
|
| 151 | (uri (string-append "mirror://apache/ant/source/apache-ant-"
|
| 152 | version "-src.tar.gz"))
|
| 153 | (sha256
|
| 154 | (base32
|
| 155 | "1396wflczyxjxl603dhxjvd559f289lha9y2f04f71c7hapjl3am"))))
|
| 156 | (build-system gnu-build-system)
|
| 157 | (arguments
|
| 158 | `(#:tests? #f |
| 159 | #:phases
|
| 160 | (alist-cons-after
|
| 161 | 'unpack 'remove-scripts
|
| 162 | |
| 163 | |
| 164 | (lambda _
|
| 165 | (for-each delete-file
|
| 166 | (find-files "src/script"
|
| 167 | "(.*\\.(bat|cmd)|runant.*|antRun.*)")))
|
| 168 | (alist-replace
|
| 169 | 'build
|
| 170 | (lambda _
|
| 171 | (setenv "JAVA_HOME" (string-append (assoc-ref %build-inputs "gcj")
|
| 172 | "/lib/jvm"))
|
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | (substitute* "build.xml"
|
| 178 | (("depends=\"jars,test-jar\"") "depends=\"jars\""))
|
| 179 | (zero? (system* "bash" "bootstrap.sh"
|
| 180 | (string-append "-Ddist.dir="
|
| 181 | (assoc-ref %outputs "out")))))
|
| 182 | (alist-delete
|
| 183 | 'configure
|
| 184 | (alist-delete 'install %standard-phases))))))
|
| 185 | (native-inputs
|
| 186 | `(("gcj" ,gcj)))
|
| 187 | (home-page "http://ant.apache.org")
|
| 188 | (synopsis "Build tool for Java")
|
| 189 | (description
|
| 190 | "Ant is a platform-independent build tool for Java. It is similar to
|
| 191 | make but is implemented using the Java language, requires the Java platform,
|
| 192 | and is best suited to building Java projects. Ant uses XML to describe the
|
| 193 | build process and its dependencies, whereas Make uses Makefile format.")
|
| 194 | (license license:asl2.0)))
|
| 195 |
|
| 196 | (define-public icedtea-6
|
| 197 | (package
|
| 198 | (name "icedtea")
|
| 199 | (version "1.13.11")
|
| 200 | (source (origin
|
| 201 | (method url-fetch)
|
| 202 | (uri (string-append
|
| 203 | "http://icedtea.wildebeest.org/download/source/icedtea6-"
|
| 204 | version ".tar.xz"))
|
| 205 | (patches (search-patches "icedtea-remove-overrides.patch"))
|
| 206 | (sha256
|
| 207 | (base32
|
| 208 | "1grki39a4rf8n74zc0iglcggxxbpniyfh1gk1lb10p63zvvcsvjj"))
|
| 209 | (modules '((guix build utils)))
|
| 210 | (snippet
|
| 211 | '(substitute* "Makefile.in"
|
| 212 | |
| 213 | (("-o native-ecj")
|
| 214 | "-lgcj -o native-ecj")
|
| 215 | |
| 216 | (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
|
| 217 | "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
|
| 218 | (build-system gnu-build-system)
|
| 219 | (outputs '("out" |
| 220 | "jdk" |
| 221 | "doc")) |
| 222 | (arguments
|
| 223 | `( |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | #:tests? #f
|
| 258 |
|
| 259 | |
| 260 | |
| 261 | #:validate-runpath? #f
|
| 262 |
|
| 263 | #:modules ((guix build utils)
|
| 264 | (guix build gnu-build-system)
|
| 265 | (ice-9 popen)
|
| 266 | (ice-9 rdelim)
|
| 267 | (srfi srfi-19))
|
| 268 |
|
| 269 | #:configure-flags
|
| 270 | (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
|
| 271 | (ecj (string-append gcjdir "/share/java/ecj.jar"))
|
| 272 | (jdk (string-append gcjdir "/lib/jvm/"))
|
| 273 | (gcj (string-append gcjdir "/bin/gcj")))
|
| 274 | `("--enable-bootstrap"
|
| 275 | "--enable-nss"
|
| 276 | "--without-rhino"
|
| 277 | "--disable-downloading"
|
| 278 | "--disable-tests" |
| 279 | "--with-openjdk-src-dir=./openjdk.src"
|
| 280 | ,(string-append "--with-javac=" jdk "/bin/javac")
|
| 281 | ,(string-append "--with-ecj-jar=" ecj)
|
| 282 | ,(string-append "--with-gcj=" gcj)
|
| 283 | ,(string-append "--with-jdk-home=" jdk)
|
| 284 | ,(string-append "--with-java=" jdk "/bin/java")))
|
| 285 | #:phases
|
| 286 | (modify-phases %standard-phases
|
| 287 | (replace 'unpack
|
| 288 | (lambda* (#:key source inputs #:allow-other-keys)
|
| 289 | (and (zero? (system* "tar" "xvf" source))
|
| 290 | (begin
|
| 291 | (chdir (string-append "icedtea6-" ,version))
|
| 292 | (mkdir "openjdk.src")
|
| 293 | (with-directory-excursion "openjdk.src"
|
| 294 | (copy-file (assoc-ref inputs "openjdk6-src")
|
| 295 | "openjdk6-src.tar.xz")
|
| 296 | (zero? (system* "tar" "xvf" "openjdk6-src.tar.xz")))))))
|
| 297 | (add-after 'unpack 'patch-patches
|
| 298 | (lambda _
|
| 299 | |
| 300 | (substitute* '("patches/jtreg-jrunscript.patch"
|
| 301 | "patches/hotspot/hs23/drop_unlicensed_test.patch")
|
| 302 | (("#!/bin/sh") (string-append "#!" (which "sh"))))
|
| 303 |
|
| 304 | |
| 305 | (substitute* "patches/openjdk/6799141-split_out_versions.patch"
|
| 306 | (("ALSA_INCLUDE=/usr/include/alsa/version.h")
|
| 307 | (string-append "ALSA_INCLUDE="
|
| 308 | (assoc-ref %build-inputs "alsa-lib")
|
| 309 | "/include/alsa/version.h")))))
|
| 310 | (add-after 'unpack 'patch-paths
|
| 311 | (lambda _
|
| 312 | |
| 313 | |
| 314 | (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
|
| 315 | (("/bin/sh") (which "bash")))
|
| 316 |
|
| 317 | (let ((corebin (string-append
|
| 318 | (assoc-ref %build-inputs "coreutils") "/bin/"))
|
| 319 | (binbin (string-append
|
| 320 | (assoc-ref %build-inputs "binutils") "/bin/"))
|
| 321 | (grepbin (string-append
|
| 322 | (assoc-ref %build-inputs "grep") "/bin/")))
|
| 323 | (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
|
| 324 | "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
|
| 325 | (("UNIXCOMMAND_PATH = /bin/")
|
| 326 | (string-append "UNIXCOMMAND_PATH = " corebin))
|
| 327 | (("USRBIN_PATH = /usr/bin/")
|
| 328 | (string-append "USRBIN_PATH = " corebin))
|
| 329 | (("DEVTOOLS_PATH *= */usr/bin/")
|
| 330 | (string-append "DEVTOOLS_PATH = " corebin))
|
| 331 | (("COMPILER_PATH *= */usr/bin/")
|
| 332 | (string-append "COMPILER_PATH = "
|
| 333 | (assoc-ref %build-inputs "gcc") "/bin/"))
|
| 334 | (("DEF_OBJCOPY *=.*objcopy")
|
| 335 | (string-append "DEF_OBJCOPY = " (which "objcopy"))))
|
| 336 |
|
| 337 | |
| 338 | (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
|
| 339 | "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
|
| 340 | (("ECHO *=.*echo")
|
| 341 | (string-append "ECHO = " (which "echo")))
|
| 342 | (("^GREP *=.*grep")
|
| 343 | (string-append "GREP = " (which "grep")))
|
| 344 | (("EGREP *=.*egrep")
|
| 345 | (string-append "EGREP = " (which "egrep")))
|
| 346 | (("CPIO *=.*cpio")
|
| 347 | (string-append "CPIO = " (which "cpio")))
|
| 348 | (("READELF *=.*readelf")
|
| 349 | (string-append "READELF = " (which "readelf")))
|
| 350 | (("^ *AR *=.*ar")
|
| 351 | (string-append "AR = " (which "ar")))
|
| 352 | (("^ *TAR *=.*tar")
|
| 353 | (string-append "TAR = " (which "tar")))
|
| 354 | (("AS *=.*as")
|
| 355 | (string-append "AS = " (which "as")))
|
| 356 | (("LD *=.*ld")
|
| 357 | (string-append "LD = " (which "ld")))
|
| 358 | (("STRIP *=.*strip")
|
| 359 | (string-append "STRIP = " (which "strip")))
|
| 360 | (("NM *=.*nm")
|
| 361 | (string-append "NM = " (which "nm")))
|
| 362 | (("^SH *=.*sh")
|
| 363 | (string-append "SH = " (which "bash")))
|
| 364 | (("^FIND *=.*find")
|
| 365 | (string-append "FIND = " (which "find")))
|
| 366 | (("LDD *=.*ldd")
|
| 367 | (string-append "LDD = " (which "ldd")))
|
| 368 | (("NAWK *=.*(n|g)awk")
|
| 369 | (string-append "NAWK = " (which "gawk")))
|
| 370 | (("XARGS *=.*xargs")
|
| 371 | (string-append "XARGS = " (which "xargs")))
|
| 372 | (("UNZIP *=.*unzip")
|
| 373 | (string-append "UNZIP = " (which "unzip")))
|
| 374 | (("ZIPEXE *=.*zip")
|
| 375 | (string-append "ZIPEXE = " (which "zip")))
|
| 376 | (("SED *=.*sed")
|
| 377 | (string-append "SED = " (which "sed"))))
|
| 378 |
|
| 379 | |
| 380 | |
| 381 | (substitute*
|
| 382 | "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
|
| 383 | (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
|
| 384 | (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
|
| 385 | (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
|
| 386 | (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
|
| 387 | (add-before 'configure 'set-additional-paths
|
| 388 | (lambda* (#:key inputs #:allow-other-keys)
|
| 389 | (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
|
| 390 | (gcjlib (string-append gcjdir "/lib"))
|
| 391 | |
| 392 | |
| 393 | (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
|
| 394 | (str (read-line port)))
|
| 395 | (close-pipe port)
|
| 396 | str)))
|
| 397 | (setenv "CPATH"
|
| 398 | (string-append gcjinclude ":"
|
| 399 | (assoc-ref %build-inputs "libxrender")
|
| 400 | "/include/X11/extensions" ":"
|
| 401 | (assoc-ref %build-inputs "libxtst")
|
| 402 | "/include/X11/extensions" ":"
|
| 403 | (assoc-ref %build-inputs "libxinerama")
|
| 404 | "/include/X11/extensions" ":"
|
| 405 | (or (getenv "CPATH") "")))
|
| 406 | (setenv "ALT_CUPS_HEADERS_PATH"
|
| 407 | (string-append (assoc-ref %build-inputs "cups")
|
| 408 | "/include"))
|
| 409 | (setenv "ALT_FREETYPE_HEADERS_PATH"
|
| 410 | (string-append (assoc-ref %build-inputs "freetype")
|
| 411 | "/include"))
|
| 412 | (setenv "ALT_FREETYPE_LIB_PATH"
|
| 413 | (string-append (assoc-ref %build-inputs "freetype")
|
| 414 | "/lib")))))
|
| 415 | (add-before 'check 'fix-test-framework
|
| 416 | (lambda _
|
| 417 | |
| 418 | (substitute* "src/jtreg/com/sun/javatest/regtest/Main.java"
|
| 419 | (("PATH=/bin:/usr/bin")
|
| 420 | (string-append "PATH=" (getenv "PATH"))))
|
| 421 | (substitute* "src/jtreg/com/sun/javatest/util/SysEnv.java"
|
| 422 | (("/usr/bin/env") (which "env")))
|
| 423 | #t))
|
| 424 | (add-before 'check 'fix-hotspot-tests
|
| 425 | (lambda _
|
| 426 | (with-directory-excursion "openjdk.src/hotspot/test/"
|
| 427 | (substitute* "jprt.config"
|
| 428 | (("PATH=\"\\$\\{path4sdk\\}\"")
|
| 429 | (string-append "PATH=" (getenv "PATH")))
|
| 430 | (("make=/usr/bin/make")
|
| 431 | (string-append "make=" (which "make"))))
|
| 432 | (substitute* '("runtime/6626217/Test6626217.sh"
|
| 433 | "runtime/7110720/Test7110720.sh")
|
| 434 | (("/bin/rm") (which "rm"))
|
| 435 | (("/bin/cp") (which "cp"))
|
| 436 | (("/bin/mv") (which "mv"))))
|
| 437 | #t))
|
| 438 | (add-before 'check 'fix-jdk-tests
|
| 439 | (lambda _
|
| 440 | (with-directory-excursion "openjdk.src/jdk/test/"
|
| 441 | (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
|
| 442 | (("/bin/pwd") (which "pwd")))
|
| 443 | (substitute* "com/sun/jdi/ShellScaffold.sh"
|
| 444 | (("/bin/kill") (which "kill")))
|
| 445 | (substitute* "start-Xvfb.sh"
|
| 446 | |
| 447 | (("/usr/bin/nohup") (which "nohup")))
|
| 448 | (substitute* "javax/security/auth/Subject/doAs/Test.sh"
|
| 449 | (("/bin/rm") (which "rm")))
|
| 450 | (substitute* "tools/launcher/MultipleJRE.sh"
|
| 451 | (("echo \"#!/bin/sh\"")
|
| 452 | (string-append "echo \"#!" (which "rm") "\""))
|
| 453 | (("/usr/bin/zip") (which "zip")))
|
| 454 | (substitute* "com/sun/jdi/OnThrowTest.java"
|
| 455 | (("#!/bin/sh") (string-append "#!" (which "sh"))))
|
| 456 | (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
|
| 457 | (("/usr/bin/uptime") (which "uptime")))
|
| 458 | (substitute* "java/lang/ProcessBuilder/Basic.java"
|
| 459 | (("/usr/bin/env") (which "env"))
|
| 460 | (("/bin/false") (which "false"))
|
| 461 | (("/bin/true") (which "true"))
|
| 462 | (("/bin/cp") (which "cp"))
|
| 463 | (("/bin/sh") (which "sh")))
|
| 464 | (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
|
| 465 | (("/bin/sh") (which "sh")))
|
| 466 | (substitute* "java/lang/ProcessBuilder/Zombies.java"
|
| 467 | (("/usr/bin/perl") (which "perl"))
|
| 468 | (("/bin/ps") (which "ps"))
|
| 469 | (("/bin/true") (which "true")))
|
| 470 | (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
|
| 471 | (("/usr/bin/tee") (which "tee")))
|
| 472 | (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
|
| 473 | (("/bin/true") (which "true")))
|
| 474 | (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
|
| 475 | (("/bin/cat") (which "cat")))
|
| 476 | (substitute* "java/lang/Runtime/exec/ExitValue.java"
|
| 477 | (("/bin/sh") (which "sh"))
|
| 478 | (("/bin/true") (which "true"))
|
| 479 | (("/bin/kill") (which "kill")))
|
| 480 | (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
|
| 481 | (("/usr/bin/echo") (which "echo")))
|
| 482 | (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
|
| 483 | (("/usr/bin/cat") (which "cat")))
|
| 484 | (substitute* "java/lang/Runtime/exec/SleepyCat.java"
|
| 485 | (("/bin/cat") (which "cat"))
|
| 486 | (("/bin/sleep") (which "sleep"))
|
| 487 | (("/bin/sh") (which "sh")))
|
| 488 | (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
|
| 489 | (("/bin/cat") (which "cat")))
|
| 490 | (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
|
| 491 | (("/bin/chmod") (which "chmod")))
|
| 492 | (substitute* "java/util/zip/ZipFile/Assortment.java"
|
| 493 | (("/bin/sh") (which "sh"))))
|
| 494 | #t))
|
| 495 | (replace 'check
|
| 496 | (lambda _
|
| 497 | |
| 498 | |
| 499 | |
| 500 | (use-modules (ice-9 rdelim))
|
| 501 | (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
|
| 502 | (checker (lambda (port)
|
| 503 | (let loop ()
|
| 504 | (let ((line (read-line port)))
|
| 505 | (cond
|
| 506 | ((eof-object? line) #t)
|
| 507 | ((regexp-exec error-pattern line) #f)
|
| 508 | (else (loop)))))))
|
| 509 | (run-test (lambda (test)
|
| 510 | (system* "make" test)
|
| 511 | (call-with-input-file
|
| 512 | (string-append "test/" test ".log")
|
| 513 | checker))))
|
| 514 | (or #t |
| 515 | (and (run-test "check-hotspot")
|
| 516 | (run-test "check-langtools")
|
| 517 | (run-test "check-jdk"))))))
|
| 518 | (replace 'install
|
| 519 | (lambda* (#:key outputs #:allow-other-keys)
|
| 520 | (let ((doc (string-append (assoc-ref outputs "doc")
|
| 521 | "/share/doc/icedtea"))
|
| 522 | (jre (assoc-ref outputs "out"))
|
| 523 | (jdk (assoc-ref outputs "jdk")))
|
| 524 | (copy-recursively "openjdk.build/docs" doc)
|
| 525 | (copy-recursively "openjdk.build/j2re-image" jre)
|
| 526 | (copy-recursively "openjdk.build/j2sdk-image" jdk))))
|
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | (add-after 'install 'install-keystore
|
| 532 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 533 | (let* ((keystore "cacerts")
|
| 534 | (certs-dir (string-append (assoc-ref inputs "nss-certs")
|
| 535 | "/etc/ssl/certs"))
|
| 536 | (keytool (string-append (assoc-ref outputs "jdk")
|
| 537 | "/bin/keytool")))
|
| 538 | (define (extract-cert file target)
|
| 539 | (call-with-input-file file
|
| 540 | (lambda (in)
|
| 541 | (call-with-output-file target
|
| 542 | (lambda (out)
|
| 543 | (let loop ((line (read-line in 'concat))
|
| 544 | (copying? #f))
|
| 545 | (cond
|
| 546 | ((eof-object? line) #t)
|
| 547 | ((string-prefix? "-----BEGIN" line)
|
| 548 | (display line out)
|
| 549 | (loop (read-line in 'concat) #t))
|
| 550 | ((string-prefix? "-----END" line)
|
| 551 | (display line out)
|
| 552 | #t)
|
| 553 | (else
|
| 554 | (when copying? (display line out))
|
| 555 | (loop (read-line in 'concat) copying?)))))))))
|
| 556 | (define (import-cert cert)
|
| 557 | (format #t "Importing certificate ~a\n" (basename cert))
|
| 558 | (let ((temp "tmpcert"))
|
| 559 | (extract-cert cert temp)
|
| 560 | (let ((port (open-pipe* OPEN_WRITE keytool
|
| 561 | "-import"
|
| 562 | "-alias" (basename cert)
|
| 563 | "-keystore" keystore
|
| 564 | "-storepass" "changeit"
|
| 565 | "-file" temp)))
|
| 566 | (display "yes\n" port)
|
| 567 | (when (not (zero? (status:exit-val (close-pipe port))))
|
| 568 | (error "failed to import" cert)))
|
| 569 | (delete-file temp)))
|
| 570 |
|
| 571 | |
| 572 | |
| 573 | (setlocale LC_ALL "en_US.utf8")
|
| 574 | (setenv "LC_ALL" "en_US.utf8")
|
| 575 |
|
| 576 | (for-each import-cert (find-files certs-dir "\\.pem$"))
|
| 577 | (mkdir-p (string-append (assoc-ref outputs "out")
|
| 578 | "/lib/security"))
|
| 579 | (mkdir-p (string-append (assoc-ref outputs "jdk")
|
| 580 | "/jre/lib/security"))
|
| 581 | (install-file keystore
|
| 582 | (string-append (assoc-ref outputs "out")
|
| 583 | "/lib/security"))
|
| 584 | (install-file keystore
|
| 585 | (string-append (assoc-ref outputs "jdk")
|
| 586 | "/jre/lib/security"))
|
| 587 | #t))))))
|
| 588 | (native-inputs
|
| 589 | `(("ant" ,ant)
|
| 590 | ("alsa-lib" ,alsa-lib)
|
| 591 | ("attr" ,attr)
|
| 592 | ("autoconf" ,autoconf)
|
| 593 | ("automake" ,automake)
|
| 594 | ("coreutils" ,coreutils)
|
| 595 | ("diffutils" ,diffutils) |
| 596 | ("gawk" ,gawk)
|
| 597 | ("grep" ,grep)
|
| 598 | ("libtool" ,libtool)
|
| 599 | ("pkg-config" ,pkg-config)
|
| 600 | ("cups" ,cups)
|
| 601 | ("wget" ,wget)
|
| 602 | ("which" ,which)
|
| 603 | ("cpio" ,cpio)
|
| 604 | ("zip" ,zip)
|
| 605 | ("unzip" ,unzip)
|
| 606 | ("fastjar" ,fastjar)
|
| 607 | ("libxslt" ,libxslt) |
| 608 | ("mit-krb5" ,mit-krb5)
|
| 609 | ("nss" ,nss)
|
| 610 | ("nss-certs" ,nss-certs)
|
| 611 | ("libx11" ,libx11)
|
| 612 | ("libxcomposite" ,libxcomposite)
|
| 613 | ("libxt" ,libxt)
|
| 614 | ("libxtst" ,libxtst)
|
| 615 | ("libxi" ,libxi)
|
| 616 | ("libxinerama" ,libxinerama)
|
| 617 | ("libxrender" ,libxrender)
|
| 618 | ("libjpeg" ,libjpeg)
|
| 619 | ("libpng" ,libpng)
|
| 620 | ("giflib" ,giflib)
|
| 621 | ("perl" ,perl)
|
| 622 | ("procps" ,procps) |
| 623 | ("openjdk6-src"
|
| 624 | ,(origin
|
| 625 | (method url-fetch)
|
| 626 | (uri "https://java.net/downloads/openjdk6/openjdk-6-src-b39-03_may_2016.tar.gz")
|
| 627 | (sha256
|
| 628 | (base32
|
| 629 | "1brxbsgwcj4js26y5lk6capc3pvghgjidvv9cavw6z8n7c7aw8af"))))
|
| 630 | ("lcms" ,lcms)
|
| 631 | ("zlib" ,zlib)
|
| 632 | ("gtk" ,gtk+-2)
|
| 633 | ("fontconfig" ,fontconfig)
|
| 634 | ("freetype" ,freetype)
|
| 635 | ("gcj" ,gcj)))
|
| 636 | (home-page "http://icedtea.classpath.org")
|
| 637 | (synopsis "Java development kit")
|
| 638 | (description
|
| 639 | "The OpenJDK built with the IcedTea build harness.")
|
| 640 | |
| 641 | |
| 642 | (license license:gpl2+)))
|
| 643 |
|
| 644 | (define-public icedtea-7
|
| 645 | (let* ((version "2.6.6")
|
| 646 | (drop (lambda (name hash)
|
| 647 | (origin
|
| 648 | (method url-fetch)
|
| 649 | (uri (string-append
|
| 650 | "http://icedtea.classpath.org/download/drops/"
|
| 651 | "/icedtea7/" version "/" name ".tar.bz2"))
|
| 652 | (sha256 (base32 hash))))))
|
| 653 | (package (inherit icedtea-6)
|
| 654 | (version version)
|
| 655 | (source (origin
|
| 656 | (method url-fetch)
|
| 657 | (uri (string-append
|
| 658 | "http://icedtea.wildebeest.org/download/source/icedtea-"
|
| 659 | version ".tar.xz"))
|
| 660 | (sha256
|
| 661 | (base32
|
| 662 | "0jjldnig382yqvzzsflilcz897v2lwnw4n57sggdjn318d29g53r"))
|
| 663 | (modules '((guix build utils)))
|
| 664 | (snippet
|
| 665 | '(substitute* "Makefile.in"
|
| 666 | |
| 667 | (("-o native-ecj")
|
| 668 | "-lgcj -o native-ecj")
|
| 669 | |
| 670 | (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
|
| 671 | "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
|
| 672 | (arguments
|
| 673 | `( |
| 674 | |
| 675 | |
| 676 | |
| 677 |
|
| 678 | |
| 679 | |
| 680 | |
| 681 | #:tests? #f
|
| 682 | |
| 683 | #:locale "C"
|
| 684 | ,@(substitute-keyword-arguments (package-arguments icedtea-6)
|
| 685 | ((#:modules modules)
|
| 686 | `((ice-9 match)
|
| 687 | (srfi srfi-26)
|
| 688 | ,@modules))
|
| 689 | ((#:configure-flags flags)
|
| 690 | |
| 691 | `(append '("--disable-system-pcsc"
|
| 692 | "--disable-system-sctp")
|
| 693 | ,flags))
|
| 694 | ((#:phases phases)
|
| 695 | `(modify-phases ,phases
|
| 696 | (replace 'unpack
|
| 697 | (lambda* (#:key source inputs #:allow-other-keys)
|
| 698 | (let ((target (string-append "icedtea-" ,version))
|
| 699 | (unpack (lambda* (name #:optional dir)
|
| 700 | (let ((dir (or dir
|
| 701 | (string-drop-right name 5))))
|
| 702 | (mkdir dir)
|
| 703 | (zero? (system* "tar" "xvf"
|
| 704 | (assoc-ref inputs name)
|
| 705 | "-C" dir
|
| 706 | "--strip-components=1"))))))
|
| 707 | (mkdir target)
|
| 708 | (and
|
| 709 | (zero? (system* "tar" "xvf" source
|
| 710 | "-C" target "--strip-components=1"))
|
| 711 | (chdir target)
|
| 712 | (unpack "openjdk-src" "openjdk.src")
|
| 713 | (with-directory-excursion "openjdk.src"
|
| 714 | (for-each unpack
|
| 715 | (filter (cut string-suffix? "-drop" <>)
|
| 716 | (map (match-lambda
|
| 717 | ((name . _) name))
|
| 718 | inputs))))
|
| 719 | #t))))
|
| 720 | (replace
|
| 721 | 'set-additional-paths
|
| 722 | (lambda* (#:key inputs #:allow-other-keys)
|
| 723 | (let ( |
| 724 | |
| 725 | (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
|
| 726 | (str (read-line port)))
|
| 727 | (close-pipe port)
|
| 728 | str)))
|
| 729 | (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
|
| 730 | (("ALSA_INCLUDE=/usr/include/alsa/version.h")
|
| 731 | (string-append "ALSA_INCLUDE="
|
| 732 | (assoc-ref inputs "alsa-lib")
|
| 733 | "/include/alsa/version.h")))
|
| 734 | (setenv "CC" "gcc")
|
| 735 | (setenv "CPATH"
|
| 736 | (string-append gcjinclude ":"
|
| 737 | (assoc-ref inputs "libxcomposite")
|
| 738 | "/include/X11/extensions" ":"
|
| 739 | (assoc-ref inputs "libxrender")
|
| 740 | "/include/X11/extensions" ":"
|
| 741 | (assoc-ref inputs "libxtst")
|
| 742 | "/include/X11/extensions" ":"
|
| 743 | (assoc-ref inputs "libxinerama")
|
| 744 | "/include/X11/extensions" ":"
|
| 745 | (or (getenv "CPATH") "")))
|
| 746 | (setenv "ALT_OBJCOPY" (which "objcopy"))
|
| 747 | (setenv "ALT_CUPS_HEADERS_PATH"
|
| 748 | (string-append (assoc-ref inputs "cups")
|
| 749 | "/include"))
|
| 750 | (setenv "ALT_FREETYPE_HEADERS_PATH"
|
| 751 | (string-append (assoc-ref inputs "freetype")
|
| 752 | "/include"))
|
| 753 | (setenv "ALT_FREETYPE_LIB_PATH"
|
| 754 | (string-append (assoc-ref inputs "freetype")
|
| 755 | "/lib")))))
|
| 756 | (add-after
|
| 757 | 'unpack 'fix-x11-extension-include-path
|
| 758 | (lambda* (#:key inputs #:allow-other-keys)
|
| 759 | (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
|
| 760 | (((string-append "\\$\\(firstword \\$\\(wildcard "
|
| 761 | "\\$\\(OPENWIN_HOME\\)"
|
| 762 | "/include/X11/extensions\\).*$"))
|
| 763 | (string-append (assoc-ref inputs "libxrender")
|
| 764 | "/include/X11/extensions"
|
| 765 | " -I" (assoc-ref inputs "libxtst")
|
| 766 | "/include/X11/extensions"
|
| 767 | " -I" (assoc-ref inputs "libxinerama")
|
| 768 | "/include/X11/extensions"))
|
| 769 | (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
|
| 770 | #t))
|
| 771 | (replace
|
| 772 | 'fix-test-framework
|
| 773 | (lambda _
|
| 774 | |
| 775 | (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
|
| 776 | (("PATH=/bin:/usr/bin")
|
| 777 | (string-append "PATH=" (getenv "PATH"))))
|
| 778 | (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
|
| 779 | (("/usr/bin/env") (which "env")))
|
| 780 | (substitute* "openjdk.src/hotspot/test/test_env.sh"
|
| 781 | (("/bin/rm") (which "rm"))
|
| 782 | (("/bin/cp") (which "cp"))
|
| 783 | (("/bin/mv") (which "mv")))
|
| 784 | #t))
|
| 785 | (delete 'patch-patches))))))
|
| 786 | (native-inputs
|
| 787 | `(("openjdk-src"
|
| 788 | ,(drop "openjdk"
|
| 789 | "1wxd5kbsmd4gdiz78iq7pq9hp0l6m946pd1pvaj750lkrgk17y14"))
|
| 790 | ("corba-drop"
|
| 791 | ,(drop "corba"
|
| 792 | "0bba7drdpbggzgn7cnqv10myxa3bygaq2hkclgrmsijhl6bnr26f"))
|
| 793 | ("jaxp-drop"
|
| 794 | ,(drop "jaxp"
|
| 795 | "0c1d4yjaxzh9fi9bx50yi2psb9f475bfivivf6c31smgaihb97k7"))
|
| 796 | ("jaxws-drop"
|
| 797 | ,(drop "jaxws"
|
| 798 | "0662wzws45jwzwfc4pgizxdywz737vflkj9w3hw1xlgljs017bzr"))
|
| 799 | ("jdk-drop"
|
| 800 | ,(drop "jdk"
|
| 801 | "17qaf5mdijsn6jzyxv7rgn9g5mazkva6p8lcy7zq06yvfb595ahv"))
|
| 802 | ("langtools-drop"
|
| 803 | ,(drop "langtools"
|
| 804 | "1wv34cyba1f4wynjkwf765agf4ifc04717ac7b3bpiagggp2rfsl"))
|
| 805 | ("hotspot-drop"
|
| 806 | ,(drop "hotspot"
|
| 807 | "1hhd5q2g7mnw3pqqv72labki5zv09vgc3hp3xig4x8r4yzzg9s54"))
|
| 808 | ,@(fold alist-delete (package-native-inputs icedtea-6)
|
| 809 | '("openjdk6-src"))))
|
| 810 | (inputs
|
| 811 | `(("libxcomposite" ,libxcomposite)
|
| 812 | ,@(package-inputs icedtea-6))))))
|
| 813 |
|
| 814 | (define-public icedtea-8
|
| 815 | (let* ((version "3.0.1")
|
| 816 | (drop (lambda (name hash)
|
| 817 | (origin
|
| 818 | (method url-fetch)
|
| 819 | (uri (string-append
|
| 820 | "http://icedtea.classpath.org/download/drops/"
|
| 821 | "/icedtea8/" version "/" name ".tar.xz"))
|
| 822 | (sha256 (base32 hash))))))
|
| 823 | (package (inherit icedtea-7)
|
| 824 | (version "3.0.1")
|
| 825 | (source (origin
|
| 826 | (method url-fetch)
|
| 827 | (uri (string-append
|
| 828 | "http://icedtea.wildebeest.org/download/source/icedtea-"
|
| 829 | version ".tar.xz"))
|
| 830 | (sha256
|
| 831 | (base32
|
| 832 | "1wislw090zx955rf9sppimdzqf044mpj96xp54vljv6yw46y6v1l"))
|
| 833 | (modules '((guix build utils)))
|
| 834 | (snippet
|
| 835 | '(substitute* "Makefile.am"
|
| 836 | |
| 837 | (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
|
| 838 | "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
|
| 839 | (arguments
|
| 840 | (substitute-keyword-arguments (package-arguments icedtea-7)
|
| 841 | ((#:configure-flags flags)
|
| 842 | `(let ((jdk (assoc-ref %build-inputs "jdk")))
|
| 843 | `( |
| 844 | "--enable-bootstrap"
|
| 845 | "--enable-nss"
|
| 846 | "--disable-downloading"
|
| 847 | "--disable-tests" |
| 848 | "--with-openjdk-src-dir=./openjdk.src"
|
| 849 | ,(string-append "--with-jdk-home=" jdk))))
|
| 850 | ((#:phases phases)
|
| 851 | `(modify-phases ,phases
|
| 852 | (delete 'fix-x11-extension-include-path)
|
| 853 | (delete 'patch-paths)
|
| 854 | (delete 'set-additional-paths)
|
| 855 | (delete 'patch-patches)
|
| 856 | |
| 857 | |
| 858 | (delete 'install-keystore)
|
| 859 | (replace 'install
|
| 860 | (lambda* (#:key outputs #:allow-other-keys)
|
| 861 | (let ((doc (string-append (assoc-ref outputs "doc")
|
| 862 | "/share/doc/icedtea"))
|
| 863 | (jre (assoc-ref outputs "out"))
|
| 864 | (jdk (assoc-ref outputs "jdk")))
|
| 865 | (copy-recursively "openjdk.build/docs" doc)
|
| 866 | (copy-recursively "openjdk.build/images/j2re-image" jre)
|
| 867 | (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
|
| 868 | #t)))))))
|
| 869 | (native-inputs
|
| 870 | `(("jdk" ,icedtea-7 "jdk")
|
| 871 | ("openjdk-src"
|
| 872 | ,(drop "openjdk"
|
| 873 | "1141wfz6vz889f5naj7zdbyw42ibw0ixvkd808lfcrwxlgznyxlb"))
|
| 874 | ("corba-drop"
|
| 875 | ,(drop "corba"
|
| 876 | "0l3fmfw88hf8709z033az1x6wzmcb0jnakj2br1r721zw01i0da2"))
|
| 877 | ("jaxp-drop"
|
| 878 | ,(drop "jaxp"
|
| 879 | "1i1pvyrdkk3w8vcnk6kfcbsjkfpbbrcywiypdl39bf2ishixbaf0"))
|
| 880 | ("jaxws-drop"
|
| 881 | ,(drop "jaxws"
|
| 882 | "0f1kglci65zsfy8ygw5w2zza7v1280znihvls4kraz06dgsc2y73"))
|
| 883 | ("jdk-drop"
|
| 884 | ,(drop "jdk"
|
| 885 | "1pcwb1kjd1ph4jbv07icgk0fb8jqnck2y24qjfd7dzg7gm45c1am"))
|
| 886 | ("langtools-drop"
|
| 887 | ,(drop "langtools"
|
| 888 | "1jjil9s244wp0blj1qkzk7sy7y1jrxb4wq18c1rj2q2pa88n00i6"))
|
| 889 | ("hotspot-drop"
|
| 890 | ,(drop "hotspot"
|
| 891 | "1pl0cz1gja6z5zbywni1x1pj4qkh745fpj55fcmj4lpfj2p98my1"))
|
| 892 | ("nashorn-drop"
|
| 893 | ,(drop "nashorn"
|
| 894 | "1p0ynm2caraq1sal38qrrf42yah7j14c9vfwdv6h5h4rliahs177"))
|
| 895 | ,@(fold alist-delete (package-native-inputs icedtea-7)
|
| 896 | '("gcj" "openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
|
| 897 | "jdk-drop" "langtools-drop" "hotspot-drop")))))))
|
| 898 |
|
| 899 | (define-public icedtea icedtea-7)
|
| 900 |
|
| 901 | (define-public java-xz
|
| 902 | (package
|
| 903 | (name "java-xz")
|
| 904 | (version "1.5")
|
| 905 | (source (origin
|
| 906 | (method url-fetch)
|
| 907 | (uri (string-append "http://tukaani.org/xz/xz-java-" version ".zip"))
|
| 908 | (sha256
|
| 909 | (base32
|
| 910 | "0x6vn9dp9kxk83x2fp3394n95dk8fx9yg8jns9371iqsn0vy8ih1"))))
|
| 911 | (build-system ant-build-system)
|
| 912 | (arguments
|
| 913 | `(#:tests? #f |
| 914 | #:jar-name ,(string-append "xz-" version ".jar")
|
| 915 | #:phases
|
| 916 | (modify-phases %standard-phases
|
| 917 | |
| 918 | (add-after 'unpack 'chdir
|
| 919 | (lambda _ (chdir "..") #t)))))
|
| 920 | (native-inputs
|
| 921 | `(("unzip" ,unzip)))
|
| 922 | (home-page "http://tukaani.org/xz/java.html")
|
| 923 | (synopsis "Implementation of XZ data compression in pure Java")
|
| 924 | (description "This library aims to be a complete implementation of XZ data
|
| 925 | compression in pure Java. Single-threaded streamed compression and
|
| 926 | decompression and random access decompression have been fully implemented.")
|
| 927 | (license license:public-domain)))
|
| 928 |
|
| 929 | |
| 930 | |
| 931 | (define-public java-qdox-1.12
|
| 932 | (package
|
| 933 | (name "java-qdox")
|
| 934 | (version "1.12.1")
|
| 935 | (source (origin
|
| 936 | (method url-fetch)
|
| 937 | (uri (string-append "http://central.maven.org/maven2/"
|
| 938 | "com/thoughtworks/qdox/qdox/" version
|
| 939 | "/qdox-" version "-sources.jar"))
|
| 940 | (sha256
|
| 941 | (base32
|
| 942 | "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
|
| 943 | (build-system ant-build-system)
|
| 944 | (arguments
|
| 945 | `( |
| 946 | #:tests? #f
|
| 947 | #:jar-name "qdox.jar"
|
| 948 | #:phases
|
| 949 | (modify-phases %standard-phases
|
| 950 | (replace 'unpack
|
| 951 | (lambda* (#:key source #:allow-other-keys)
|
| 952 | (mkdir "src")
|
| 953 | (with-directory-excursion "src"
|
| 954 | (zero? (system* "jar" "-xf" source)))))
|
| 955 | |
| 956 | |
| 957 | (add-after 'unpack 'delete-tests
|
| 958 | (lambda _
|
| 959 | (delete-file-recursively "src/com/thoughtworks/qdox/junit")
|
| 960 | #t)))))
|
| 961 | (home-page "http://qdox.codehaus.org/")
|
| 962 | (synopsis "Parse definitions from Java source files")
|
| 963 | (description
|
| 964 | "QDox is a high speed, small footprint parser for extracting
|
| 965 | class/interface/method definitions from source files complete with JavaDoc
|
| 966 | @code{@@tags}. It is designed to be used by active code generators or
|
| 967 | documentation tools.")
|
| 968 | (license license:asl2.0)))
|
| 969 |
|
| 970 | (define-public java-jarjar
|
| 971 | (package
|
| 972 | (name "java-jarjar")
|
| 973 | (version "1.4")
|
| 974 | (source (origin
|
| 975 | (method url-fetch)
|
| 976 | (uri (string-append
|
| 977 | "https://storage.googleapis.com/google-code-archive-downloads/v2/"
|
| 978 | "code.google.com/jarjar/jarjar-src-" version ".zip"))
|
| 979 | (sha256
|
| 980 | (base32
|
| 981 | "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))))
|
| 982 | (build-system ant-build-system)
|
| 983 | (arguments
|
| 984 | `( |
| 985 | #:tests? #f
|
| 986 | #:build-target "jar"
|
| 987 | #:phases
|
| 988 | (modify-phases %standard-phases
|
| 989 | (replace 'install
|
| 990 | (lambda* (#:key outputs #:allow-other-keys)
|
| 991 | (let ((target (string-append (assoc-ref outputs "out")
|
| 992 | "/share/java")))
|
| 993 | (install-file (string-append "dist/jarjar-" ,version ".jar")
|
| 994 | target))
|
| 995 | #t)))))
|
| 996 | (native-inputs
|
| 997 | `(("unzip" ,unzip)))
|
| 998 | (home-page "https://code.google.com/archive/p/jarjar/")
|
| 999 | (synopsis "Repackage Java libraries")
|
| 1000 | (description
|
| 1001 | "Jar Jar Links is a utility that makes it easy to repackage Java
|
| 1002 | libraries and embed them into your own distribution. Jar Jar Links includes
|
| 1003 | an Ant task that extends the built-in @code{jar} task.")
|
| 1004 | (license license:asl2.0)))
|
| 1005 |
|
| 1006 | (define-public java-hamcrest-core
|
| 1007 | (package
|
| 1008 | (name "java-hamcrest-core")
|
| 1009 | (version "1.3")
|
| 1010 | (source (origin
|
| 1011 | (method url-fetch)
|
| 1012 | (uri (string-append "https://hamcrest.googlecode.com/files/"
|
| 1013 | "hamcrest-" version ".tgz"))
|
| 1014 | (sha256
|
| 1015 | (base32
|
| 1016 | "1hi0jv0zrgsf4l25aizxrgvxpsrmdklsmvw0jzwz7zv9s108whn6"))
|
| 1017 | (modules '((guix build utils)))
|
| 1018 | (snippet
|
| 1019 | '(begin
|
| 1020 | |
| 1021 | (for-each delete-file (find-files "." "\\.jar$"))
|
| 1022 | #t))))
|
| 1023 | (build-system ant-build-system)
|
| 1024 | (arguments
|
| 1025 | `(#:tests? #f |
| 1026 | #:make-flags (list (string-append "-Dversion=" ,version))
|
| 1027 | #:build-target "core"
|
| 1028 | #:phases
|
| 1029 | (modify-phases %standard-phases
|
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | (add-before 'configure 'patch-build.xml
|
| 1034 | (lambda _
|
| 1035 | (substitute* "build.xml"
|
| 1036 | (("unit-test, ") "")
|
| 1037 | (("\\$\\{build.timestamp\\}") "guix"))
|
| 1038 | #t))
|
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | (add-after 'unpack 'make-method-order-deterministic
|
| 1043 | (lambda _
|
| 1044 | (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
|
| 1045 | (("import java\\.util\\.Iterator;" line)
|
| 1046 | (string-append line "\n"
|
| 1047 | "import java.util.Arrays; import java.util.Comparator;"))
|
| 1048 | (("allMethods = cls\\.getMethods\\(\\);" line)
|
| 1049 | (string-append "_" line
|
| 1050 | "
|
| 1051 | private Method[] getSortedMethods() {
|
| 1052 | Arrays.sort(_allMethods, new Comparator<Method>() {
|
| 1053 | @Override
|
| 1054 | public int compare(Method a, Method b) {
|
| 1055 | return a.toString().compareTo(b.toString());
|
| 1056 | }
|
| 1057 | });
|
| 1058 | return _allMethods;
|
| 1059 | }
|
| 1060 |
|
| 1061 | private Method[] allMethods = getSortedMethods();")))))
|
| 1062 | (add-before 'build 'do-not-use-bundled-qdox
|
| 1063 | (lambda* (#:key inputs #:allow-other-keys)
|
| 1064 | (substitute* "build.xml"
|
| 1065 | (("lib/generator/qdox-1.12.jar")
|
| 1066 | (string-append (assoc-ref inputs "java-qdox-1.12")
|
| 1067 | "/share/java/qdox.jar")))
|
| 1068 | #t))
|
| 1069 | (replace 'install
|
| 1070 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1071 | (install-file (string-append "build/hamcrest-core-"
|
| 1072 | ,version ".jar")
|
| 1073 | (string-append (assoc-ref outputs "out")
|
| 1074 | "/share/java")))))))
|
| 1075 | (native-inputs
|
| 1076 | `(("java-qdox-1.12" ,java-qdox-1.12)
|
| 1077 | ("java-jarjar" ,java-jarjar)))
|
| 1078 | (home-page "http://hamcrest.org/")
|
| 1079 | (synopsis "Library of matchers for building test expressions")
|
| 1080 | (description
|
| 1081 | "This package provides a library of matcher objects (also known as
|
| 1082 | constraints or predicates) allowing @code{match} rules to be defined
|
| 1083 | declaratively, to be used in other frameworks. Typical scenarios include
|
| 1084 | testing frameworks, mocking libraries and UI validation rules.")
|
| 1085 | (license license:bsd-2)))
|
| 1086 |
|
| 1087 | (define-public java-junit
|
| 1088 | (package
|
| 1089 | (name "java-junit")
|
| 1090 | (version "4.12")
|
| 1091 | (source (origin
|
| 1092 | (method url-fetch)
|
| 1093 | (uri (string-append "https://github.com/junit-team/junit/"
|
| 1094 | "archive/r" version ".tar.gz"))
|
| 1095 | (file-name (string-append name "-" version ".tar.gz"))
|
| 1096 | (sha256
|
| 1097 | (base32
|
| 1098 | "090dn5v1vs0b3acyaqc0gjf6p8lmd2h24wfzsbq7sly6b214anws"))
|
| 1099 | (modules '((guix build utils)))
|
| 1100 | (snippet
|
| 1101 | '(begin
|
| 1102 | |
| 1103 | (delete-file-recursively "lib")
|
| 1104 | #t))))
|
| 1105 | (build-system ant-build-system)
|
| 1106 | (arguments
|
| 1107 | `(#:tests? #f |
| 1108 | #:jar-name "junit.jar"))
|
| 1109 | (inputs
|
| 1110 | `(("java-hamcrest-core" ,java-hamcrest-core)))
|
| 1111 | (home-page "http://junit.org/")
|
| 1112 | (synopsis "Test framework for Java")
|
| 1113 | (description
|
| 1114 | "JUnit is a simple framework to write repeatable tests for Java projects.
|
| 1115 | JUnit provides assertions for testing expected results, test fixtures for
|
| 1116 | sharing common test data, and test runners for running tests.")
|
| 1117 | (license license:epl1.0)))
|