1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (gnu packages java)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix utils)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages attr)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages cpio)
31 #:use-module (gnu packages cups)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages fontutils)
34 #:use-module (gnu packages gawk)
35 #:use-module (gnu packages gcc)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages gnuzilla) ;nss
38 #:use-module (gnu packages ghostscript) ;lcms
39 #:use-module (gnu packages gnome)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages linux) ;alsa
43 #:use-module (gnu packages wget)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages mit-krb5)
47 #:use-module (gnu packages xml)
48 #:use-module (gnu packages xorg)
49 #:use-module (gnu packages zip)
50 #:use-module (gnu packages texinfo)
51 #:use-module ((srfi srfi-1) #:select (fold alist-delete)))
60 "http://ftp-stud.fht-esslingen.de/pub/Mirrors/"
61 "eclipse/eclipse/downloads/drops4/R-" version
62 "-201502041700/swt-" version "-gtk-linux-x86.zip"))
65 "0lzyqr8k2zm5s8fmnrx5kxpslxfs0i73y26fwfms483x45izzwj8"))))
66 (build-system gnu-build-system)
68 `(#:make-flags '("-f" "make_linux.mak")
69 #:tests? #f ; no "check" target
75 (zero? (system* "unzip" (assoc-ref %build-inputs "source") "-d" "swt"))
78 (zero? (system* "unzip" "src.zip" "-d" "src"))
82 (lambda* (#:key inputs outputs #:allow-other-keys)
83 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
84 (setenv "JAVA_HOME" (assoc-ref inputs "icedtea6"))
86 ;; Build shared libraries. Users of SWT have to set the system
87 ;; property swt.library.path to the "lib" directory of this
90 (setenv "OUTPUT_DIR" lib)
91 (zero? (system* "bash" "build.sh"))
95 (for-each (lambda (file)
96 (format #t "Compiling ~s\n" file)
97 (system* "javac" "-d" "build" file))
98 (find-files "." "\\.java"))
99 (zero? (system* "jar" "cvf" "swt.jar" "-C" "build" "."))))
101 'install 'install-java-files
102 (lambda* (#:key outputs #:allow-other-keys)
103 (let ((java (string-append (assoc-ref outputs "out")
106 (copy-file "swt.jar" (string-append java "/swt.jar"))) #t)
107 (alist-delete 'configure %standard-phases))))))
109 `(("xulrunner" ,icecat)
116 `(("pkg-config" ,pkg-config)
118 ("icedtea6" ,icedtea6 "jdk")))
119 (home-page "https://www.eclipse.org/swt/")
120 (synopsis "Widget toolkit for Java")
122 "SWT is a widget toolkit for Java designed to provide efficient, portable
123 access to the user-interface facilities of the operating systems on which it
125 ;; SWT code is licensed under EPL1.0
126 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
127 ;; Cairo bindings contain code under MPL1.1
128 ;; XULRunner 1.9 bindings contain code under MPL2.0
142 "https://www.apache.org/dist/ant/source/apache-ant-"
143 version "-src.tar.gz"))
146 "09kf5s1ir0rdrclsy174bsvbdcbajza9fja490w4mmvcpkw3zpak"))))
147 (build-system gnu-build-system)
149 `(#:tests? #f ; no "check" target
152 'unpack 'remove-scripts
153 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
156 (for-each delete-file
157 (find-files "src/script"
158 "(.*\\.(bat|cmd)|runant.*|antRun.*)")))
163 (assoc-ref %build-inputs "icedtea6"))
164 ;; Disable tests to avoid dependency on hamcrest-core, which needs
165 ;; Ant to build. This is necessary in addition to disabling the
166 ;; "check" phase, because the dependency on "test-jar" would always
167 ;; result in the tests to be run.
168 (substitute* "build.xml"
169 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
170 (zero? (system* "bash" "bootstrap.sh"
171 (string-append "-Ddist.dir="
172 (assoc-ref %outputs "out")))))
175 (alist-delete 'install %standard-phases))))))
177 `(("icedtea6" ,icedtea6 "jdk")))
178 (home-page "http://ant.apache.org")
179 (synopsis "Build tool for Java")
181 "Ant is a platform-independent build tool for Java. It is similar to
182 make but is implemented using the Java language, requires the Java platform,
183 and is best suited to building Java projects. Ant uses XML to describe the
184 build process and its dependencies, whereas Make uses Makefile format.")
185 (license license:asl2.0)))
187 (define-public icedtea6
194 "http://icedtea.wildebeest.org/download/source/icedtea6-"
198 "0fqq898h0mk554mya5z4j9p4x6sg2qj0ckqzx65x49zcjjp69jm5"))
199 (modules '((guix build utils)))
201 '(substitute* "Makefile.in"
202 ;; link against libgcj to avoid linker error
204 "-lgcj -o native-ecj")
205 ;; do not leak information about the build host
206 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
207 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
208 (build-system gnu-build-system)
209 (outputs '("out" ; Java Runtime Environment
210 "jdk" ; Java Development Kit
211 "doc")) ; all documentation
213 `(;; There are many failing tests and many are known to fail upstream.
215 ;; * Hotspot VM tests:
216 ;; FAILED: compiler/7082949/Test7082949.java
217 ;; FAILED: compiler/7088020/Test7088020.java
218 ;; FAILED: runtime/6929067/Test6929067.sh
219 ;; FAILED: serviceability/sa/jmap-hashcode/Test8028623.java
220 ;; => Test results: passed: 161; failed: 4
222 ;; * langtools tests:
223 ;; FAILED: com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
224 ;; FAILED: tools/javac/6627362/T6627362.java
225 ;; FAILED: tools/javac/7003595/T7003595.java
226 ;; FAILED: tools/javac/7024568/T7024568.java
227 ;; FAILED: tools/javap/4111861/T4111861.java
228 ;; FAILED: tools/javap/ListTest.java
229 ;; FAILED: tools/javap/OptionTest.java
230 ;; FAILED: tools/javap/T4884240.java
231 ;; FAILED: tools/javap/T4975569.java
232 ;; --> fails because of insignificant whitespace differences
233 ;; in output of javap
234 ;; FAILED: tools/javap/T6868539.java
235 ;; => Test results: passed: 1,445; failed: 10
238 ;; Tests are incomplete because of a segfault after this test:
239 ;; javax/crypto/spec/RC5ParameterSpec/RC5ParameterSpecEquals.java
240 ;; A bug report has already been filed upstream:
241 ;; http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2188
243 ;; The tests require xvfb-run, a wrapper script around Xvfb, which
244 ;; has not been packaged yet. Without it many AWT tests fail, so I
245 ;; made no attempts to make a list of failing JDK tests. At least
246 ;; 222 tests are failing of which at least 132 are AWT tests.
249 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
250 ;; gremlin) doesn't support it yet, so skip this phase.
251 #:validate-runpath? #f
253 #:modules ((guix build utils)
254 (guix build gnu-build-system)
259 (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
260 (ecj (string-append gcjdir "/share/java/ecj.jar"))
261 (jdk (string-append gcjdir "/lib/jvm/"))
262 (gcj (string-append gcjdir "/bin/gcj")))
263 `("--enable-bootstrap"
266 "--disable-downloading"
267 "--disable-tests" ;they are run in the check phase instead
268 ,(string-append "--with-openjdk-src-dir=" "./openjdk")
269 ,(string-append "--with-javac=" jdk "/bin/javac")
270 ,(string-append "--with-ecj-jar=" ecj)
271 ,(string-append "--with-gcj=" gcj)
272 ,(string-append "--with-jdk-home=" jdk)
273 ,(string-append "--with-java=" jdk "/bin/java")))
277 (lambda* (#:key source inputs #:allow-other-keys)
278 (and (zero? (system* "tar" "xvf" source))
279 (zero? (system* "tar" "xvjf"
280 (assoc-ref inputs "ant-bootstrap")))
282 (patch-shebang "apache-ant-1.9.4/bin/ant")
283 (chdir (string-append ,name "-" ,version))
285 (with-directory-excursion "openjdk"
286 (copy-file (assoc-ref inputs "openjdk6-src")
287 "openjdk6-src.tar.xz")
288 (zero? (system* "tar" "xvf" "openjdk6-src.tar.xz"))))))
290 'unpack 'patch-patches
292 ;; shebang in patches so that they apply cleanly
293 (substitute* '("patches/jtreg-jrunscript.patch"
294 "patches/hotspot/hs23/drop_unlicensed_test.patch")
295 (("#!/bin/sh") (string-append "#!" (which "sh"))))
297 ;; fix path to alsa header in patch
298 (substitute* "patches/openjdk/6799141-split_out_versions.patch"
299 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
300 (string-append "ALSA_INCLUDE="
301 (assoc-ref %build-inputs "alsa-lib")
302 "/include/alsa/version.h"))))
306 ;; buildtree.make generates shell scripts, so we need to replace
307 ;; the generated shebang
308 (substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make")
309 (("/bin/sh") (which "bash")))
311 (let ((corebin (string-append
312 (assoc-ref %build-inputs "coreutils") "/bin/"))
313 (binbin (string-append
314 (assoc-ref %build-inputs "binutils") "/bin/"))
315 (grepbin (string-append
316 (assoc-ref %build-inputs "grep") "/bin/")))
317 (substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk"
318 "openjdk/corba/make/common/shared/Defs-linux.gmk")
319 (("UNIXCOMMAND_PATH = /bin/")
320 (string-append "UNIXCOMMAND_PATH = " corebin))
321 (("USRBIN_PATH = /usr/bin/")
322 (string-append "USRBIN_PATH = " corebin))
323 (("DEVTOOLS_PATH *= */usr/bin/")
324 (string-append "DEVTOOLS_PATH = " corebin))
325 (("COMPILER_PATH *= */usr/bin/")
326 (string-append "COMPILER_PATH = "
327 (assoc-ref %build-inputs "gcc") "/bin/"))
328 (("DEF_OBJCOPY *=.*objcopy")
329 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
331 ;; fix hard-coded utility paths
332 (substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk"
333 "openjdk/corba/make/common/shared/Defs-utils.gmk")
335 (string-append "ECHO = " (which "echo")))
337 (string-append "GREP = " (which "grep")))
339 (string-append "EGREP = " (which "egrep")))
341 (string-append "CPIO = " (which "cpio")))
342 (("READELF *=.*readelf")
343 (string-append "READELF = " (which "readelf")))
345 (string-append "AR = " (which "ar")))
347 (string-append "TAR = " (which "tar")))
349 (string-append "AS = " (which "as")))
351 (string-append "LD = " (which "ld")))
353 (string-append "STRIP = " (which "strip")))
355 (string-append "NM = " (which "nm")))
357 (string-append "SH = " (which "bash")))
359 (string-append "FIND = " (which "find")))
361 (string-append "LDD = " (which "ldd")))
362 (("NAWK *=.*(n|g)awk")
363 (string-append "NAWK = " (which "gawk")))
365 (string-append "XARGS = " (which "xargs")))
367 (string-append "UNZIP = " (which "unzip")))
369 (string-append "ZIPEXE = " (which "zip")))
371 (string-append "SED = " (which "sed"))))
373 ;; Some of these timestamps cause problems as they are more than
374 ;; 10 years ago, failing the build process.
376 "openjdk/jdk/src/share/classes/java/util/CurrencyData.properties"
377 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
378 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
379 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
380 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))))
382 'configure 'set-additional-paths
383 (lambda* (#:key inputs #:allow-other-keys)
384 (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
385 (gcjlib (string-append gcjdir "/lib"))
386 (antpath (string-append (getcwd) "/../apache-ant-1.9.4"))
387 ;; Get target-specific include directory so that
388 ;; libgcj-config.h is found when compiling hotspot.
389 (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
390 (str (read-line port)))
394 (string-append gcjinclude ":"
395 (assoc-ref %build-inputs "libxrender")
396 "/include/X11/extensions" ":"
397 (assoc-ref %build-inputs "libxtst")
398 "/include/X11/extensions" ":"
399 (assoc-ref %build-inputs "libxinerama")
400 "/include/X11/extensions" ":"
401 (or (getenv "CPATH") "")))
402 (setenv "ALT_CUPS_HEADERS_PATH"
403 (string-append (assoc-ref %build-inputs "cups")
405 (setenv "ALT_FREETYPE_HEADERS_PATH"
406 (string-append (assoc-ref %build-inputs "freetype")
408 (setenv "ALT_FREETYPE_LIB_PATH"
409 (string-append (assoc-ref %build-inputs "freetype")
411 (setenv "PATH" (string-append antpath "/bin:"
414 'check 'fix-test-framework
416 ;; Fix PATH in test environment
417 (substitute* "src/jtreg/com/sun/javatest/regtest/Main.java"
418 (("PATH=/bin:/usr/bin")
419 (string-append "PATH=" (getenv "PATH"))))
420 (substitute* "src/jtreg/com/sun/javatest/util/SysEnv.java"
421 (("/usr/bin/env") (which "env")))
424 'check 'fix-hotspot-tests
426 (with-directory-excursion "openjdk/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"))))
439 'check 'fix-jdk-tests
441 (with-directory-excursion "openjdk/jdk/test/"
442 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
443 (("/bin/pwd") (which "pwd")))
444 (substitute* "com/sun/jdi/ShellScaffold.sh"
445 (("/bin/kill") (which "kill")))
446 (substitute* "start-Xvfb.sh"
447 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
448 (("/usr/bin/nohup") (which "nohup")))
449 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
450 (("/bin/rm") (which "rm")))
451 (substitute* "tools/launcher/MultipleJRE.sh"
452 (("echo \"#!/bin/sh\"")
453 (string-append "echo \"#!" (which "rm") "\""))
454 (("/usr/bin/zip") (which "zip")))
455 (substitute* "com/sun/jdi/OnThrowTest.java"
456 (("#!/bin/sh") (string-append "#!" (which "sh"))))
457 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
458 (("/usr/bin/uptime") (which "uptime")))
459 (substitute* "java/lang/ProcessBuilder/Basic.java"
460 (("/usr/bin/env") (which "env"))
461 (("/bin/false") (which "false"))
462 (("/bin/true") (which "true"))
463 (("/bin/cp") (which "cp"))
464 (("/bin/sh") (which "sh")))
465 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
466 (("/bin/sh") (which "sh")))
467 (substitute* "java/lang/ProcessBuilder/Zombies.java"
468 (("/usr/bin/perl") (which "perl"))
469 (("/bin/ps") (which "ps"))
470 (("/bin/true") (which "true")))
471 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
472 (("/usr/bin/tee") (which "tee")))
473 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
474 (("/bin/true") (which "true")))
475 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
476 (("/bin/cat") (which "cat")))
477 (substitute* "java/lang/Runtime/exec/ExitValue.java"
478 (("/bin/sh") (which "sh"))
479 (("/bin/true") (which "true"))
480 (("/bin/kill") (which "kill")))
481 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
482 (("/usr/bin/echo") (which "echo")))
483 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
484 (("/usr/bin/cat") (which "cat")))
485 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
486 (("/bin/cat") (which "cat"))
487 (("/bin/sleep") (which "sleep"))
488 (("/bin/sh") (which "sh")))
489 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
490 (("/bin/cat") (which "cat")))
491 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
492 (("/bin/chmod") (which "chmod")))
493 (substitute* "java/util/zip/ZipFile/Assortment.java"
494 (("/bin/sh") (which "sh"))))
499 ;; The "make check-*" targets always return zero, so we need to
500 ;; check for errors in the associated log files to determine
501 ;; whether any tests have failed.
502 (use-modules (ice-9 rdelim))
503 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
504 (checker (lambda (port)
506 (let ((line (read-line port)))
508 ((eof-object? line) #t)
509 ((regexp-exec error-pattern line) #f)
511 (run-test (lambda (test)
512 (system* "make" test)
513 (call-with-input-file
514 (string-append "test/" test ".log")
517 (and (run-test "check-hotspot")
518 (run-test "check-langtools")
519 (run-test "check-jdk")))))
522 (lambda* (#:key outputs #:allow-other-keys)
523 (let ((doc (string-append (assoc-ref outputs "doc") "/share/doc/" ,name))
524 (jre (assoc-ref outputs "out"))
525 (jdk (assoc-ref outputs "jdk")))
526 (copy-recursively "openjdk.build/docs" doc)
527 (copy-recursively "openjdk.build/j2re-image" jre)
528 (copy-recursively "openjdk.build/j2sdk-image" jdk)))
529 %standard-phases)))))))))))
534 (uri "https://www.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.tar.bz2")
537 "1kw801p8h5x4f0g8i5yknppssrj5a3xy1aqrkpfnk22bd1snbh90"))))
538 ("alsa-lib" ,alsa-lib)
540 ("autoconf" ,autoconf)
541 ("automake" ,automake)
542 ("coreutils" ,coreutils)
543 ("diffutils" ,diffutils) ;for tests
547 ("pkg-config" ,pkg-config)
555 ("libxslt" ,libxslt) ;for xsltproc
556 ("mit-krb5" ,mit-krb5)
562 ("libxinerama" ,libxinerama)
563 ("libxrender" ,libxrender)
568 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
572 (uri "https://java.net/downloads/openjdk6/openjdk-6-src-b35-14_apr_2015.tar.gz")
575 "05glw29vy4yw9rkjy9y8wg6ybzi89gjwi19qpnfda978x02r2x5p"))))
579 ("fontconfig" ,fontconfig)
580 ("freetype" ,freetype)
582 (home-page "http://icedtea.classpath.org")
583 (synopsis "Java development kit")
585 "The OpenJDK built with the IcedTea build harness.")
586 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
587 ;; same license as both GNU Classpath and OpenJDK.
588 (license license:gpl2+)))
590 (define-public icedtea7
591 (let* ((version "2.5.5")
592 (drop (lambda (name hash)
596 "http://icedtea.classpath.org/download/drops/"
597 "/icedtea7/" version "/" name ".tar.bz2"))
598 (sha256 (base32 hash))))))
599 (package (inherit icedtea6)
605 "http://icedtea.wildebeest.org/download/source/icedtea-"
609 "1irxk2ndwsfk4c1zbzb5h3rpwv2bc9bhfjvz6p4dws5476vsxrq9"))
610 (modules '((guix build utils)))
612 '(substitute* "Makefile.in"
613 ;; link against libgcj to avoid linker error
615 "-lgcj -o native-ecj")
616 ;; do not leak information about the build host
617 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
618 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
620 `(;; There are many test failures. Some are known to
621 ;; fail upstream, others relate to not having an X
622 ;; server running at test time, yet others are a
623 ;; complete mystery to me.
625 ;; hotspot: passed: 241; failed: 45; error: 2
626 ;; langtools: passed: 1,934; failed: 26
629 ;; Apparently, the C locale is needed for some of the tests.
631 ,@(substitute-keyword-arguments (package-arguments icedtea6)
632 ((#:configure-flags flags)
633 `(delete "--with-openjdk-src-dir=./openjdk" ,flags))
635 `(modify-phases ,phases
638 (lambda* (#:key source inputs #:allow-other-keys)
639 (let ((target (string-append "icedtea-" ,version))
640 (unpack (lambda (drop dir)
642 (zero? (system* "tar" "xvjf"
643 (assoc-ref inputs drop)
645 "--strip-components=1")))))
646 (and (zero? (system* "tar" "xvf" source))
648 (unpack "openjdk-drop" "openjdk")
649 (unpack "corba-drop" "openjdk/corba")
650 (unpack "jdk-drop" "openjdk/jdk")
651 (unpack "hotspot-drop" "openjdk/hotspot")
653 ;; The build framework checks the tarballs, so we
654 ;; need to keep them around even though we have
655 ;; already unpacked some of them for patching.
657 (copy-file (assoc-ref inputs "openjdk-drop")
659 (copy-file (assoc-ref inputs "corba-drop")
661 (copy-file (assoc-ref inputs "hotspot-drop")
663 (copy-file (assoc-ref inputs "jaxp-drop")
665 (copy-file (assoc-ref inputs "jaxws-drop")
667 (copy-file (assoc-ref inputs "jdk-drop")
669 (copy-file (assoc-ref inputs "langtools-drop")
673 'set-additional-paths
674 (lambda* (#:key inputs #:allow-other-keys)
675 (let (;; Get target-specific include directory so that
676 ;; libgcj-config.h is found when compiling hotspot.
677 (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
678 (str (read-line port)))
681 (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
682 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
683 (string-append "ALSA_INCLUDE="
684 (assoc-ref inputs "alsa-lib")
685 "/include/alsa/version.h")))
688 (string-append gcjinclude ":"
689 (assoc-ref inputs "libxrender")
690 "/include/X11/extensions" ":"
691 (assoc-ref inputs "libxtst")
692 "/include/X11/extensions" ":"
693 (assoc-ref inputs "libxinerama")
694 "/include/X11/extensions" ":"
695 (or (getenv "CPATH") "")))
696 (setenv "ALT_OBJCOPY" (which "objcopy"))
697 (setenv "ALT_CUPS_HEADERS_PATH"
698 (string-append (assoc-ref inputs "cups")
700 (setenv "ALT_FREETYPE_HEADERS_PATH"
701 (string-append (assoc-ref inputs "freetype")
703 (setenv "ALT_FREETYPE_LIB_PATH"
704 (string-append (assoc-ref inputs "freetype")
707 'unpack 'fix-x11-extension-include-path
708 (lambda* (#:key inputs #:allow-other-keys)
709 (substitute* "openjdk/jdk/make/sun/awt/mawt.gmk"
710 (((string-append "\\$\\(firstword \\$\\(wildcard "
711 "\\$\\(OPENWIN_HOME\\)"
712 "/include/X11/extensions\\).*$"))
713 (string-append (assoc-ref inputs "libxrender")
714 "/include/X11/extensions"
715 " -I" (assoc-ref inputs "libxtst")
716 "/include/X11/extensions"
717 " -I" (assoc-ref inputs "libxinerama")
718 "/include/X11/extensions"))
719 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
724 ;; Fix PATH in test environment
725 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
726 (("PATH=/bin:/usr/bin")
727 (string-append "PATH=" (getenv "PATH"))))
728 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
729 (("/usr/bin/env") (which "env")))
730 (substitute* "openjdk/hotspot/test/test_env.sh"
731 (("/bin/rm") (which "rm"))
732 (("/bin/cp") (which "cp"))
733 (("/bin/mv") (which "mv")))
735 (delete 'patch-patches))))))
740 "03gxqn17cxwl1nspnwigacaqd28p02d45f396j5f4kkbzfnbl0ak"))
743 "0ldcckknn2f92jv1144cnn0z3wmvxln28wc00rc6xxblnjcnamzh"))
746 "0mnjdziffcnyqlyvf8dw1hrl4kiiwmh8ia0ym417wgvnjpaihci9"))
749 "1gkmypnhygx2mxhca3ngy620k993wi2cc1wysc0np06y1rkx1mkn"))
752 "10x43mqjfn43jlckic0nyf7apyyjyr910cdmmvy41kvw8ljhvg61"))
755 "0q5nqc14r6vmhxgikw3wgdcc0r9symp830v13isnv8qdjgm6kcki"))
758 "1yqxfd2jwbm5y41wscyfx8h0fr3h8ny2g2mda5iwd8sikxsaj96p"))
759 ,@(fold alist-delete (package-native-inputs icedtea6)
760 '("openjdk6-src" "ant-bootstrap")))))))