[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/21: gnu: Add ecj4-bootstrap.
From: |
guix-commits |
Subject: |
08/21: gnu: Add ecj4-bootstrap. |
Date: |
Sat, 18 Dec 2021 05:15:45 -0500 (EST) |
rekado pushed a commit to branch wip-java-bootstrap-simplify
in repository guix.
commit 0f1244e69c27339648f1395cfd6fa0470170e5ef
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Fri Dec 17 22:55:14 2021 +0100
gnu: Add ecj4-bootstrap.
* gnu/packages/java.scm (ecj4-bootstrap): New variable.
---
gnu/packages/java.scm | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 0c07b85..b515c31 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -780,6 +780,97 @@ machine.")))
(native-inputs
(list guile-3.0 ecj-bootstrap jamvm classpath-devel))))
+;; We jump ahead by patching the sources of ECJ 4.2.1 so that our bootstrap
+;; JDK can build it. ECJ 4 allows us to skip the build of the first version
+;; of icedtea and build icedtea 2.x directly.
+(define-public ecj4-bootstrap
+ (package
+ (name "ecj-bootstrap")
+ (version "4.2.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://archive.eclipse.org/eclipse/"
+ "downloads/drops4/R-" version
+ "-201209141800/ecjsrc-" version ".jar"))
+ (sha256
+ (base32
+ "1x281p87m14zylvinkiz6gc23ss7pzlx419qjbql11jriwav4qfj"))))
+ ;; It would be so much easier if we could use the ant-build-system, but we
+ ;; cannot as we don't have ant at this point. We use ecj for
+ ;; bootstrapping the JDK.
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; there are no tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'unpack
+ (lambda* (#:key source #:allow-other-keys)
+ (mkdir "src")
+ (with-directory-excursion "src"
+ (invoke "gjar" "-xf" source))
+ (chdir "src")))
+ (replace 'configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "CLASSPATH"
+ (string-join
+ (cons (search-input-file inputs "/lib/rt.jar")
+ (find-files (string-append
+ (assoc-ref inputs "ant-bootstrap")
+ "/lib")
+ "\\.jar$"))
+ ":"))
+ ;; This directive is not supported by our simple bootstrap JDK.
+ (substitute* (find-files "." "\\.java$")
+ (("@Override") ""))))
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; We can't compile these yet, but we don't need them at this
+ ;; point anyway.
+ (delete-file "org/eclipse/jdt/core/JDTCompilerAdapter.java")
+ (delete-file-recursively "org/eclipse/jdt/internal/antadapter")
+
+ ;; Create a simple manifest to make ecj executable.
+ (mkdir-p "META-INF")
+ (with-output-to-file "META-INF/MANIFESTS.MF"
+ (lambda _
+ (display "Manifest-Version: 1.0
+Main-Class: org.eclipse.jdt.internal.compiler.batch.Main\n")))
+
+ ;; Compile it all!
+ (apply invoke "javac"
+ (find-files "." "\\.java$"))
+
+ ;; Pack it all up! We don't use "jar" here, because
+ ;; it doesn't produce reproducible zip archives.
+ ;; XXX: copied from (gnu build install)
+ (for-each (lambda (file)
+ (let ((s (lstat file)))
+ (unless (eq? (stat:type s) 'symlink)
+ (utime file 0 0 0 0))))
+ (find-files "." #:directories? #t))
+
+ ;; It is important that the manifest appears first.
+ (apply invoke "zip" "-0" "-X" "ecj-bootstrap.jar"
+ "META-INF/MANIFESTS.MF"
+ (delete "./META-INF/MANIFESTS.MF"
+ (find-files "." ".*" #:directories? #t)))))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((share (string-append (assoc-ref outputs "out")
+ "/share/java/")))
+ (mkdir-p share)
+ (install-file "ecj-bootstrap.jar" share)))))))
+ (native-inputs
+ (list ant-bootstrap classpath-devel ecj-javac-wrapper-final jamvm
+ unzip zip))
+ (home-page "https://eclipse.org")
+ (synopsis "Eclipse Java development tools core batch compiler")
+ (description "This package provides the Eclipse Java core batch compiler
+for bootstrapping purposes. The @dfn{Eclipse compiler for Java} (ecj) is a
+requirement for all GNU Classpath releases after version 0.93. This version
+supports sufficient parts of Java 7 to build Icedtea 2.x.")
+ (license license:epl1.0)))
+
;; The bootstrap JDK consisting of jamvm, classpath-devel,
;; ecj-javac-wrapper-final cannot build Icedtea 2.x directly, because it's
;; written in Java 7. It can, however, build the unmaintained Icedtea 1.x,
- branch wip-java-bootstrap-simplify created (now 198a1dc), guix-commits, 2021/12/18
- 02/21: gnu: ecj-bootstrap: Remove trailing #T., guix-commits, 2021/12/18
- 05/21: gnu: ecj-javac-wrapper: Use Guile 3., guix-commits, 2021/12/18
- 06/21: gnu: ecj-javac-wrapper-final: Use Guile 3., guix-commits, 2021/12/18
- 01/21: gnu: jamvm: Simplify snippet., guix-commits, 2021/12/18
- 03/21: gnu: ecj-javac-wrapper: Remove rt.jar from classpath., guix-commits, 2021/12/18
- 04/21: gnu: ecj-javac-wrapper: Remove trailing #T., guix-commits, 2021/12/18
- 07/21: gnu: ecj-javac-wrapper-final: Use new style for inputs., guix-commits, 2021/12/18
- 08/21: gnu: Add ecj4-bootstrap.,
guix-commits <=
- 09/21: gnu: Add ecj4-javac-wrapper., guix-commits, 2021/12/18
- 14/21: gnu: icedtea-7: Use system lcms and pcsc., guix-commits, 2021/12/18
- 19/21: gnu: icedtea-8: Remove trailing #T from build phases., guix-commits, 2021/12/18
- 21/21: gnu: icedtea-8: Update to 3.19.0., guix-commits, 2021/12/18
- 10/21: gnu: Add jamvm-with-ecj4., guix-commits, 2021/12/18
- 17/21: gnu: icedtea-8: Remove commented configure flag., guix-commits, 2021/12/18
- 13/21: gnu: icedtea-7: Bind INPUTS in 'patch-paths build phase., guix-commits, 2021/12/18
- 15/21: gnu: icedtea-7: Import missing module for read-line., guix-commits, 2021/12/18
- 16/21: gnu: icedtea-7: Build with ECJ 4, Jamvm, and GNU Classpath., guix-commits, 2021/12/18
- 18/21: gnu: Remove icedtea-6., guix-commits, 2021/12/18