1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages java)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix utils)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages attr)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages cpio)
32 #:use-module (gnu packages cups)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages gawk)
36 #:use-module (gnu packages gcc)
37 #:use-module (gnu packages gl)
38 #:use-module (gnu packages gnuzilla) ;nss
39 #:use-module (gnu packages ghostscript) ;lcms
40 #:use-module (gnu packages gnome)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages linux) ;alsa
44 #:use-module (gnu packages wget)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages mit-krb5)
48 #:use-module (gnu packages xml)
49 #:use-module (gnu packages xorg)
50 #:use-module (gnu packages zip)
51 #:use-module (gnu packages texinfo)
52 #:use-module ((srfi srfi-1) #:select (fold alist-delete)))
61 "http://ftp-stud.fht-esslingen.de/pub/Mirrors/"
62 "eclipse/eclipse/downloads/drops4/R-" version
63 "-201502041700/swt-" version "-gtk-linux-x86.zip"))
66 "0lzyqr8k2zm5s8fmnrx5kxpslxfs0i73y26fwfms483x45izzwj8"))))
67 (build-system gnu-build-system)
69 `(#:make-flags '("-f" "make_linux.mak")
70 #:tests? #f ; no "check" target
76 (zero? (system* "unzip" (assoc-ref %build-inputs "source") "-d" "swt"))
79 (zero? (system* "unzip" "src.zip" "-d" "src"))
83 (lambda* (#:key inputs outputs #:allow-other-keys)
84 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
85 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
87 ;; Build shared libraries. Users of SWT have to set the system
88 ;; property swt.library.path to the "lib" directory of this
91 (setenv "OUTPUT_DIR" lib)
92 (zero? (system* "bash" "build.sh"))
96 (for-each (lambda (file)
97 (format #t "Compiling ~s\n" file)
98 (system* "javac" "-d" "build" file))
99 (find-files "." "\\.java"))
100 (zero? (system* "jar" "cvf" "swt.jar" "-C" "build" "."))))
102 'install 'install-java-files
103 (lambda* (#:key outputs #:allow-other-keys)
104 (let ((java (string-append (assoc-ref outputs "out")
106 (install-file "swt.jar" java)
108 (alist-delete 'configure %standard-phases))))))
110 `(("xulrunner" ,icecat)
117 `(("pkg-config" ,pkg-config)
119 ("jdk" ,icedtea "jdk")))
120 (home-page "https://www.eclipse.org/swt/")
121 (synopsis "Widget toolkit for Java")
123 "SWT is a widget toolkit for Java designed to provide efficient, portable
124 access to the user-interface facilities of the operating systems on which it
126 ;; SWT code is licensed under EPL1.0
127 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
128 ;; Cairo bindings contain code under MPL1.1
129 ;; XULRunner 1.9 bindings contain code under MPL2.0
142 (uri (string-append "mirror://apache/ant/source/apache-ant-"
143 version "-src.tar.gz"))
146 "1396wflczyxjxl603dhxjvd559f289lha9y2f04f71c7hapjl3am"))))
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.*)")))
162 (setenv "JAVA_HOME" (string-append (assoc-ref %build-inputs "gcj")
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))))))
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 icedtea-6
194 "http://icedtea.wildebeest.org/download/source/icedtea6-"
198 "1mq08sfyfjlfw0c1czjs47303zv4h91s1jc0nhdlra4rbbx0g2d0"))
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 "--with-openjdk-src-dir=./openjdk.src"
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))
280 (chdir (string-append "icedtea6-" ,version))
281 (mkdir "openjdk.src")
282 (with-directory-excursion "openjdk.src"
283 (copy-file (assoc-ref inputs "openjdk6-src")
284 "openjdk6-src.tar.xz")
285 (zero? (system* "tar" "xvf" "openjdk6-src.tar.xz"))))))
287 'unpack 'patch-patches
289 ;; shebang in patches so that they apply cleanly
290 (substitute* '("patches/jtreg-jrunscript.patch"
291 "patches/hotspot/hs23/drop_unlicensed_test.patch")
292 (("#!/bin/sh") (string-append "#!" (which "sh"))))
294 ;; fix path to alsa header in patch
295 (substitute* "patches/openjdk/6799141-split_out_versions.patch"
296 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
297 (string-append "ALSA_INCLUDE="
298 (assoc-ref %build-inputs "alsa-lib")
299 "/include/alsa/version.h"))))
303 ;; buildtree.make generates shell scripts, so we need to replace
304 ;; the generated shebang
305 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
306 (("/bin/sh") (which "bash")))
308 (let ((corebin (string-append
309 (assoc-ref %build-inputs "coreutils") "/bin/"))
310 (binbin (string-append
311 (assoc-ref %build-inputs "binutils") "/bin/"))
312 (grepbin (string-append
313 (assoc-ref %build-inputs "grep") "/bin/")))
314 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
315 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
316 (("UNIXCOMMAND_PATH = /bin/")
317 (string-append "UNIXCOMMAND_PATH = " corebin))
318 (("USRBIN_PATH = /usr/bin/")
319 (string-append "USRBIN_PATH = " corebin))
320 (("DEVTOOLS_PATH *= */usr/bin/")
321 (string-append "DEVTOOLS_PATH = " corebin))
322 (("COMPILER_PATH *= */usr/bin/")
323 (string-append "COMPILER_PATH = "
324 (assoc-ref %build-inputs "gcc") "/bin/"))
325 (("DEF_OBJCOPY *=.*objcopy")
326 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
328 ;; fix hard-coded utility paths
329 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
330 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
332 (string-append "ECHO = " (which "echo")))
334 (string-append "GREP = " (which "grep")))
336 (string-append "EGREP = " (which "egrep")))
338 (string-append "CPIO = " (which "cpio")))
339 (("READELF *=.*readelf")
340 (string-append "READELF = " (which "readelf")))
342 (string-append "AR = " (which "ar")))
344 (string-append "TAR = " (which "tar")))
346 (string-append "AS = " (which "as")))
348 (string-append "LD = " (which "ld")))
350 (string-append "STRIP = " (which "strip")))
352 (string-append "NM = " (which "nm")))
354 (string-append "SH = " (which "bash")))
356 (string-append "FIND = " (which "find")))
358 (string-append "LDD = " (which "ldd")))
359 (("NAWK *=.*(n|g)awk")
360 (string-append "NAWK = " (which "gawk")))
362 (string-append "XARGS = " (which "xargs")))
364 (string-append "UNZIP = " (which "unzip")))
366 (string-append "ZIPEXE = " (which "zip")))
368 (string-append "SED = " (which "sed"))))
370 ;; Some of these timestamps cause problems as they are more than
371 ;; 10 years ago, failing the build process.
373 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
374 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
375 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
376 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
377 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY"))))
379 'configure 'set-additional-paths
380 (lambda* (#:key inputs #:allow-other-keys)
381 (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
382 (gcjlib (string-append gcjdir "/lib"))
383 ;; Get target-specific include directory so that
384 ;; libgcj-config.h is found when compiling hotspot.
385 (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
386 (str (read-line port)))
390 (string-append gcjinclude ":"
391 (assoc-ref %build-inputs "libxrender")
392 "/include/X11/extensions" ":"
393 (assoc-ref %build-inputs "libxtst")
394 "/include/X11/extensions" ":"
395 (assoc-ref %build-inputs "libxinerama")
396 "/include/X11/extensions" ":"
397 (or (getenv "CPATH") "")))
398 (setenv "ALT_CUPS_HEADERS_PATH"
399 (string-append (assoc-ref %build-inputs "cups")
401 (setenv "ALT_FREETYPE_HEADERS_PATH"
402 (string-append (assoc-ref %build-inputs "freetype")
404 (setenv "ALT_FREETYPE_LIB_PATH"
405 (string-append (assoc-ref %build-inputs "freetype")
408 'check 'fix-test-framework
410 ;; Fix PATH in test environment
411 (substitute* "src/jtreg/com/sun/javatest/regtest/Main.java"
412 (("PATH=/bin:/usr/bin")
413 (string-append "PATH=" (getenv "PATH"))))
414 (substitute* "src/jtreg/com/sun/javatest/util/SysEnv.java"
415 (("/usr/bin/env") (which "env")))
418 'check 'fix-hotspot-tests
420 (with-directory-excursion "openjdk.src/hotspot/test/"
421 (substitute* "jprt.config"
422 (("PATH=\"\\$\\{path4sdk\\}\"")
423 (string-append "PATH=" (getenv "PATH")))
424 (("make=/usr/bin/make")
425 (string-append "make=" (which "make"))))
426 (substitute* '("runtime/6626217/Test6626217.sh"
427 "runtime/7110720/Test7110720.sh")
428 (("/bin/rm") (which "rm"))
429 (("/bin/cp") (which "cp"))
430 (("/bin/mv") (which "mv"))))
433 'check 'fix-jdk-tests
435 (with-directory-excursion "openjdk.src/jdk/test/"
436 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
437 (("/bin/pwd") (which "pwd")))
438 (substitute* "com/sun/jdi/ShellScaffold.sh"
439 (("/bin/kill") (which "kill")))
440 (substitute* "start-Xvfb.sh"
441 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
442 (("/usr/bin/nohup") (which "nohup")))
443 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
444 (("/bin/rm") (which "rm")))
445 (substitute* "tools/launcher/MultipleJRE.sh"
446 (("echo \"#!/bin/sh\"")
447 (string-append "echo \"#!" (which "rm") "\""))
448 (("/usr/bin/zip") (which "zip")))
449 (substitute* "com/sun/jdi/OnThrowTest.java"
450 (("#!/bin/sh") (string-append "#!" (which "sh"))))
451 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
452 (("/usr/bin/uptime") (which "uptime")))
453 (substitute* "java/lang/ProcessBuilder/Basic.java"
454 (("/usr/bin/env") (which "env"))
455 (("/bin/false") (which "false"))
456 (("/bin/true") (which "true"))
457 (("/bin/cp") (which "cp"))
458 (("/bin/sh") (which "sh")))
459 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
460 (("/bin/sh") (which "sh")))
461 (substitute* "java/lang/ProcessBuilder/Zombies.java"
462 (("/usr/bin/perl") (which "perl"))
463 (("/bin/ps") (which "ps"))
464 (("/bin/true") (which "true")))
465 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
466 (("/usr/bin/tee") (which "tee")))
467 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
468 (("/bin/true") (which "true")))
469 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
470 (("/bin/cat") (which "cat")))
471 (substitute* "java/lang/Runtime/exec/ExitValue.java"
472 (("/bin/sh") (which "sh"))
473 (("/bin/true") (which "true"))
474 (("/bin/kill") (which "kill")))
475 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
476 (("/usr/bin/echo") (which "echo")))
477 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
478 (("/usr/bin/cat") (which "cat")))
479 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
480 (("/bin/cat") (which "cat"))
481 (("/bin/sleep") (which "sleep"))
482 (("/bin/sh") (which "sh")))
483 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
484 (("/bin/cat") (which "cat")))
485 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
486 (("/bin/chmod") (which "chmod")))
487 (substitute* "java/util/zip/ZipFile/Assortment.java"
488 (("/bin/sh") (which "sh"))))
493 ;; The "make check-*" targets always return zero, so we need to
494 ;; check for errors in the associated log files to determine
495 ;; whether any tests have failed.
496 (use-modules (ice-9 rdelim))
497 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
498 (checker (lambda (port)
500 (let ((line (read-line port)))
502 ((eof-object? line) #t)
503 ((regexp-exec error-pattern line) #f)
505 (run-test (lambda (test)
506 (system* "make" test)
507 (call-with-input-file
508 (string-append "test/" test ".log")
511 (and (run-test "check-hotspot")
512 (run-test "check-langtools")
513 (run-test "check-jdk")))))
516 (lambda* (#:key outputs #:allow-other-keys)
517 (let ((doc (string-append (assoc-ref outputs "doc")
518 "/share/doc/icedtea"))
519 (jre (assoc-ref outputs "out"))
520 (jdk (assoc-ref outputs "jdk")))
521 (copy-recursively "openjdk.build/docs" doc)
522 (copy-recursively "openjdk.build/j2re-image" jre)
523 (copy-recursively "openjdk.build/j2sdk-image" jdk)))
524 %standard-phases)))))))))))
527 ("alsa-lib" ,alsa-lib)
529 ("autoconf" ,autoconf)
530 ("automake" ,automake)
531 ("coreutils" ,coreutils)
532 ("diffutils" ,diffutils) ;for tests
536 ("pkg-config" ,pkg-config)
544 ("libxslt" ,libxslt) ;for xsltproc
545 ("mit-krb5" ,mit-krb5)
551 ("libxinerama" ,libxinerama)
552 ("libxrender" ,libxrender)
557 ("procps" ,procps) ;for "free", even though I'm not sure we should use it
561 (uri "https://java.net/downloads/openjdk6/openjdk-6-src-b38-20_jan_2016.tar.gz")
564 "1fapj9w4ahzf5nwvdgi1dsxjyh9dqbcvf9638r60h1by13wjqk5p"))))
568 ("fontconfig" ,fontconfig)
569 ("freetype" ,freetype)
571 (home-page "http://icedtea.classpath.org")
572 (synopsis "Java development kit")
574 "The OpenJDK built with the IcedTea build harness.")
575 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
576 ;; same license as both GNU Classpath and OpenJDK.
577 (license license:gpl2+)))
579 (define-public icedtea-7
580 (let* ((version "2.6.4")
581 (drop (lambda (name hash)
585 "http://icedtea.classpath.org/download/drops/"
586 "/icedtea7/" version "/" name ".tar.bz2"))
587 (sha256 (base32 hash))))))
588 (package (inherit icedtea-6)
593 "http://icedtea.wildebeest.org/download/source/icedtea-"
597 "0r31h8nlsrbfdkgbjbb7phwgcwglc9siznzrr40lqnm9xrgkc2nj"))
598 (modules '((guix build utils)))
600 '(substitute* "Makefile.in"
601 ;; link against libgcj to avoid linker error
603 "-lgcj -o native-ecj")
604 ;; do not leak information about the build host
605 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
606 "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
608 `(;; There are many test failures. Some are known to
609 ;; fail upstream, others relate to not having an X
610 ;; server running at test time, yet others are a
611 ;; complete mystery to me.
613 ;; hotspot: passed: 241; failed: 45; error: 2
614 ;; langtools: passed: 1,934; failed: 26
617 ;; Apparently, the C locale is needed for some of the tests.
619 ,@(substitute-keyword-arguments (package-arguments icedtea-6)
624 ((#:configure-flags flags)
625 ;; TODO: package pcsc and sctp, and add to inputs
626 `(append '("--disable-system-pcsc"
627 "--disable-system-sctp")
630 `(modify-phases ,phases
632 (lambda* (#:key source inputs #:allow-other-keys)
633 (let ((target (string-append "icedtea-" ,version))
634 (unpack (lambda* (name #:optional dir)
636 (string-drop-right name 5))))
638 (zero? (system* "tar" "xvf"
639 (assoc-ref inputs name)
641 "--strip-components=1"))))))
644 (zero? (system* "tar" "xvf" source
645 "-C" target "--strip-components=1"))
647 (unpack "openjdk-src" "openjdk.src")
648 (with-directory-excursion "openjdk.src"
650 (filter (cut string-suffix? "-drop" <>)
656 'set-additional-paths
657 (lambda* (#:key inputs #:allow-other-keys)
658 (let (;; Get target-specific include directory so that
659 ;; libgcj-config.h is found when compiling hotspot.
660 (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
661 (str (read-line port)))
664 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
665 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
666 (string-append "ALSA_INCLUDE="
667 (assoc-ref inputs "alsa-lib")
668 "/include/alsa/version.h")))
671 (string-append gcjinclude ":"
672 (assoc-ref inputs "libxrender")
673 "/include/X11/extensions" ":"
674 (assoc-ref inputs "libxtst")
675 "/include/X11/extensions" ":"
676 (assoc-ref inputs "libxinerama")
677 "/include/X11/extensions" ":"
678 (or (getenv "CPATH") "")))
679 (setenv "ALT_OBJCOPY" (which "objcopy"))
680 (setenv "ALT_CUPS_HEADERS_PATH"
681 (string-append (assoc-ref inputs "cups")
683 (setenv "ALT_FREETYPE_HEADERS_PATH"
684 (string-append (assoc-ref inputs "freetype")
686 (setenv "ALT_FREETYPE_LIB_PATH"
687 (string-append (assoc-ref inputs "freetype")
690 'unpack 'fix-x11-extension-include-path
691 (lambda* (#:key inputs #:allow-other-keys)
692 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
693 (((string-append "\\$\\(firstword \\$\\(wildcard "
694 "\\$\\(OPENWIN_HOME\\)"
695 "/include/X11/extensions\\).*$"))
696 (string-append (assoc-ref inputs "libxrender")
697 "/include/X11/extensions"
698 " -I" (assoc-ref inputs "libxtst")
699 "/include/X11/extensions"
700 " -I" (assoc-ref inputs "libxinerama")
701 "/include/X11/extensions"))
702 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))
707 ;; Fix PATH in test environment
708 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
709 (("PATH=/bin:/usr/bin")
710 (string-append "PATH=" (getenv "PATH"))))
711 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
712 (("/usr/bin/env") (which "env")))
713 (substitute* "openjdk.src/hotspot/test/test_env.sh"
714 (("/bin/rm") (which "rm"))
715 (("/bin/cp") (which "cp"))
716 (("/bin/mv") (which "mv")))
718 (delete 'patch-patches))))))
722 "1qjjf71nq80ac2d08hbaa8589d31vk313z3rkirnwq5df8cyf0mv"))
725 "025warxhjal3nr7w1xyd16k0f32fwkchifpaslzyidsga3hgmfr6"))
728 "0qiz6swb78w9c0mf88pf0gflgm5rp9k0l6fv6sdl7dki691b0z09"))
731 "18fz4gl4fdlcmqvh1mlpd9h0gj0qizpfa7njkax97aysmsm08xns"))
734 "0qsx5d9pgwlz9vbpapw4jwpajqc6rwk1150cjb33i4n3z709jccx"))
737 "1k6plx96smf86z303gb30hncssa8f40qdryzsdv349iwqwacxc7r"))
740 "0r9ffzyf5vxs8wg732szqcil0ksc8lcxzihdv3viz7d67dy42irp"))
741 ,@(fold alist-delete (package-native-inputs icedtea-6)
742 '("openjdk6-src")))))))
744 (define-public icedtea icedtea-7)