update to 4.34

use prebuilt jar; specfile updates; closes #1 [release 4.34-1mamba;Thu Dec 05 2024]
This commit is contained in:
Silvan Calarco 2024-12-05 22:27:36 +01:00
parent c1c6f0232e
commit 5bc50da961
4 changed files with 18 additions and 127 deletions

View File

@ -1,82 +1,39 @@
%define pkgdate 202411201800
Name: eclipse-ecj Name: eclipse-ecj
Version: 4.7.2 Version: 4.34
Release: 1mamba Release: 1mamba
Summary: Eclipse Compiler for Java Summary: Eclipse Compiler for Java
Group: Development/Languages Group: Development/Languages
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Automatic Build System <autodist@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.eclipse.org URL: https://www.eclipse.org/
#Source: http://mirrors.ibiblio.org/eclipse/eclipse/downloads/drops4/R-%{version}-201309111000/ecjsrc-%{version}.jar Source: https://archive.eclipse.org/eclipse/downloads/drops4/R-%{version}-%{pkgdate}/ecj-%{version}.jar
Source: http://ftp.fau.de/eclipse/eclipse/downloads/drops4/R-%{version}-201711300510/ecjsrc-%{version}.jar
#Source: ftp://rm.mirror.garr.it/mirrors/eclipse/eclipse/downloads/drops/R-%{version}-201002111343/ecjsrc-%{version}.zip
#Source: http://download.eclipse.org/eclipse/downloads/drops/R-%{version}-200906111540/ecjsrc-%{version}.zip
Source1: java-ecj.sh.in Source1: java-ecj.sh.in
# cvs -d:pserver:anonymous@sourceware.org:/cvs/rhug export -r eclipse_r34_1 eclipse-gcj License: EPL-2.0
# tar cjf java-ecj-gcj.tar.bz2 eclipse-gcj ## AUTOBUILDREQ-BEGIN
Source2: java-ecj-gcj.tar.bz2 ## AUTOBUILDREQ-END
Source3: jdtcoresrc.tar.gz
Patch0: java-ecj-3.4.2-rpmdebuginfo.patch
Patch1: java-ecj-3.4.2-defaultto1.5.patch
Patch2: java-ecj-3.4.2-generatedebuginfo.patch
License: Eclipse Public License
BuildRequires: apache-ant
BuildRequires: java-gcj-compat
BuildRequires: java-junit3
BuildRequires: jpackage-utils BuildRequires: jpackage-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as the JDT Core batch compiler. ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as the JDT Core batch compiler.
%prep %prep
%setup -q -c -n %{name}-%{version}
%patch0 -p1
#%patch1 -p1
#%patch2 -p1
tar jxf %{S:2}
tar zxf %{S:3}
# Use ECJ for GCJ's bytecode compiler
mv eclipse-gcj/org/eclipse/jdt/internal/compiler/batch/GCCMain.java org/eclipse/jdt/internal/compiler/batch/
cat eclipse-gcj/gcc.properties >> org/eclipse/jdt/internal/compiler/batch/messages.properties
rm -rf eclipse-gcj
# JDTCompilerAdapter isn't used by the batch compiler
rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java
%build %build
ORIGCLASSPATH=$CLASSPATH
ant -DcompilerArg="-encoding ISO-8859-1 -nowarn" -buildfile jdtcoresrc/compilejdtcorewithjavac.xml
# 2. Use this ecj to rebuild itself
export CLASSPATH=`pwd`/jdtcoresrc/ecj.jar:$ORIGCLASSPATH
ant -DcompilerArg="-encoding ISO-8859-1 -nowarn" -buildfile jdtcoresrc/compilejdtcore.xml
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir} install -D -m644 %{SOURCE0} %{buildroot}%{_javadir}/ecj-%{version}.jar
install -m 644 ecj.jar %{buildroot}%{_javadir}/ecj-%{version}.jar
mkdir -p %{buildroot}/opt/java/ant/lib ln -s ecj-%{version}.jar %{buildroot}%{_javadir}/eclipse-ecj-%{version}.jar
ln -s eclipse-ecj-%{version}.jar %{buildroot}%{_javadir}/eclipse-ecj.jar
ln -s ecj-%{version}.jar %{buildroot}%{_javadir}/jdtcore.jar
pushd %{buildroot}%{_javadir} install -D -m755 %{SOURCE1} %{buildroot}%{_bindir}/ecj
# ln -s ecj-%{version}.jar ecj.jar
ln -s ecj-%{version}.jar eclipse-ecj-%{version}.jar
ln -s eclipse-ecj-%{version}.jar eclipse-ecj.jar
ln -s ecj-%{version}.jar jdtcore.jar
ln -s ecj-%{version}.jar %{buildroot}/opt/java/ant/lib/ecj-%{version}.jar
popd
mkdir -p %{buildroot}%{_bindir}
install -pm 755 %{S:1} \
%{buildroot}%{_bindir}/ecj
sed -i "s:@JAVADIR@:%{_javadir}:" %{buildroot}%{_bindir}/ecj sed -i "s:@JAVADIR@:%{_javadir}:" %{buildroot}%{_bindir}/ecj
#%{_bindir}/aot-compile-rpm
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -84,14 +41,15 @@ sed -i "s:@JAVADIR@:%{_javadir}:" %{buildroot}%{_bindir}/ecj
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/ecj %{_bindir}/ecj
%{_javadir}/ecj-%{version}.jar %{_javadir}/ecj-%{version}.jar
#%{_javadir}/ecj.jar
%{_javadir}/eclipse-ecj-%{version}.jar %{_javadir}/eclipse-ecj-%{version}.jar
%{_javadir}/eclipse-ecj.jar %{_javadir}/eclipse-ecj.jar
%{_javadir}/jdtcore.jar %{_javadir}/jdtcore.jar
/opt/java/ant/lib/ecj-%{version}.jar
%doc about.html
%changelog %changelog
* Thu Dec 05 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 4.34-1mamba
- update to 4.34
- use prebuilt jar; specfile updates; closes #1
* Sat Dec 23 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.2-1mamba * Sat Dec 23 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 4.7.2-1mamba
- update to 4.7.2 - update to 4.7.2

View File

@ -1,15 +0,0 @@
--- java-ecj-3.4.2/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 2008-04-14 15:41:34.000000000 +0200
+++ java-ecj-3.4.2/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java-gil 2009-03-13 05:07:28.000000000 +0100
@@ -253,9 +253,9 @@
// By default only lines and source attributes are generated.
public int produceDebugAttributes = ClassFileConstants.ATTR_SOURCE | ClassFileConstants.ATTR_LINES;
- public long complianceLevel = ClassFileConstants.JDK1_4; // by default be compliant with 1.4
- public long sourceLevel = ClassFileConstants.JDK1_3; //1.3 source behavior by default
- public long targetJDK = ClassFileConstants.JDK1_2; // default generates for JVM1.2
+ public long complianceLevel = ClassFileConstants.JDK1_5; // by default be compliant with 1.4
+ public long sourceLevel = ClassFileConstants.JDK1_5; //1.3 source behavior by default
+ public long targetJDK = ClassFileConstants.JDK1_5; // default generates for JVM1.2
// source encoding format
public String defaultEncoding = null; // will use the platform default encoding

View File

@ -1,20 +0,0 @@
--- java-ecj-3.4.2/build.xml 2007-02-23 15:17:54.000000000 +0100
+++ java-ecj-3.4.2/build.xml-gil 2009-03-13 05:13:49.000000000 +0100
@@ -10,7 +10,7 @@
<mkdir dir="${output}" />
<javac srcdir="${basedir}" destdir="${output}"
- debuglevel="lines,source"
+ debug="yes"
source="1.3"
target="1.2"
excludes="org/eclipse/jdt/internal/compiler/tool/*,**/apt/**">
@@ -18,7 +18,7 @@
</javac>
<javac destdir="${output}"
- debuglevel="lines,source"
+ debug="yes"
source="1.6"
target="1.6"
includes="org/eclipse/jdt/internal/compiler/tool/*">

View File

@ -1,32 +0,0 @@
--- java-ecj-3.4.2/org/eclipse/jdt/internal/compiler/batch/Main.java 2008-04-21 11:01:00.000000000 +0200
+++ java-ecj-3.4.2/org/eclipse/jdt/internal/compiler/batch/Main.java-gil 2009-03-13 05:20:09.000000000 +0100
@@ -2609,6 +2609,29 @@
this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
}
+ {
+ // If we're building an RPM, force full debugging info to
+ // be generated, no matter what options have been passed
+ // by Ant. This is something of a kludge, but it is far
+ // better than the alternative, which is having class
+ // files with debug info mysteriously missing.
+
+ String RpmPackageName = System.getenv("RPM_PACKAGE_NAME");
+ String RpmArch = System.getenv("RPM_ARCH");
+ String RpmBuildRoot = System.getenv("RPM_BUILD_ROOT");
+ if (RpmPackageName != null && RpmArch != null && RpmBuildRoot != null) {
+ this.options.put(
+ CompilerOptions.OPTION_LocalVariableAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_LineNumberAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_SourceFileAttribute,
+ CompilerOptions.GENERATE);
+ }
+ }
+
this.logger.logCommandLineArguments(newCommandLineArgs);
this.logger.logOptions(this.options);