gnu: icedtea-6: Use modify-phases syntax.

* gnu/packages/java.scm (icedtea-6)[arguments]: Use modify-phases
  syntax.
This commit is contained in:
Ricardo Wurmus 2016-07-08 11:28:58 +02:00 committed by Ricardo Wurmus
parent 745ad37a78
commit 9bc84dfea9

View file

@ -281,8 +281,8 @@ (define-public icedtea-6
,(string-append "--with-jdk-home=" jdk) ,(string-append "--with-jdk-home=" jdk)
,(string-append "--with-java=" jdk "/bin/java"))) ,(string-append "--with-java=" jdk "/bin/java")))
#:phases #:phases
(alist-replace (modify-phases %standard-phases
'unpack (replace 'unpack
(lambda* (#:key source inputs #:allow-other-keys) (lambda* (#:key source inputs #:allow-other-keys)
(and (zero? (system* "tar" "xvf" source)) (and (zero? (system* "tar" "xvf" source))
(begin (begin
@ -291,9 +291,8 @@ (define-public icedtea-6
(with-directory-excursion "openjdk.src" (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")))))))
(alist-cons-after (add-after 'unpack 'patch-patches
'unpack 'patch-patches
(lambda _ (lambda _
;; shebang in patches so that they apply cleanly ;; shebang in patches so that they apply cleanly
(substitute* '("patches/jtreg-jrunscript.patch" (substitute* '("patches/jtreg-jrunscript.patch"
@ -305,9 +304,8 @@ (define-public icedtea-6
(("ALSA_INCLUDE=/usr/include/alsa/version.h") (("ALSA_INCLUDE=/usr/include/alsa/version.h")
(string-append "ALSA_INCLUDE=" (string-append "ALSA_INCLUDE="
(assoc-ref %build-inputs "alsa-lib") (assoc-ref %build-inputs "alsa-lib")
"/include/alsa/version.h")))) "/include/alsa/version.h")))))
(alist-cons-after (add-after 'unpack 'patch-paths
'unpack 'patch-paths
(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
@ -383,9 +381,8 @@ (define-public icedtea-6
(("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")
(("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))) (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
(alist-cons-before (add-before 'configure 'set-additional-paths
'configure 'set-additional-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((gcjdir (assoc-ref %build-inputs "gcj")) (let* ((gcjdir (assoc-ref %build-inputs "gcj"))
(gcjlib (string-append gcjdir "/lib")) (gcjlib (string-append gcjdir "/lib"))
@ -412,9 +409,8 @@ (define-public icedtea-6
"/include")) "/include"))
(setenv "ALT_FREETYPE_LIB_PATH" (setenv "ALT_FREETYPE_LIB_PATH"
(string-append (assoc-ref %build-inputs "freetype") (string-append (assoc-ref %build-inputs "freetype")
"/lib")))) "/lib")))))
(alist-cons-before (add-before 'check 'fix-test-framework
'check 'fix-test-framework
(lambda _ (lambda _
;; Fix PATH in test environment ;; Fix PATH in test environment
(substitute* "src/jtreg/com/sun/javatest/regtest/Main.java" (substitute* "src/jtreg/com/sun/javatest/regtest/Main.java"
@ -422,9 +418,8 @@ (define-public icedtea-6
(string-append "PATH=" (getenv "PATH")))) (string-append "PATH=" (getenv "PATH"))))
(substitute* "src/jtreg/com/sun/javatest/util/SysEnv.java" (substitute* "src/jtreg/com/sun/javatest/util/SysEnv.java"
(("/usr/bin/env") (which "env"))) (("/usr/bin/env") (which "env")))
#t) #t))
(alist-cons-before (add-before 'check 'fix-hotspot-tests
'check 'fix-hotspot-tests
(lambda _ (lambda _
(with-directory-excursion "openjdk.src/hotspot/test/" (with-directory-excursion "openjdk.src/hotspot/test/"
(substitute* "jprt.config" (substitute* "jprt.config"
@ -437,9 +432,8 @@ (define-public icedtea-6
(("/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))
(alist-cons-before (add-before 'check 'fix-jdk-tests
'check 'fix-jdk-tests
(lambda _ (lambda _
(with-directory-excursion "openjdk.src/jdk/test/" (with-directory-excursion "openjdk.src/jdk/test/"
(substitute* "com/sun/jdi/JdbReadTwiceTest.sh" (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
@ -495,9 +489,8 @@ (define-public icedtea-6
(("/bin/chmod") (which "chmod"))) (("/bin/chmod") (which "chmod")))
(substitute* "java/util/zip/ZipFile/Assortment.java" (substitute* "java/util/zip/ZipFile/Assortment.java"
(("/bin/sh") (which "sh")))) (("/bin/sh") (which "sh"))))
#t) #t))
(alist-replace (replace 'check
'check
(lambda _ (lambda _
;; The "make check-*" targets always return zero, so we need to ;; The "make check-*" targets always return zero, so we need to
;; check for errors in the associated log files to determine ;; check for errors in the associated log files to determine
@ -519,9 +512,8 @@ (define-public icedtea-6
(or #t ; skip tests (or #t ; skip tests
(and (run-test "check-hotspot") (and (run-test "check-hotspot")
(run-test "check-langtools") (run-test "check-langtools")
(run-test "check-jdk"))))) (run-test "check-jdk"))))))
(alist-replace (replace 'install
'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((doc (string-append (assoc-ref outputs "doc") (let ((doc (string-append (assoc-ref outputs "doc")
"/share/doc/icedtea")) "/share/doc/icedtea"))
@ -529,8 +521,7 @@ (define-public icedtea-6
(jdk (assoc-ref outputs "jdk"))) (jdk (assoc-ref outputs "jdk")))
(copy-recursively "openjdk.build/docs" doc) (copy-recursively "openjdk.build/docs" doc)
(copy-recursively "openjdk.build/j2re-image" jre) (copy-recursively "openjdk.build/j2re-image" jre)
(copy-recursively "openjdk.build/j2sdk-image" jdk))) (copy-recursively "openjdk.build/j2sdk-image" jdk)))))))
%standard-phases)))))))))))
(native-inputs (native-inputs
`(("ant" ,ant) `(("ant" ,ant)
("alsa-lib" ,alsa-lib) ("alsa-lib" ,alsa-lib)