Accepting request 1114251 from Java:packages

Allow buiding with jdk > 1.8.0

OBS-URL: https://build.opensuse.org/request/show/1114251
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/scala?expand=0&rev=11
This commit is contained in:
Ana Guerrero 2023-10-01 19:22:16 +00:00 committed by Git OBS Bridge
commit 21ce9efd1e
5 changed files with 53 additions and 13 deletions

View File

@ -55,7 +55,7 @@
<property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/> <property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/>
<!-- Sets location of build folders --> <!-- Sets location of build folders -->
@@ -181,91 +180,57 @@ @@ -181,91 +180,54 @@
</target> </target>
<target name="boot" depends="desired.jars.uptodate" unless="lib.jars.uptodate"> <target name="boot" depends="desired.jars.uptodate" unless="lib.jars.uptodate">
@ -182,9 +182,6 @@
+ <taskdef name="same" + <taskdef name="same"
+ classpathref="scalabootstrap.classpath" + classpathref="scalabootstrap.classpath"
+ classname="scala.tools.ant.Same"/> + classname="scala.tools.ant.Same"/>
+ <taskdef name="pack200"
+ classpathref="scalabootstrap.classpath"
+ classname="scala.tools.ant.Pack200Task"/>
+ +
+ <typedef resource="aQute/bnd/ant/taskdef.properties" + <typedef resource="aQute/bnd/ant/taskdef.properties"
+ classpath="/usr/share/java/aqute-bnd.jar" /> + classpath="/usr/share/java/aqute-bnd.jar" />

27
scala-2.10.7-jdk15.patch Normal file
View File

@ -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"/>
<taskdef name="same"
classname="scala.tools.ant.Same"/>
- <taskdef name="pack200"
- classname="scala.tools.ant.Pack200Task"/>
</antlib>
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 {

View File

@ -7,7 +7,7 @@ Index: scala-2.10.7/build.xml
classpath="${@{project}-classes}" classpath="${@{project}-classes}"
includes="**/*.java" includes="**/*.java"
- target="1.6" source="1.5" - target="1.6" source="1.5"
+ target="1.6" source="1.6" + target="1.8" source="1.8"
compiler="javac1.6" compiler="javac1.6"
includeantruntime="false" > includeantruntime="false" >
<compilerarg line="${javac.args} @{args}"/> <compilerarg line="${javac.args} @{args}"/>
@ -16,7 +16,7 @@ Index: scala-2.10.7/build.xml
excludes="@{excludes}" excludes="@{excludes}"
includeantruntime="false" includeantruntime="false"
- target="1.6" source="1.5"> - target="1.6" source="1.5">
+ target="1.6" source="1.6"> + target="1.8" source="1.8">
<compilerarg line="${javac.args} @{args}"/> <compilerarg line="${javac.args} @{args}"/>
<classpath refid="@{stage}.@{destproject}.build.path"/> <classpath refid="@{stage}.@{destproject}.build.path"/>
</javac> </javac>

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Fri Sep 29 06:45:12 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com> Mon Sep 11 13:07:40 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -57,23 +57,21 @@ Patch8: scala-2.10.4-build_xml.patch
# Stop scaladoc from trying to bundle non-existent resources that were # Stop scaladoc from trying to bundle non-existent resources that were
# removed due to being in object form only, whithout sources # removed due to being in object form only, whithout sources
Patch9: scala-2.10.6-scaladoc-resources.patch 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 Patch11: scala-2.10.7-lines.patch
Patch12: scala-2.10.7-java8compat.patch Patch12: scala-2.10.7-java8compat.patch
Patch13: scala-2.10.7-jdk15.patch
BuildRequires: ant BuildRequires: ant
BuildRequires: ant-contrib BuildRequires: ant-contrib
BuildRequires: ant-junit BuildRequires: ant-junit
BuildRequires: aqute-bnd BuildRequires: aqute-bnd
BuildRequires: graphviz BuildRequires: graphviz
BuildRequires: java-devel >= 1.7 BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local BuildRequires: javapackages-local
BuildRequires: jline >= 2.10 BuildRequires: jline >= 2.10
BuildRequires: junit BuildRequires: junit
BuildConflicts: java >= 9
BuildConflicts: java-devel >= 9
BuildConflicts: java-headless >= 9
Requires: jansi Requires: jansi
Requires: java-headless >= 1.7 Requires: java-headless >= 1.8
# Require full javapackages-tools since scripts use # Require full javapackages-tools since scripts use
# /usr/share/java-utils/java-functions # /usr/share/java-utils/java-functions
Requires: javapackages-tools Requires: javapackages-tools
@ -115,7 +113,7 @@ reference and API documentation for the Scala programming language.
Summary: The swing library for the Scala programming languages Summary: The swing library for the Scala programming languages
Group: Development/Libraries/Java Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: java >= 1.7 Requires: java >= 1.8
BuildArch: noarch BuildArch: noarch
%if %{without bootstrap} %if %{without bootstrap}
Obsoletes: %{base_name}-bootstrap-swing Obsoletes: %{base_name}-bootstrap-swing
@ -154,9 +152,12 @@ the Scala ant tasks.
%patch10 -p1 -b .source6 %patch10 -p1 -b .source6
%patch11 -p1 -b .jdk11 %patch11 -p1 -b .jdk11
%patch12 -p1 -b .java8compat %patch12 -p1 -b .java8compat
%patch13 -p1 -b .jdk15
echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number
rm -f src/compiler/scala/tools/ant/Pack200Task.scala
pushd src pushd src
rm -rf jline rm -rf jline
popd popd