diff --git a/groovy18-amgiguous-function-calls.patch b/groovy18-amgiguous-function-calls.patch new file mode 100644 index 0000000..eff2f36 --- /dev/null +++ b/groovy18-amgiguous-function-calls.patch @@ -0,0 +1,38 @@ +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java 2022-03-21 09:20:24.640511870 +0100 +@@ -7425,7 +7425,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, T[] right) { +- return (T[]) plus(toList(left), toList(right)).toArray(); ++ return (T[]) plus((Collection)toList(left), (Collection)toList(right)).toArray(); + } + + /** +@@ -7443,7 +7443,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, T right) { +- return (T[]) plus(toList(left), right).toArray(); ++ return (T[]) plus((Collection)toList(left), right).toArray(); + } + + /** +@@ -7461,7 +7461,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, Collection right) { +- return (T[]) plus(toList(left), right).toArray(); ++ return (T[]) plus((Collection)toList(left), right).toArray(); + } + + /** +@@ -7483,7 +7483,7 @@ + */ + @SuppressWarnings("unchecked") + public static T[] plus(T[] left, Iterable right) { +- return (T[]) plus(toList(left), toList(right)).toArray(); ++ return (T[]) plus((Collection)toList(left), toList(right)).toArray(); + } + + /** diff --git a/groovy18-asm7.patch b/groovy18-asm7.patch new file mode 100644 index 0000000..4a77cf6 --- /dev/null +++ b/groovy18-asm7.patch @@ -0,0 +1,57 @@ +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ant/VerifyClass.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/ant/VerifyClass.java 2022-03-21 08:55:34.604198152 +0100 +@@ -119,23 +119,7 @@ + log("verifying of class " + clazz + " failed"); + } + if (verbose) log(method.name + method.desc); +- TraceMethodVisitor mv = new TraceMethodVisitor(null) { +- public void visitMaxs(int maxStack, int maxLocals) { +- StringBuffer buffer = new StringBuffer(); +- for (int i = 0; i < text.size(); ++i) { +- String s = frames[i] == null ? "null" : frames[i].toString(); +- while (s.length() < maxStack + maxLocals + 1) { +- s += " "; +- } +- buffer.append(Integer.toString(i + 100000).substring(1)); +- buffer.append(" "); +- buffer.append(s); +- buffer.append(" : "); +- buffer.append(text.get(i)); +- } +- if (verbose) log(buffer.toString()); +- } +- }; ++ TraceMethodVisitor mv = new TraceMethodVisitor(null); + for (int j = 0; j < method.instructions.size(); ++j) { + Object insn = method.instructions.get(j); + if (insn instanceof AbstractInsnNode) { +--- groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java 2013-02-15 09:42:29.000000000 +0100 ++++ groovy-core-GROOVY_1_8_9/src/main/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java 2022-03-21 08:58:16.241090031 +0100 +@@ -15,9 +15,10 @@ + */ + package org.codehaus.groovy.runtime.callsite; + ++import org.codehaus.groovy.reflection.SunClassLoader; + import org.objectweb.asm.ClassReader; ++import org.objectweb.asm.ClassVisitor; + import org.objectweb.asm.ClassWriter; +-import org.codehaus.groovy.reflection.SunClassLoader; + + import java.io.IOException; + import java.io.InputStream; +@@ -56,12 +57,13 @@ + private void loadAbstract() throws IOException { + final InputStream asStream = GroovySunClassLoader.class.getClass().getClassLoader().getResourceAsStream(resName("org.codehaus.groovy.runtime.callsite.AbstractCallSite")); + ClassReader reader = new ClassReader(asStream); +- final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS) { ++ final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); ++ final ClassVisitor cv = new ClassVisitor(4, cw) { + public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { + super.visit(version, access, name, signature, "sun/reflect/GroovyMagic", interfaces); + } + }; +- reader.accept(cw, ClassWriter.COMPUTE_MAXS); ++ reader.accept(cv, ClassWriter.COMPUTE_MAXS); + asStream.close(); + define(cw.toByteArray(), "org.codehaus.groovy.runtime.callsite.AbstractCallSite"); + } diff --git a/groovy18-sourcetarget.patch b/groovy18-sourcetarget.patch index b7dd888..2e1d30f 100644 --- a/groovy18-sourcetarget.patch +++ b/groovy18-sourcetarget.patch @@ -5,7 +5,7 @@ destdir="${targetDirectory}/tools" includeantruntime="false" - source="1.5" target="1.5" fork="true" classpathref="compilePath"/> -+ source="1.6" target="1.6" fork="true" classpathref="compilePath"/> ++ source="1.8" target="1.8" fork="true" classpathref="compilePath"/> @@ -14,7 +14,7 @@ -+ deprecation="on" debug="yes" source="1.6" target="1.6" fork="true" classpathref="compilePath"> ++ deprecation="on" debug="yes" source="1.8" target="1.8" fork="true" classpathref="compilePath"> - -+ ++ @@ -32,7 +32,7 @@ - -+ ++ @@ -42,7 +42,7 @@ - - -+ ++ @@ -52,8 +52,8 @@ destdir="${examplesClassesDirectory}" - source="1.5" - target="1.5" -+ source="1.6" -+ target="1.6" ++ source="1.8" ++ target="1.8" fork="true"> @@ -62,7 +62,7 @@ - -+ ++ @@ -71,7 +71,7 @@ + +- Modified patch: + * groovy18-sourcetarget.patch + + Build with source and target levels 8 +- Added patches: + * groovy18-amgiguous-function-calls.patch + + Cast to Collection to help compiler to resolve ambiguities + with new JDKs + * groovy18-asm7.patch + + Remove dependency on the old asm3 + ------------------------------------------------------------------- Mon Dec 16 09:21:49 UTC 2019 - Fridrich Strba diff --git a/groovy18.spec b/groovy18.spec index 9bb7cff..b46c17f 100644 --- a/groovy18.spec +++ b/groovy18.spec @@ -1,7 +1,7 @@ # # spec file for package groovy18 # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -40,12 +40,13 @@ Patch5: groovy18-sourcetarget.patch Patch6: groovy18-iterator.patch Patch7: groovy18-securitymanager.patch Patch8: groovy18-notarget.patch +Patch9: groovy18-amgiguous-function-calls.patch +Patch10: groovy18-asm7.patch BuildRequires: ant BuildRequires: ant-antlr BuildRequires: antlr BuildRequires: apache-commons-cli BuildRequires: apache-ivy -BuildRequires: asm3 BuildRequires: bsf BuildRequires: desktop-file-utils BuildRequires: fdupes @@ -57,6 +58,7 @@ BuildRequires: javapackages-local BuildRequires: jline1 BuildRequires: jpackage-utils BuildRequires: junit +BuildRequires: objectweb-asm BuildRequires: unzip BuildRequires: xmvn-install BuildRequires: xmvn-resolve @@ -131,6 +133,8 @@ cp %{SOURCE3} . %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 # build.xml is not compatible with Ant 1.10+ sed -i "s| depends=\"-excludeLegacyAntVersion\"||" build.xml @@ -138,6 +142,8 @@ sed -i "s| depends=\"-excludeLegacyAntVersion\"||" build.xml # We don't want to generate auto-R on optional dependencies %pom_xpath_replace "pom:dependency[pom:optional[text()='true']]/pom:scope" "provided" +%pom_change_dep asm::: org.ow2.asm::7.0: + # java 7 apis %pom_remove_dep org.livetribe:livetribe-jsr223 # explicit tomcat apis @@ -164,8 +170,8 @@ mkdir -p target/lib/{compile,tools} # Construct classpath build-jar-repository target/lib/compile glassfish-servlet-api glassfish-jsp-api/javax.servlet.jsp-api \ - asm3/asm-tree asm3/asm \ - asm3/asm-util asm3/asm-analysis \ + objectweb-asm/asm-tree objectweb-asm/asm \ + objectweb-asm/asm-util objectweb-asm/asm-analysis \ antlr ant/ant-antlr antlr \ bsf jline1/jline-1 xstream ant junit apache-ivy commons-cli \ jansi