gnu: icedtea6, icedtea7: Unpack to "openjdk.src".

* gnu/packages/java.scm (icedtea6)[arguments]: Unpack OpenJDK sources to
"openjdk.src".
(icedtea7)[arguments]: Inherit "--with-openjdk-src-dir" flag; refer to
"openjdk.src" in build phases; simplify "unpack" phase.
[native-inputs]: Rename "openjdk-drop" to "openjdk-src".
This commit is contained in:
Ricardo Wurmus 2015-12-30 14:04:04 +01:00
parent 43c565d2e7
commit d91488908b
1 changed files with 47 additions and 56 deletions

View File

@ -265,7 +265,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
"--without-rhino" "--without-rhino"
"--disable-downloading" "--disable-downloading"
"--disable-tests" ;they are run in the check phase instead "--disable-tests" ;they are run in the check phase instead
,(string-append "--with-openjdk-src-dir=" "./openjdk") "--with-openjdk-src-dir=./openjdk.src"
,(string-append "--with-javac=" jdk "/bin/javac") ,(string-append "--with-javac=" jdk "/bin/javac")
,(string-append "--with-ecj-jar=" ecj) ,(string-append "--with-ecj-jar=" ecj)
,(string-append "--with-gcj=" gcj) ,(string-append "--with-gcj=" gcj)
@ -278,8 +278,8 @@ build process and its dependencies, whereas Make uses Makefile format.")
(and (zero? (system* "tar" "xvf" source)) (and (zero? (system* "tar" "xvf" source))
(begin (begin
(chdir (string-append ,name "-" ,version)) (chdir (string-append ,name "-" ,version))
(mkdir "openjdk") (mkdir "openjdk.src")
(with-directory-excursion "openjdk" (with-directory-excursion "openjdk.src"
(copy-file (assoc-ref inputs "openjdk6-src") (copy-file (assoc-ref inputs "openjdk6-src")
"openjdk6-src.tar.xz") "openjdk6-src.tar.xz")
(zero? (system* "tar" "xvf" "openjdk6-src.tar.xz")))))) (zero? (system* "tar" "xvf" "openjdk6-src.tar.xz"))))))
@ -302,7 +302,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
(lambda _ (lambda _
;; buildtree.make generates shell scripts, so we need to replace ;; buildtree.make generates shell scripts, so we need to replace
;; the generated shebang ;; the generated shebang
(substitute* '("openjdk/hotspot/make/linux/makefiles/buildtree.make") (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
(("/bin/sh") (which "bash"))) (("/bin/sh") (which "bash")))
(let ((corebin (string-append (let ((corebin (string-append
@ -311,8 +311,8 @@ build process and its dependencies, whereas Make uses Makefile format.")
(assoc-ref %build-inputs "binutils") "/bin/")) (assoc-ref %build-inputs "binutils") "/bin/"))
(grepbin (string-append (grepbin (string-append
(assoc-ref %build-inputs "grep") "/bin/"))) (assoc-ref %build-inputs "grep") "/bin/")))
(substitute* '("openjdk/jdk/make/common/shared/Defs-linux.gmk" (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
"openjdk/corba/make/common/shared/Defs-linux.gmk") "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
(("UNIXCOMMAND_PATH = /bin/") (("UNIXCOMMAND_PATH = /bin/")
(string-append "UNIXCOMMAND_PATH = " corebin)) (string-append "UNIXCOMMAND_PATH = " corebin))
(("USRBIN_PATH = /usr/bin/") (("USRBIN_PATH = /usr/bin/")
@ -326,8 +326,8 @@ build process and its dependencies, whereas Make uses Makefile format.")
(string-append "DEF_OBJCOPY = " (which "objcopy")))) (string-append "DEF_OBJCOPY = " (which "objcopy"))))
;; fix hard-coded utility paths ;; fix hard-coded utility paths
(substitute* '("openjdk/jdk/make/common/shared/Defs-utils.gmk" (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
"openjdk/corba/make/common/shared/Defs-utils.gmk") "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
(("ECHO *=.*echo") (("ECHO *=.*echo")
(string-append "ECHO = " (which "echo"))) (string-append "ECHO = " (which "echo")))
(("^GREP *=.*grep") (("^GREP *=.*grep")
@ -370,7 +370,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
;; Some of these timestamps cause problems as they are more than ;; Some of these timestamps cause problems as they are more than
;; 10 years ago, failing the build process. ;; 10 years ago, failing the build process.
(substitute* (substitute*
"openjdk/jdk/src/share/classes/java/util/CurrencyData.properties" "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
(("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN") (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
(("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN") (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
(("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON") (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
@ -417,7 +417,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
(alist-cons-before (alist-cons-before
'check 'fix-hotspot-tests 'check 'fix-hotspot-tests
(lambda _ (lambda _
(with-directory-excursion "openjdk/hotspot/test/" (with-directory-excursion "openjdk.src/hotspot/test/"
(substitute* "jprt.config" (substitute* "jprt.config"
(("PATH=\"\\$\\{path4sdk\\}\"") (("PATH=\"\\$\\{path4sdk\\}\"")
(string-append "PATH=" (getenv "PATH"))) (string-append "PATH=" (getenv "PATH")))
@ -432,7 +432,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
(alist-cons-before (alist-cons-before
'check 'fix-jdk-tests 'check 'fix-jdk-tests
(lambda _ (lambda _
(with-directory-excursion "openjdk/jdk/test/" (with-directory-excursion "openjdk.src/jdk/test/"
(substitute* "com/sun/jdi/JdbReadTwiceTest.sh" (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
(("/bin/pwd") (which "pwd"))) (("/bin/pwd") (which "pwd")))
(substitute* "com/sun/jdi/ShellScaffold.sh" (substitute* "com/sun/jdi/ShellScaffold.sh"
@ -617,50 +617,41 @@ build process and its dependencies, whereas Make uses Makefile format.")
;; Apparently, the C locale is needed for some of the tests. ;; Apparently, the C locale is needed for some of the tests.
#:locale "C" #:locale "C"
,@(substitute-keyword-arguments (package-arguments icedtea6) ,@(substitute-keyword-arguments (package-arguments icedtea6)
((#:modules modules)
`((ice-9 match)
(srfi srfi-26)
,@modules))
((#:configure-flags flags) ((#:configure-flags flags)
`(delete "--with-openjdk-src-dir=./openjdk" ;; TODO: package pcsc and sctp, and add to inputs
;; TODO: package pcsc and sctp, and add to inputs `(append '("--disable-system-pcsc"
(append '("--disable-system-pcsc" "--disable-system-sctp")
"--disable-system-sctp") ,flags))
,flags)))
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases `(modify-phases ,phases
(replace (replace 'unpack
'unpack (lambda* (#:key source inputs #:allow-other-keys)
(lambda* (#:key source inputs #:allow-other-keys) (let ((target (string-append "icedtea-" ,version))
(let ((target (string-append "icedtea-" ,version)) (unpack (lambda* (name #:optional dir)
(unpack (lambda (drop dir) (let ((dir (or dir
(mkdir dir) (string-drop-right name 5))))
(zero? (system* "tar" "xvjf" (mkdir dir)
(assoc-ref inputs drop) (zero? (system* "tar" "xvf"
"-C" dir (assoc-ref inputs name)
"--strip-components=1"))))) "-C" dir
(and (zero? (system* "tar" "xvf" source)) "--strip-components=1"))))))
(chdir target) (mkdir target)
(unpack "openjdk-drop" "openjdk") (and
(unpack "corba-drop" "openjdk/corba") (zero? (system* "tar" "xvf" source
(unpack "jdk-drop" "openjdk/jdk") "-C" target "--strip-components=1"))
(unpack "hotspot-drop" "openjdk/hotspot") (chdir target)
(unpack "openjdk-src" "openjdk.src")
;; The build framework checks the tarballs, so we (with-directory-excursion "openjdk.src"
;; need to keep them around even though we have (for-each unpack
;; already unpacked some of them for patching. (filter (cut string-suffix? "-drop" <>)
(begin (map (match-lambda
(copy-file (assoc-ref inputs "openjdk-drop") ((name . _) name))
"openjdk.tar.bz2") inputs))))
(copy-file (assoc-ref inputs "corba-drop") #t))))
"corba.tar.bz2")
(copy-file (assoc-ref inputs "hotspot-drop")
"hotspot.tar.bz2")
(copy-file (assoc-ref inputs "jaxp-drop")
"jaxp.tar.bz2")
(copy-file (assoc-ref inputs "jaxws-drop")
"jaxws.tar.bz2")
(copy-file (assoc-ref inputs "jdk-drop")
"jdk.tar.bz2")
(copy-file (assoc-ref inputs "langtools-drop")
"langtools.tar.bz2")
#t)))))
(replace (replace
'set-additional-paths 'set-additional-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
@ -670,7 +661,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
(str (read-line port))) (str (read-line port)))
(close-pipe port) (close-pipe port)
str))) str)))
(substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
(("ALSA_INCLUDE=/usr/include/alsa/version.h") (("ALSA_INCLUDE=/usr/include/alsa/version.h")
(string-append "ALSA_INCLUDE=" (string-append "ALSA_INCLUDE="
(assoc-ref inputs "alsa-lib") (assoc-ref inputs "alsa-lib")
@ -698,7 +689,7 @@ build process and its dependencies, whereas Make uses Makefile format.")
(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)
(substitute* "openjdk/jdk/make/sun/awt/mawt.gmk" (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
(((string-append "\\$\\(firstword \\$\\(wildcard " (((string-append "\\$\\(firstword \\$\\(wildcard "
"\\$\\(OPENWIN_HOME\\)" "\\$\\(OPENWIN_HOME\\)"
"/include/X11/extensions\\).*$")) "/include/X11/extensions\\).*$"))
@ -719,14 +710,14 @@ build process and its dependencies, whereas Make uses Makefile format.")
(string-append "PATH=" (getenv "PATH")))) (string-append "PATH=" (getenv "PATH"))))
(substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java" (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
(("/usr/bin/env") (which "env"))) (("/usr/bin/env") (which "env")))
(substitute* "openjdk/hotspot/test/test_env.sh" (substitute* "openjdk.src/hotspot/test/test_env.sh"
(("/bin/rm") (which "rm")) (("/bin/rm") (which "rm"))
(("/bin/cp") (which "cp")) (("/bin/cp") (which "cp"))
(("/bin/mv") (which "mv"))) (("/bin/mv") (which "mv")))
#t)) #t))
(delete 'patch-patches)))))) (delete 'patch-patches))))))
(native-inputs (native-inputs
`(("openjdk-drop" `(("openjdk-src"
,(drop "openjdk" ,(drop "openjdk"
"0vflz0hhq4arykvvmsv3yas4yk9i0jm57287iqvs3a4832xjcpcy")) "0vflz0hhq4arykvvmsv3yas4yk9i0jm57287iqvs3a4832xjcpcy"))
("corba-drop" ("corba-drop"