diff --git a/0001-Always-generate-bytecode-debuginfo.patch b/0001-Always-generate-bytecode-debuginfo.patch new file mode 100644 index 0000000..6bc2c92 --- /dev/null +++ b/0001-Always-generate-bytecode-debuginfo.patch @@ -0,0 +1,47 @@ +From e7ff390ef777bd818ccc6e6f8f3a56f36020abfe Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Wed, 15 Sep 2021 10:21:53 +0100 +Subject: [PATCH 1/2] Always generate bytecode debuginfo + +When ecj is used to build RPMs +--- + .../jdt/internal/compiler/batch/Main.java | 23 +++++++++++++++++++ + 1 file changed, 23 insertions(+) + +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); + } + ++ { ++ // 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); + +-- +2.31.1 + diff --git a/ecj-3.29.0.pom b/ecj-3.29.0.pom new file mode 100644 index 0000000..537fbeb --- /dev/null +++ b/ecj-3.29.0.pom @@ -0,0 +1,47 @@ + + + + 4.0.0 + org.eclipse.jdt + ecj + 3.29.0 + Eclipse Compiler for Java(TM) + Eclipse Compiler for Java(TM) + http://www.eclipse.org/jdt + + + Eclipse Public License - v 2.0 + https://www.eclipse.org/legal/epl-2.0/ + repo + + + + Eclipse Foundation + http://www.eclipse.org/ + + + Bugzilla + https://bugs.eclipse.org/ + + + scm:git:https://git.eclipse.org/r/jdt/eclipse.jdt.core.git + https://git.eclipse.org/c/jdt/eclipse.jdt.core.git + + + + https://projects.eclipse.org/projects/eclipse.jdt/who + + + diff --git a/ecj-4.9.pom b/ecj-4.9.pom deleted file mode 100644 index 0155a2d..0000000 --- a/ecj-4.9.pom +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - org.eclipse.jdt.core.compiler - ecj - 4.9 - jar - Eclipse ECJ - Eclipse JDT Core Batch Compiler - http://www.eclipse.org/jdt/ - - UTF-8 - UTF-8 - 1.8 - 1.8 - - - - Eclipse Public License v1.0 - http://www.eclipse.org/org/documents/epl-v10.php - repo - - - - http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/ - :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse - - - - - Ralph Schaer - ralphschaer@gmail.com - - - - - - org.apache.ant - ant - 1.9.4 - true - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.3 - - -Xdoclint:none - - - - - - diff --git a/ecj.sh.in b/ecj.sh.in deleted file mode 100644 index d8a40e9..0000000 --- a/ecj.sh.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -CLASSPATH=$(build-classpath ecj):${CLASSPATH=.} \ -java org.eclipse.jdt.internal.compiler.batch.Main "$@" diff --git a/ecj.spec b/ecj.spec index 4fde71d..e817455 100644 --- a/ecj.spec +++ b/ecj.spec @@ -1,22 +1,23 @@ Epoch: 1 +%global bundle_ver 3.29.0 + Name: ecj -Version: 4.9 -Release: 3 +Version: 4.23 +Release: 1 Summary: the Eclipse Compiler for Java License: EPL-2.0 URL: http://www.eclipse.org -Source0: http://download.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/ecjsrc-4.9.jar -Source1: ecj.sh.in -Source3: https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/%{version}/ecj-%{version}.pom -Source4: MANIFEST.MF -Source5: java10api.jar +Source0: https://download.eclipse.org/eclipse/downloads/drops4/R-%{version}-202203080310/ecjsrc-%{version}.jar +Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/%{bundle_ver}/ecj-%{bundle_ver}.pom +Source2: MANIFEST.MF -Patch0: javaAPI.patch +Patch0: 0001-Always-generate-bytecode-debuginfo.patch BuildArch: noarch BuildRequires: ant javapackages-local +BuildRequires: java-11-openjdk-devel %description ECJ is the the Eclipse Compiler for Java. It is also known as the JDT Core batch compiler. @@ -26,31 +27,24 @@ ECJ is the the Eclipse Compiler for Java. It is also known as the JDT Core batc %prep %autosetup -c -n %{name}-%{version} -p1 -sed -i -e 's|debuglevel=\"lines,source\"|debug=\"yes\"|g' build.xml sed -i -e "s/Xlint:none/Xlint:none -encoding cp1252/g" build.xml rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java -cp %{SOURCE3} pom.xml +cp %{SOURCE1} pom.xml mkdir -p scripts/binary/META-INF/ -cp %{SOURCE4} scripts/binary/META-INF/MANIFEST.MF +cp %{SOURCE2} scripts/binary/META-INF/MANIFEST.MF -%pom_remove_dep org.apache.ant:ant - -%mvn_file :ecj ecj jdtcore -%mvn_alias org.eclipse.jdt.core.compiler:ecj org.eclipse.jdt:core org.eclipse.jdt: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 -%mvn_artifact "org.eclipse:java10api:jar:10" %{SOURCE5} -%mvn_alias "org.eclipse:java10api:jar:10" "org.eclipse:java9api:jar:9" %build -ant -Djavaapi=%{SOURCE5} +export JAVA_HOME=/usr/lib/jvm/java-11 +ant %install %mvn_artifact pom.xml ecj.jar %mvn_install -sed -i 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/f2f42549-cfab-4d71-be48-5e9f9a41e5f5/g' $(find %{_buildrootdir} -name ecj.xml) - -install -p -D -m0755 %{SOURCE1} %{buildroot}%{_bindir}/ecj +%jpackage_script org.eclipse.jdt.internal.compiler.batch.Main '' '' ecj ecj true mkdir -p %{buildroot}%{_mandir}/man1 install -m 644 -p ecj.1 %{buildroot}%{_mandir}/man1/ecj.1 @@ -64,5 +58,8 @@ install -m 644 -p ecj.1 %{buildroot}%{_mandir}/man1/ecj.1 %{_mandir}/man1/ecj* %changelog +* Wed May 18 2022 chenchen - 1:4.23-1 +- update to 4.23 + * Wed Dec 4 2019 openEuler Buildteam - 1:4.9-3 - Package init diff --git a/ecjsrc-4.23.jar b/ecjsrc-4.23.jar new file mode 100644 index 0000000..9b0a8be Binary files /dev/null and b/ecjsrc-4.23.jar differ diff --git a/ecjsrc-4.9.jar b/ecjsrc-4.9.jar deleted file mode 100644 index a48d6a2..0000000 Binary files a/ecjsrc-4.9.jar and /dev/null differ diff --git a/java10api.jar b/java10api.jar deleted file mode 100644 index 464b691..0000000 Binary files a/java10api.jar and /dev/null differ diff --git a/javaAPI.patch b/javaAPI.patch deleted file mode 100644 index 71de2e4..0000000 --- a/javaAPI.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/build.xml.orig 2018-03-20 15:15:57.063810672 +0000 -+++ b/build.xml 2018-03-20 15:16:26.018700633 +0000 -@@ -15,16 +15,20 @@ - - - -+ -+ -+ -+ - - - - - -- -- -+ - - -