gnu: icedtea7: Bootstrap with GCJ.

* gnu/packages/java.scm (icedtea7): Bootstrap with GCJ rather than compile
  with IcedTea6.
This commit is contained in:
Ricardo Wurmus 2015-06-09 12:53:23 +02:00
parent 36742f4389
commit 47da6268c4

View File

@ -610,6 +610,9 @@ build process and its dependencies, whereas Make uses Makefile format.")
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(substitute* "Makefile.in" '(substitute* "Makefile.in"
;; link against libgcj to avoid linker error
(("-o native-ecj")
"-lgcj -o native-ecj")
;; do not leak information about the build host ;; do not leak information about the build host
(("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"") (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
"DISTRIBUTION_ID=\"\\\"guix\\\"\""))))) "DISTRIBUTION_ID=\"\\\"guix\\\"\"")))))
@ -627,15 +630,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
#:locale "C" #:locale "C"
,@(substitute-keyword-arguments (package-arguments icedtea6) ,@(substitute-keyword-arguments (package-arguments icedtea6)
((#:configure-flags flags) ((#:configure-flags flags)
`(let ((jdk (assoc-ref %build-inputs "icedtea6")) `(delete "--with-openjdk-src-dir=./openjdk" ,flags))
(ant (assoc-ref %build-inputs "ant")))
`("--disable-bootstrap"
"--without-rhino"
"--enable-nss"
"--enable-system-lcms"
"--disable-downloading"
,(string-append "--with-ant-home=" ant)
,(string-append "--with-jdk-home=" jdk))))
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases `(modify-phases ,phases
(replace (replace
@ -677,30 +672,37 @@ build process and its dependencies, whereas Make uses Makefile format.")
(replace (replace
'set-additional-paths 'set-additional-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" (let (;; Get target-specific include directory so that
(("ALSA_INCLUDE=/usr/include/alsa/version.h") ;; libgcj-config.h is found when compiling hotspot.
(string-append "ALSA_INCLUDE=" (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include"))
(assoc-ref inputs "alsa-lib") (str (read-line port)))
"/include/alsa/version.h"))) (close-pipe port)
(setenv "CC" "gcc") str)))
(setenv "CPATH" (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk"
(string-append (assoc-ref inputs "libxrender") (("ALSA_INCLUDE=/usr/include/alsa/version.h")
"/include/X11/extensions" ":" (string-append "ALSA_INCLUDE="
(assoc-ref inputs "libxtst") (assoc-ref inputs "alsa-lib")
"/include/X11/extensions" ":" "/include/alsa/version.h")))
(assoc-ref inputs "libxinerama") (setenv "CC" "gcc")
"/include/X11/extensions" ":" (setenv "CPATH"
(or (getenv "CPATH") ""))) (string-append gcjinclude ":"
(setenv "ALT_OBJCOPY" (which "objcopy")) (assoc-ref inputs "libxrender")
(setenv "ALT_CUPS_HEADERS_PATH" "/include/X11/extensions" ":"
(string-append (assoc-ref inputs "cups") (assoc-ref inputs "libxtst")
"/include")) "/include/X11/extensions" ":"
(setenv "ALT_FREETYPE_HEADERS_PATH" (assoc-ref inputs "libxinerama")
(string-append (assoc-ref inputs "freetype") "/include/X11/extensions" ":"
"/include")) (or (getenv "CPATH") "")))
(setenv "ALT_FREETYPE_LIB_PATH" (setenv "ALT_OBJCOPY" (which "objcopy"))
(string-append (assoc-ref inputs "freetype") (setenv "ALT_CUPS_HEADERS_PATH"
"/lib")))) (string-append (assoc-ref inputs "cups")
"/include"))
(setenv "ALT_FREETYPE_HEADERS_PATH"
(string-append (assoc-ref inputs "freetype")
"/include"))
(setenv "ALT_FREETYPE_LIB_PATH"
(string-append (assoc-ref inputs "freetype")
"/lib")))))
(add-after (add-after
'unpack 'fix-x11-extension-include-path 'unpack 'fix-x11-extension-include-path
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
@ -733,7 +735,6 @@ build process and its dependencies, whereas Make uses Makefile format.")
(delete 'patch-patches)))))) (delete 'patch-patches))))))
(native-inputs (native-inputs
`(("ant" ,ant) `(("ant" ,ant)
("icedtea6" ,icedtea6 "jdk")
("openjdk-drop" ("openjdk-drop"
,(drop "openjdk" ,(drop "openjdk"
"03gxqn17cxwl1nspnwigacaqd28p02d45f396j5f4kkbzfnbl0ak")) "03gxqn17cxwl1nspnwigacaqd28p02d45f396j5f4kkbzfnbl0ak"))
@ -756,4 +757,4 @@ build process and its dependencies, whereas Make uses Makefile format.")
,(drop "hotspot" ,(drop "hotspot"
"1yqxfd2jwbm5y41wscyfx8h0fr3h8ny2g2mda5iwd8sikxsaj96p")) "1yqxfd2jwbm5y41wscyfx8h0fr3h8ny2g2mda5iwd8sikxsaj96p"))
,@(fold alist-delete (package-native-inputs icedtea6) ,@(fold alist-delete (package-native-inputs icedtea6)
'("openjdk6-src" "ant-bootstrap" "gcj"))))))) '("openjdk6-src" "ant-bootstrap")))))))