From ef52779993b56dd8029766e85933971f1fdd61689065276c4b6af05c88da237a Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Sep 2023 16:51:01 +0000 Subject: [PATCH 1/4] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=58 --- scala-2.10.7-jdk15.patch | 27 +++++++++++++++++++++++++++ scala-2.10.7-source6.patch | 4 ++-- scala.spec | 7 ++++--- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 scala-2.10.7-jdk15.patch diff --git a/scala-2.10.7-jdk15.patch b/scala-2.10.7-jdk15.patch new file mode 100644 index 0000000..f9e46c5 --- /dev/null +++ b/scala-2.10.7-jdk15.patch @@ -0,0 +1,27 @@ +--- scala-2.10.7/src/compiler/scala/tools/ant/antlib.xml 2023-09-28 18:35:06.147897841 +0200 ++++ scala-2.10.7/src/compiler/scala/tools/ant/antlib.xml 2023-09-28 18:47:47.202949642 +0200 +@@ -13,6 +13,4 @@ + classname="scala.tools.ant.ScalaTool"/> + +- + +Only in scala-2.10.7/src/compiler/scala/tools/ant: Pack200Task.scala +--- scala-2.10.7/src/library/scala/collection/mutable/StringBuilder.scala 2023-09-28 18:35:06.187898108 +0200 ++++ scala-2.10.7/src/library/scala/collection/mutable/StringBuilder.scala 2023-09-28 18:49:06.536809546 +0200 +@@ -437,6 +437,14 @@ + * @return the string assembled by this StringBuilder + */ + def result(): String = toString ++ ++ /** Tests whether this builder is empty. ++ * ++ * This method is required for JDK15+ compatibility ++ * ++ * @return `true` if this builder contains nothing, `false` otherwise. ++ */ ++ override def isEmpty: Boolean = underlying.length() == 0 + } + + object StringBuilder { diff --git a/scala-2.10.7-source6.patch b/scala-2.10.7-source6.patch index cb42a3e..7ac612f 100644 --- a/scala-2.10.7-source6.patch +++ b/scala-2.10.7-source6.patch @@ -7,7 +7,7 @@ Index: scala-2.10.7/build.xml classpath="${@{project}-classes}" includes="**/*.java" - target="1.6" source="1.5" -+ target="1.6" source="1.6" ++ target="1.8" source="1.8" compiler="javac1.6" includeantruntime="false" > @@ -16,7 +16,7 @@ Index: scala-2.10.7/build.xml excludes="@{excludes}" includeantruntime="false" - target="1.6" source="1.5"> -+ target="1.6" source="1.6"> ++ target="1.8" source="1.8"> diff --git a/scala.spec b/scala.spec index e30b4e9..331776f 100644 --- a/scala.spec +++ b/scala.spec @@ -60,6 +60,7 @@ Patch9: scala-2.10.6-scaladoc-resources.patch Patch10: scala-2.10.7-source6.patch Patch11: scala-2.10.7-lines.patch Patch12: scala-2.10.7-java8compat.patch +Patch13: scala-2.10.7-jdk15.patch BuildRequires: ant BuildRequires: ant-contrib BuildRequires: ant-junit @@ -69,9 +70,6 @@ BuildRequires: java-devel >= 1.7 BuildRequires: javapackages-local BuildRequires: jline >= 2.10 BuildRequires: junit -BuildConflicts: java >= 9 -BuildConflicts: java-devel >= 9 -BuildConflicts: java-headless >= 9 Requires: jansi Requires: java-headless >= 1.7 # Require full javapackages-tools since scripts use @@ -154,9 +152,12 @@ the Scala ant tasks. %patch10 -p1 -b .source6 %patch11 -p1 -b .jdk11 %patch12 -p1 -b .java8compat +%patch13 -p1 -b .jdk15 echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number +rm -f src/compiler/scala/tools/ant/Pack200Task.scala + pushd src rm -rf jline popd From 66a7b8f76b1d54b4b98e973183bf91a41255e62f685229de705c88068eb46927 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Sep 2023 16:51:42 +0000 Subject: [PATCH 2/4] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=59 --- scala-2.10.7-source6.patch => scala-2.10.7-source8.patch | 0 scala.spec | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename scala-2.10.7-source6.patch => scala-2.10.7-source8.patch (100%) diff --git a/scala-2.10.7-source6.patch b/scala-2.10.7-source8.patch similarity index 100% rename from scala-2.10.7-source6.patch rename to scala-2.10.7-source8.patch diff --git a/scala.spec b/scala.spec index 331776f..4e8fe28 100644 --- a/scala.spec +++ b/scala.spec @@ -57,7 +57,7 @@ Patch8: scala-2.10.4-build_xml.patch # Stop scaladoc from trying to bundle non-existent resources that were # removed due to being in object form only, whithout sources Patch9: scala-2.10.6-scaladoc-resources.patch -Patch10: scala-2.10.7-source6.patch +Patch10: scala-2.10.7-source8.patch Patch11: scala-2.10.7-lines.patch Patch12: scala-2.10.7-java8compat.patch Patch13: scala-2.10.7-jdk15.patch From 6a45c6ea8d27908fd1be230a12de7240ac1ed1fe0b76192450d39290ca9f412a Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Sep 2023 17:21:51 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=60 --- scala-2.10.4-build_xml.patch | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scala-2.10.4-build_xml.patch b/scala-2.10.4-build_xml.patch index 4649034..0cfa47b 100644 --- a/scala-2.10.4-build_xml.patch +++ b/scala-2.10.4-build_xml.patch @@ -55,7 +55,7 @@ -@@ -181,91 +180,57 @@ +@@ -181,91 +180,54 @@ @@ -182,9 +182,6 @@ + -+ + + From 7cf63fe3b11f44f29ad1db356ba4496cf62c92ebfb30d8ae2628d05aedf6f329 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 29 Sep 2023 06:49:51 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=61 --- scala.changes | 15 +++++++++++++++ scala.spec | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/scala.changes b/scala.changes index d616040..8257aee 100644 --- a/scala.changes +++ b/scala.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Sep 29 06:45:12 UTC 2023 - Fridrich Strba + +- Allow building with jdk >= 9 too +- Added patch: + * scala-2.10.7-jdk15.patch + + do not build pack200 ant task since Pack200 was removed in + jdk15 + + implement a new method added in jdk15 +- Modified patches: + * scala-2.10.4-build_xml.patch + + do not try to instantiate the pack200 ant task + * scala-2.10.7-source6.patch -> scala-2.10.7-source8.patch + + build with source/target 8 levels + ------------------------------------------------------------------- Mon Sep 11 13:07:40 UTC 2023 - Fridrich Strba diff --git a/scala.spec b/scala.spec index 4e8fe28..d390c53 100644 --- a/scala.spec +++ b/scala.spec @@ -66,12 +66,12 @@ BuildRequires: ant-contrib BuildRequires: ant-junit BuildRequires: aqute-bnd BuildRequires: graphviz -BuildRequires: java-devel >= 1.7 +BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local BuildRequires: jline >= 2.10 BuildRequires: junit Requires: jansi -Requires: java-headless >= 1.7 +Requires: java-headless >= 1.8 # Require full javapackages-tools since scripts use # /usr/share/java-utils/java-functions Requires: javapackages-tools @@ -113,7 +113,7 @@ reference and API documentation for the Scala programming language. Summary: The swing library for the Scala programming languages Group: Development/Libraries/Java Requires: %{name} = %{version}-%{release} -Requires: java >= 1.7 +Requires: java >= 1.8 BuildArch: noarch %if %{without bootstrap} Obsoletes: %{base_name}-bootstrap-swing