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

View file

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