Update to latest upstream release

Drop build requirement on Java 8, ecj now requires Java 11
This commit is contained in:
Mat Booth 2021-09-15 10:57:01 +01:00
parent c9f534482a
commit 41d3ee08cd
7 changed files with 100 additions and 89 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/java10api.jar /java10api.jar
/java14api.jar /java14api.jar
/javax15api.jar /javax15api.jar
/javax16api.jar

View File

@ -1,13 +1,18 @@
### Eclipse Workspace Patch 1.0 From e7ff390ef777bd818ccc6e6f8f3a56f36020abfe Mon Sep 17 00:00:00 2001
#P org.eclipse.jdt.core From: Mat Booth <mat.booth@gmail.com>
Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java Date: Wed, 15 Sep 2021 10:21:53 +0100
=================================================================== Subject: [PATCH 1/2] Always generate bytecode debuginfo
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v
retrieving revision 1.327 When ecj is used to build RPMs
diff -u -r1.327 Main.java ---
--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 21 Apr 2008 15:00:59 -0000 1.327 .../jdt/internal/compiler/batch/Main.java | 23 +++++++++++++++++++
+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 20 Nov 2008 19:26:57 -0000 1 file changed, 23 insertions(+)
@@ -2609,6 +2609,29 @@
diff --git a/org/eclipse/jdt/internal/compiler/batch/Main.java b/org/eclipse/jdt/internal/compiler/batch/Main.java
index f77372d..73a0d24 100644
--- a/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -3109,6 +3109,29 @@ public void configure(String[] argv) {
this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED); this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
} }
@ -37,3 +42,6 @@ diff -u -r1.327 Main.java
this.logger.logCommandLineArguments(newCommandLineArgs); this.logger.logCommandLineArguments(newCommandLineArgs);
this.logger.logOptions(this.options); this.logger.logOptions(this.options);
--
2.31.1

View File

@ -0,0 +1,31 @@
From f0d18d7027330806097b6f6c221c0a6008f8c503 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@gmail.com>
Date: Wed, 15 Sep 2021 10:15:08 +0100
Subject: [PATCH 2/2] Fix build from source
---
build.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/build.xml b/build.xml
index 229bec2..797f7fa 100644
--- a/build.xml
+++ b/build.xml
@@ -24,10 +24,10 @@
<mkdir dir="${output}" />
<javac srcdir="${basedir}" destdir="${output}"
- debuglevel="lines,source"
- source="1.8"
- target="1.8">
- <compilerarg line="-Xlint:none"/>
+ debuglevel="lines,vars,source"
+ debug="true"
+ release="11">
+ <compilerarg line="-Xlint:none -encoding cp1252 --patch-module java.compiler=${javaapi}"/>
</javac>
<delete file="${basedir}/META-INF/MANIFEST.MF" failonerror="false"/>
--
2.31.1

View File

@ -1,28 +1,27 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Bundle-SymbolicName: org.eclipse.jdt.core.compiler.batch
Export-Package: org.eclipse.jdt.core,org.eclipse.jdt.core.compiler,org
.eclipse.jdt.internal.antadapter;x-internal:=true,org.eclipse.jdt.int
ernal.compiler;x-internal:=true,org.eclipse.jdt.internal.compiler.apt
.dispatch;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.mode
l;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.util;x-inter
nal:=true,org.eclipse.jdt.internal.compiler.ast;x-internal:=true,org.
eclipse.jdt.internal.compiler.batch;x-internal:=true,org.eclipse.jdt.
internal.compiler.classfmt;x-internal:=true,org.eclipse.jdt.internal.
compiler.codegen;x-internal:=true,org.eclipse.jdt.internal.compiler.e
nv;x-internal:=true,org.eclipse.jdt.internal.compiler.flow;x-internal
:=true,org.eclipse.jdt.internal.compiler.impl;x-internal:=true,org.ec
lipse.jdt.internal.compiler.lookup;x-internal:=true,org.eclipse.jdt.i
nternal.compiler.parser;x-internal:=true,org.eclipse.jdt.internal.com
piler.parser.diagnose;x-internal:=true,org.eclipse.jdt.internal.compi
ler.problem;x-internal:=true,org.eclipse.jdt.internal.compiler.util;x
-internal:=true,org.eclipse.jdt.internal.compiler.tool;x-internal:=tr
ue
Bundle-Name: Eclipse Compiler for Java(TM)
Bundle-Version: 3.25.0.v20210223-0522
Bundle-ClassPath: .
Bundle-ManifestVersion: 2
Bundle-Vendor: Eclipse.org
Build-Jdk-Spec: 11
Created-By: Maven Archiver 3.5.0 Created-By: Maven Archiver 3.5.0
Build-Jdk-Spec: 11
Main-Class: org.eclipse.jdt.internal.compiler.batch.Main Main-Class: org.eclipse.jdt.internal.compiler.batch.Main
Bundle-ManifestVersion: 2
Bundle-Name: Eclipse Compiler for Java(TM)
Bundle-SymbolicName: org.eclipse.jdt.core.compiler.batch
Bundle-Version: 3.27.0.v20210823-1758
Bundle-ClassPath: .
Bundle-Vendor: Eclipse.org
Export-Package: org.eclipse.jdt.core,org.eclipse.jdt.core.compiler,org.e
clipse.jdt.internal.antadapter;x-internal:=true,org.eclipse.jdt.interna
l.compiler;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.dispa
tch;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.model;x-inte
rnal:=true,org.eclipse.jdt.internal.compiler.apt.util;x-internal:=true,
org.eclipse.jdt.internal.compiler.ast;x-internal:=true,org.eclipse.jdt.
internal.compiler.batch;x-internal:=true,org.eclipse.jdt.internal.compi
ler.classfmt;x-internal:=true,org.eclipse.jdt.internal.compiler.codegen
;x-internal:=true,org.eclipse.jdt.internal.compiler.env;x-internal:=tru
e,org.eclipse.jdt.internal.compiler.flow;x-internal:=true,org.eclipse.j
dt.internal.compiler.impl;x-internal:=true,org.eclipse.jdt.internal.com
piler.lookup;x-internal:=true,org.eclipse.jdt.internal.compiler.parser;
x-internal:=true,org.eclipse.jdt.internal.compiler.parser.diagnose;x-in
ternal:=true,org.eclipse.jdt.internal.compiler.problem;x-internal:=true
,org.eclipse.jdt.internal.compiler.util;x-internal:=true,org.eclipse.jd
t.internal.compiler.tool;x-internal:=true

View File

@ -1,65 +1,59 @@
Epoch: 1 Epoch: 1
%global qualifier R-4.19-202103031800 %global eclipse_ver 4.21
%global bundle_ver 3.27.0
%global jar_ver %{eclipse_ver}RC2a
%global drop S-%{jar_ver}-202109060500
Summary: Eclipse Compiler for Java Summary: Eclipse Compiler for Java
Name: ecj Name: ecj
Version: 4.19 Version: %{eclipse_ver}
Release: 3%{?dist} Release: 1%{?dist}
URL: https://www.eclipse.org URL: https://www.eclipse.org
License: EPL-2.0 License: EPL-2.0
Source0: https://download.eclipse.org/eclipse/downloads/drops4/%{qualifier}/ecjsrc-%{version}.jar Source0: https://download.eclipse.org/eclipse/downloads/drops4/%{drop}/ecjsrc-%{jar_ver}.jar
Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/3.25.0/ecj-3.25.0.pom Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/%{bundle_ver}/ecj-%{bundle_ver}.pom
# Extracted from https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/%%{qualifier}/ecj-%%{version}.jar # The ecj build does not generate a proper manifest, so use the one from the binary distribution
Source4: MANIFEST.MF # Extracted from: https://download.eclipse.org/eclipse/downloads/drops4/%%{drop}/ecj-%%{jar_ver}.jar
# Java API stubs for newer JDKs to allow us to build on the system default JDK Source2: MANIFEST.MF
# Fetched from https://github.com/eclipse/eclipse.jdt.core/blob/R4_18/org.eclipse.jdt.compiler.tool/lib/javax15api.jar # Provide API stubs for newer JDKs to allow us to build on the system default JDK where those APIs are not present
Source5: https://github.com/eclipse/eclipse.jdt.core/blob/R4_18/org.eclipse.jdt.compiler.tool/lib/javax15api.jar # Fetched from: https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/plain/org.eclipse.jdt.compiler.tool/lib/javax16api.jar?h=S4_21_0_RC2a
Source3: javax16api.jar
# Always generate debug info when building RPMs (Andrew Haley) # Always generate debug info when building RPMs (Andrew Haley)
Patch0: %{name}-rpmdebuginfo.patch Patch0: 0001-Always-generate-bytecode-debuginfo.patch
# Include java API stubs in build # Include java API stubs in build and fix misc other incorrect build flags
Patch1: javaAPI.patch Patch1: 0002-Fix-build-from-source.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: ant BuildRequires: ant
BuildRequires: javapackages-local BuildRequires: javapackages-local
# Build with Java 11 against bootclasspath of Java 8
BuildRequires: java-11-openjdk-devel BuildRequires: java-11-openjdk-devel
BuildRequires: java-1.8.0-openjdk-devel
%description %description
ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as
the JDT Core batch compiler. the JDT Core batch compiler.
%prep %prep
%setup -q -c %autosetup -p1 -c -n %{name}-%{eclipse_ver}
%patch0 -p1
%patch1
sed -i -e 's|debuglevel=\"lines,source\"|debug=\"yes\"|g' build.xml sed -i -e 's|debuglevel=\"lines,source\"|debug=\"yes\"|g' build.xml
cp %{SOURCE1} pom.xml cp %{SOURCE1} pom.xml
mkdir -p scripts/binary/META-INF/ mkdir -p scripts/binary/META-INF/
cp %{SOURCE4} scripts/binary/META-INF/MANIFEST.MF cp %{SOURCE2} scripts/binary/META-INF/MANIFEST.MF
rm ./META-INF/ECLIPSE_.{SF,RSA} rm ./META-INF/ECLIPSE_.{SF,RSA}
# Aliases # Aliases
%mvn_alias org.eclipse.jdt:ecj org.eclipse.jdt:core org.eclipse.jdt.core.compiler:ecj \ %mvn_alias org.eclipse.jdt:ecj org.eclipse.jdt:core org.eclipse.jdt.core.compiler:ecj \
org.eclipse.tycho:org.eclipse.jdt.core org.eclipse.tycho:org.eclipse.jdt.compiler.apt org.eclipse.tycho:org.eclipse.jdt.core org.eclipse.tycho:org.eclipse.jdt.compiler.apt
# Make Java API stubs available for other packages
%mvn_artifact "org.eclipse:javax15api:jar:15" %{SOURCE5}
%build %build
%if 0%{?rhel}
export JAVA_HOME=/usr/lib/jvm/java-11 export JAVA_HOME=/usr/lib/jvm/java-11
%endif ant -Djavaapi=%{SOURCE3}
ant -Djavaapi=%{SOURCE5}
%install %install
%mvn_artifact pom.xml ecj.jar %mvn_artifact pom.xml ecj.jar
@ -78,6 +72,10 @@ install -m 644 -p ecj.1 $RPM_BUILD_ROOT%{_mandir}/man1/ecj.1
%{_mandir}/man1/ecj* %{_mandir}/man1/ecj*
%changelog %changelog
* Wed Sep 15 2021 Mat Booth <mat.booth@gmail.com> - 1:4.21-1
- Update to latest upstream release
- Drop build requirement on Java 8, ecj now requires Java 11
* Wed Aug 25 2021 Stefan Bluhm <stefan.bluhm@clacee.eu> - 1:4.19-3 * Wed Aug 25 2021 Stefan Bluhm <stefan.bluhm@clacee.eu> - 1:4.19-3
- Added RHEL8 build. - Added RHEL8 build.

View File

@ -1,26 +0,0 @@
--- build.xml.orig 2018-03-20 15:15:57.063810672 +0000
+++ build.xml 2018-03-20 15:16:26.018700633 +0000
@@ -18,16 +18,20 @@
<property name="output" value="bin" />
<property name="jar_file" value="ecj.jar" />
+ <path id="build.path">
+ <pathelement path="${javaapi}"/>
+ <pathelement path="/usr/lib/jvm/java-1.8.0/jre/lib/rt.jar"/>
+ </path>
<target name="build">
<delete file="${basedir}/${jar_file}" failonerror="no" />
<delete dir="${output}" failonerror="no" />
<mkdir dir="${output}" />
- <javac srcdir="${basedir}" destdir="${output}"
- debuglevel="lines,source"
+ <javac srcdir="${basedir}" destdir="${output}" bootclasspathref="build.path"
+ debug="yes"
source="1.8"
target="1.8">
- <compilerarg line="-Xlint:none"/>
+ <compilerarg line="-Xlint:none -encoding cp1252"/>
</javac>
<delete file="${basedir}/META-INF/MANIFEST.MF" failonerror="false"/>

View File

@ -1,3 +1,3 @@
SHA512 (ecj-3.25.0.pom) = 38e527bb473dc5dba50cecb1e6f75f64b2a12c14bcfed018b2c76be8c0d45c9f9221bdb7291a071726f6239f2ae8c0eedb1b37e98c54d1e8e0ac495818fb49b3 SHA512 (ecj-3.27.0.pom) = 675ab0f5f9a5bb7cc7feb47d98de4623d19a57a89b89d8191e6f7f0e524aae423a7f7fead380b0a58bafab439295ce01eeb442823033d415ac890f6b3ea070a2
SHA512 (ecjsrc-4.19.jar) = 250afeb3a2997cab506f0e7c84410556222446064335e635ed32477e093761f4be422b767bce5085d2b04e34ac4d3fa743cf4be9d1b50b318556b0aa797ed000 SHA512 (ecjsrc-4.21RC2a.jar) = ab940d18f1d5fcbeef3b903a7d719ce6b1dd900d87be08f7a916d6a7d65d8b83b44332dea1642c8d75e2baac3ba8dc27faef659e365cee5f500db99aa9675ce7
SHA512 (javax15api.jar) = c1b16bff598301fa94cb50068350e006a249b5c71185c02113049af7c7b2afb298ef8651263221ed64a3282a0b515ab99cdd0fc44f94f606e9d859616ec2ef6b SHA512 (javax16api.jar) = 20bed38ea93b7cb91783333dce0023ce86e4d82a8b88950e3abced0ff6c3e086f3b13c25d6ae1674c8ddb8099be3925c7636ef262171b65e035088f61f5306b0