From 4235d915eca43761493a1fa9d0707cf08f1bcf0a18ebe55fefc684943a4178e6 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 06:39:04 +0000 Subject: [PATCH 01/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=10 --- scala.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala.spec b/scala.spec index 941324c..57a8037 100644 --- a/scala.spec +++ b/scala.spec @@ -1,7 +1,7 @@ # # spec file for package scala # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -207,7 +207,7 @@ chmod 755 tools/get-scala-* export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" -ant build docs || exit 1 +%ant build docs || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ From 930222e5b7aa9771cbdcc3bc17ef8fc7a0a407d0f0bba31b320e9f24e1e9c1f2 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 07:35:19 +0000 Subject: [PATCH 02/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=11 --- _constraints | 10 ++++++++++ scala.spec | 11 ----------- 2 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 _constraints diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..8090e70 --- /dev/null +++ b/_constraints @@ -0,0 +1,10 @@ + + + + 4096 + + + 6 + + + diff --git a/scala.spec b/scala.spec index 57a8037..50fc0b3 100644 --- a/scala.spec +++ b/scala.spec @@ -282,17 +282,6 @@ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot install -d %{buildroot}%{_mandir}/man1 install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 -%post -touch --no-create %{_datadir}/mime/packages >/dev/null 2>&1 || : - -%postun -if [ $1 -eq 0 ]; then -update-mime-database %{_datadir}/mime >/dev/null 2>&1 || : -fi - -%posttrans -update-mime-database %{?fedora:-n} %{_datadir}/mime >/dev/null 2>&1 || : - %files -f .mfiles %{_bindir}/* %dir %{_datadir}/%{base_name} From f0514a4f19e317f00acca4f387f9ec208b7f91f36fbbb91bf8f420564beeac6c Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 08:12:30 +0000 Subject: [PATCH 03/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=12 --- scala.spec | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scala.spec b/scala.spec index 50fc0b3..abcc0fa 100644 --- a/scala.spec +++ b/scala.spec @@ -90,11 +90,9 @@ Requires: jline >= 2.10 BuildArch: noarch %if %{with bootstrap} Name: %{base_name}-bootstrap -Provides: %{base_name} %else Name: %{base_name} -BuildRequires: %{base_name} -Provides: %{base_name}-bootstrap +BuildRequires: %{base_name}-bootstrap Obsoletes: %{base_name}-bootstrap %endif @@ -169,23 +167,25 @@ sed -i '/is not supported by/d' build.xml sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} -%global do_bootstrap -DdoBootstrapBuild=yes +%global do_bootstrap -DdoBootstrapBuild=yes -Dlocker.skip=1 +%global docs_target %{nil} tar -xzvf %{SOURCE2} %if %{want_jdk8} tar -xzvf %{SOURCE4} --strip-components=1 scala-2.10.4/lib %endif %else %global do_bootstrap %{nil} +%global docs_target docs %endif pushd lib %if %{without bootstrap} rm -rf scala-compiler.jar - ln -s $(build-classpath scala/scala-compiler.jar) scala-compiler.jar + ln -s $(find-jar scala/scala-compiler) scala-compiler.jar rm -rf scala-library.jar - ln -s $(build-classpath scala/scala-library.jar) scala-library.jar + ln -s $(find-jar scala/scala-library) scala-library.jar rm -rf scala-reflect.jar - ln -s $(build-classpath scala/scala-reflect.jar) scala-reflect.jar + ln -s $(find-jar scala/scala-reflect) scala-reflect.jar %endif pushd ant rm -rf ant.jar @@ -207,7 +207,7 @@ chmod 755 tools/get-scala-* export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" -%ant build docs || exit 1 +%ant build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ @@ -279,8 +279,10 @@ install -p -m 644 %{SOURCE23} %{buildroot}%{_datadir}/mime/packages/ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot}%{_bindir}/* +%if %{without bootstrap} install -d %{buildroot}%{_mandir}/man1 install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 +%endif %files -f .mfiles %{_bindir}/* @@ -290,7 +292,9 @@ install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 %exclude %{_datadir}/%{base_name}/lib/scala-swing.jar %{_datadir}/mime-info %{_datadir}/mime/packages/* +%if %{without bootstrap} %{_mandir}/man1/* +%endif %license docs/LICENSE %files swing -f .mfiles-swing @@ -303,8 +307,10 @@ install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 %config %{_sysconfdir}/ant.d/* %license docs/LICENSE +%if %{without bootstrap} %files apidoc %doc build/scaladoc/library/* %license docs/LICENSE +%endif %changelog From f2a95938341477ecf0501b276ce105de043ab62723dd22c3b425190214b15a5e Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 08:57:19 +0000 Subject: [PATCH 04/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=13 --- scala.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala.spec b/scala.spec index abcc0fa..4f20701 100644 --- a/scala.spec +++ b/scala.spec @@ -205,9 +205,9 @@ chmod 755 tools/get-scala-* %build -export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" +export ANT_OPTS="%{do_bootstrap}" -%ant build %{docs_target} || exit 1 +%ant -v build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ From ab14ebb0866915f556348322cb238cc6133243190ab8d67037046893fe2a2b6e Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 09:08:43 +0000 Subject: [PATCH 05/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=14 --- scala.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scala.spec b/scala.spec index 4f20701..d6fde25 100644 --- a/scala.spec +++ b/scala.spec @@ -167,7 +167,7 @@ sed -i '/is not supported by/d' build.xml sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} -%global do_bootstrap -DdoBootstrapBuild=yes -Dlocker.skip=1 +%global do_bootstrap -DdoBootstrapBuild=yes -Dlocker.skip=1 -Dscalac.args=-verbose %global docs_target %{nil} tar -xzvf %{SOURCE2} %if %{want_jdk8} @@ -205,9 +205,9 @@ chmod 755 tools/get-scala-* %build -export ANT_OPTS="%{do_bootstrap}" +export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" -%ant -v build %{docs_target} || exit 1 +%ant build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ From b1ee24d91408b0b710eac31b9ac52cd4a6f8bf5d193207a41c6557f381583598 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 10:53:48 +0000 Subject: [PATCH 06/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=15 --- scala.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scala.spec b/scala.spec index d6fde25..12e37f8 100644 --- a/scala.spec +++ b/scala.spec @@ -22,6 +22,9 @@ %else %bcond_with bootstrap %endif +%{!?aarch64:%global aarch64 aarch64 arm64 armv8} +# Sync the list of jit architectures with java-1_8_0-openjdk package +%global jit_arches %{ix86} x86_64 ppc64 ppc64le %{aarch64} %{arm} %global fullversion %{version} %global release_repository http://nexus.scala-tools.org/content/repositories/releases %global snapshot_repository http://nexus.scala-tools.org/content/repositories/snapshots @@ -93,6 +96,7 @@ Name: %{base_name}-bootstrap %else Name: %{base_name} BuildRequires: %{base_name}-bootstrap +Provides: %{base_name}-bootstrap Obsoletes: %{base_name}-bootstrap %endif @@ -167,7 +171,7 @@ sed -i '/is not supported by/d' build.xml sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} -%global do_bootstrap -DdoBootstrapBuild=yes -Dlocker.skip=1 -Dscalac.args=-verbose +%global do_bootstrap -DdoBootstrapBuild=yes %global docs_target %{nil} tar -xzvf %{SOURCE2} %if %{want_jdk8} @@ -207,7 +211,14 @@ chmod 755 tools/get-scala-* export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" -%ant build %{docs_target} || exit 1 +# Add the -verbose flag to scalac on zero architectures. The build +# is slow, OBS thinks it is stuck and kills it before it has chance +# to finish +%ant \ +%ifnarch %{jit_arches} + -Dscalac.args=-verbose \ +%endif + build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ From ee297bf3907277771464f28e030895560ea7d4743dcdc06b07404e56b10192a6 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 10:56:22 +0000 Subject: [PATCH 07/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=16 --- scala.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scala.spec b/scala.spec index 12e37f8..e9e35f1 100644 --- a/scala.spec +++ b/scala.spec @@ -93,9 +93,10 @@ Requires: jline >= 2.10 BuildArch: noarch %if %{with bootstrap} Name: %{base_name}-bootstrap +Provides: %{base_name} %else Name: %{base_name} -BuildRequires: %{base_name}-bootstrap +BuildRequires: %{base_name} Provides: %{base_name}-bootstrap Obsoletes: %{base_name}-bootstrap %endif From e66c5918e92f8da7aa4c399990986d45e142792962207913a563c3d5060d334e Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 10:58:59 +0000 Subject: [PATCH 08/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=17 --- scala.changes | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scala.changes b/scala.changes index ac92dc1..822fce9 100644 --- a/scala.changes +++ b/scala.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Nov 26 10:56:50 UTC 2019 - Fridrich Strba + +- Do not build api documentation in bootstrap flavour +- Be extra verbose when running with a ZERO VM + * The build is long and OBS needs some compiler output in order + to know that the job is not dead +- Remove obsolete scriptlets + ------------------------------------------------------------------- Mon Mar 25 13:30:12 UTC 2019 - Fridrich Strba From 3b1d584285afa0665c635f8ccc237e3e07eef6143272b4911a533dae886305ea Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 11:00:33 +0000 Subject: [PATCH 09/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=18 --- _constraints | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 _constraints diff --git a/_constraints b/_constraints deleted file mode 100644 index 8090e70..0000000 --- a/_constraints +++ /dev/null @@ -1,10 +0,0 @@ - - - - 4096 - - - 6 - - - From aff601a2f6d6a4b1da3d7172c66da9138d33f9db0a9aaea8f8d875edf6e96bf6 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 11:08:28 +0000 Subject: [PATCH 10/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=19 --- scala.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scala.spec b/scala.spec index e9e35f1..ea1b7fc 100644 --- a/scala.spec +++ b/scala.spec @@ -216,7 +216,8 @@ export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" # is slow, OBS thinks it is stuck and kills it before it has chance # to finish %ant \ -%ifnarch %{jit_arches} +%ifarch %{jit_arches} +%else -Dscalac.args=-verbose \ %endif build %{docs_target} || exit 1 From 0d61397c9c0d7e4ea5ba0a311b594917f44f343a92b376a1316c1af8228e516b Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 26 Nov 2019 11:13:45 +0000 Subject: [PATCH 11/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=20 --- scala.changes | 7 ++++--- scala.spec | 6 ------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/scala.changes b/scala.changes index 822fce9..118069c 100644 --- a/scala.changes +++ b/scala.changes @@ -2,9 +2,10 @@ Tue Nov 26 10:56:50 UTC 2019 - Fridrich Strba - Do not build api documentation in bootstrap flavour -- Be extra verbose when running with a ZERO VM - * The build is long and OBS needs some compiler output in order - to know that the job is not dead +- Be extra verbose for the scalac build + * The build is long on non-JIT architectures and OBS needs some + compiler output in order to know that the job is not dead; + otherwise it kills it. - Remove obsolete scriptlets ------------------------------------------------------------------- diff --git a/scala.spec b/scala.spec index ea1b7fc..9f1f9e1 100644 --- a/scala.spec +++ b/scala.spec @@ -22,9 +22,6 @@ %else %bcond_with bootstrap %endif -%{!?aarch64:%global aarch64 aarch64 arm64 armv8} -# Sync the list of jit architectures with java-1_8_0-openjdk package -%global jit_arches %{ix86} x86_64 ppc64 ppc64le %{aarch64} %{arm} %global fullversion %{version} %global release_repository http://nexus.scala-tools.org/content/repositories/releases %global snapshot_repository http://nexus.scala-tools.org/content/repositories/snapshots @@ -216,10 +213,7 @@ export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" # is slow, OBS thinks it is stuck and kills it before it has chance # to finish %ant \ -%ifarch %{jit_arches} -%else -Dscalac.args=-verbose \ -%endif build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no From 465ac563e1567a0f68769163a451c397017eb18d6e03db8cfb325dfd61efbb57 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 27 Nov 2019 05:25:08 +0000 Subject: [PATCH 12/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=21 --- scala.changes | 2 ++ scala.spec | 22 +--------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/scala.changes b/scala.changes index 118069c..8ec35a5 100644 --- a/scala.changes +++ b/scala.changes @@ -6,6 +6,8 @@ Tue Nov 26 10:56:50 UTC 2019 - Fridrich Strba * The build is long on non-JIT architectures and OBS needs some compiler output in order to know that the job is not dead; otherwise it kills it. +- Do not build apidocs to avoid intermittent internal scaladoc + errors after hours of build on s390x - Remove obsolete scriptlets ------------------------------------------------------------------- diff --git a/scala.spec b/scala.spec index 9f1f9e1..6537408 100644 --- a/scala.spec +++ b/scala.spec @@ -104,18 +104,6 @@ common programming patterns in a concise and type-safe way. It integrates features of object-oriented and functional languages. It is also interoperable with Java. -%package apidoc -Summary: Documentation for the Scala programming language -Group: Documentation/HTML -%if %{without bootstrap} -Obsoletes: %{base_name}-bootstrap-apidoc -%endif - -%description apidoc -Scala is a general purpose programming language for the JVM that blends -object-oriented and functional programming. This package provides -reference and API documentation for the Scala programming language. - %package swing Summary: The swing library for the Scala programming languages Group: Development/Libraries/Java @@ -170,14 +158,12 @@ sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} %global do_bootstrap -DdoBootstrapBuild=yes -%global docs_target %{nil} tar -xzvf %{SOURCE2} %if %{want_jdk8} tar -xzvf %{SOURCE4} --strip-components=1 scala-2.10.4/lib %endif %else %global do_bootstrap %{nil} -%global docs_target docs %endif pushd lib @@ -214,7 +200,7 @@ export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" # to finish %ant \ -Dscalac.args=-verbose \ - build %{docs_target} || exit 1 + build || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ @@ -314,10 +300,4 @@ install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 %config %{_sysconfdir}/ant.d/* %license docs/LICENSE -%if %{without bootstrap} -%files apidoc -%doc build/scaladoc/library/* -%license docs/LICENSE -%endif - %changelog From 508864a4e75e80ffd95a8008b81e1bd9f25070e578305b01d80c2be4ab720c53 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 27 Nov 2019 06:09:04 +0000 Subject: [PATCH 13/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=22 --- scala.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scala.spec b/scala.spec index 6537408..4e2a595 100644 --- a/scala.spec +++ b/scala.spec @@ -272,11 +272,6 @@ install -p -m 644 %{SOURCE23} %{buildroot}%{_datadir}/mime/packages/ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot}%{_bindir}/* -%if %{without bootstrap} -install -d %{buildroot}%{_mandir}/man1 -install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 -%endif - %files -f .mfiles %{_bindir}/* %dir %{_datadir}/%{base_name} @@ -285,9 +280,6 @@ install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 %exclude %{_datadir}/%{base_name}/lib/scala-swing.jar %{_datadir}/mime-info %{_datadir}/mime/packages/* -%if %{without bootstrap} -%{_mandir}/man1/* -%endif %license docs/LICENSE %files swing -f .mfiles-swing From aadf5889d57da7bf3780fccb71b6763053fdc161218017ecefa5466b8fe4c36b Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 14:34:16 +0000 Subject: [PATCH 14/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=23 --- _service | 19 +++++ generate-tarball.sh | 26 ------- get-source.sh | 21 ----- scala-2.10-jline.patch | 40 ++++------ scala-2.10.3-bootstrap.tgz | 3 - scala-2.10.4.tgz | 3 - scala-2.10.6.tar.gz | 3 - scala-2.10.7-jdk11.patch | 147 +++++++++++++++++++++++++++++++++++ scala-2.10.7-source6.patch | 20 +++++ scala-2.10.7.tar.xz | 3 + scala-2.10.7.tgz | 3 + scala-bootstript.xml | 152 ------------------------------------- scala.changes | 14 ++++ scala.gitinfo | 4 +- scala.spec | 56 +++----------- 15 files changed, 234 insertions(+), 280 deletions(-) create mode 100644 _service delete mode 100644 generate-tarball.sh delete mode 100644 get-source.sh delete mode 100644 scala-2.10.3-bootstrap.tgz delete mode 100644 scala-2.10.4.tgz delete mode 100644 scala-2.10.6.tar.gz create mode 100644 scala-2.10.7-jdk11.patch create mode 100644 scala-2.10.7-source6.patch create mode 100644 scala-2.10.7.tar.xz create mode 100644 scala-2.10.7.tgz delete mode 100644 scala-bootstript.xml diff --git a/_service b/_service new file mode 100644 index 0000000..f6b6bb1 --- /dev/null +++ b/_service @@ -0,0 +1,19 @@ + + + git + git://github.com/scala/scala.git + v2.10.7 + 2.10.7 + scala + lib/*.jar + lib/ant/*.jar + test + tools/*jar + src/compiler/scala/tools/nsc/doc/html/resource/lib + + + *.tar + xz + + + diff --git a/generate-tarball.sh b/generate-tarball.sh deleted file mode 100644 index 88fbb28..0000000 --- a/generate-tarball.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -e - -name=scala -version="$(sed -n 's/Version:\s*//p' *.spec)" - -# RETRIEVE -wget "https://github.com/scala/scala/archive/v${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" - -rm -rf tarball-tmp -mkdir tarball-tmp -cd tarball-tmp -tar xf "../${name}-${version}.orig.tar.gz" - -# CLEAN TARBALL -find -name '*.jar' -delete -find -name '*.class' -delete -# Possibly proprietary code -find -name '*.dll' -delete -find -name '*.so' -delete -# Contains minified js of uncertain origin -rm -r */src/compiler/scala/tools/nsc/doc/html/resource/lib - -tar czf "../${name}-${version}.tar.gz" * -cd .. -rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/get-source.sh b/get-source.sh deleted file mode 100644 index 1280c66..0000000 --- a/get-source.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -x - -VER="$(sed -n 's/Version:\s*//p' *.spec)" - -FNS=scala-$VER - -rm -rf $FNS/ -git clone git://github.com/scala/scala.git $FNS -cd $FNS -git checkout v$VER -git log --pretty=format:"%H%n%ci" v$VER | head -n 2 | \ - sed -e 's/\-//g' -e 's/\s\+.*//g' >../scala.gitinfo -cd .. -tar -zcf $FNS.tgz --exclude $FNS/.git $FNS/ -cd $FNS -./pull-binary-libs.sh -rm -rf lib/jline.jar -tar -zcf ../$FNS-bootstrap.tgz --exclude .git lib/*.jar -cd .. -rm -rf $FNS/ diff --git a/scala-2.10-jline.patch b/scala-2.10-jline.patch index eff11a7..bb84b27 100644 --- a/scala-2.10-jline.patch +++ b/scala-2.10-jline.patch @@ -1,8 +1,6 @@ -diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala -index 10f9724..2970276 100644 ---- a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala -+++ b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala -@@ -42,7 +42,7 @@ class JLineReader(_completion: => Completion) extends InteractiveReader { +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala 2019-11-27 16:04:03.141644641 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala 2019-11-27 16:04:24.461764259 +0100 +@@ -45,7 +45,7 @@ def readOneKey(prompt: String) = { this.print(prompt) this.flush() @@ -11,24 +9,20 @@ index 10f9724..2970276 100644 } def eraseLine() = consoleReader.resetPromptLine("", "", 0) def redrawLineAndFlush(): Unit = { flush() ; drawLine() ; flush() } -diff --git a/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala -index dddfb1b..e598ac5 100644 ---- a/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala -+++ b/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala -@@ -13,7 +13,7 @@ import FileBackedHistory._ +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala 2019-11-27 16:04:03.141644641 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala 2019-11-27 16:05:14.034042924 +0100 +@@ -15,7 +15,7 @@ /** TODO: file locking. */ trait FileBackedHistory extends JLineHistory with JPersistentHistory { - def maxSize: Int + def maxSize: Int = 2500 - protected lazy val historyFile: File = defaultFile - private var isPersistent = true -diff --git a/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala -index 18e0ee7..fc33192 100644 ---- a/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala -+++ b/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala -@@ -13,7 +13,6 @@ package session + // For a history file in the standard location, always try to restrict permission, + // creating an empty file if none exists. +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala 2019-11-27 16:04:03.141644641 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala 2019-11-27 16:04:24.461764259 +0100 +@@ -13,7 +13,6 @@ trait JLineHistory extends JHistory with History { def size: Int def isEmpty: Boolean @@ -36,7 +30,7 @@ index 18e0ee7..fc33192 100644 def clear(): Unit def get(index: Int): CharSequence def add(line: CharSequence): Unit -@@ -42,7 +41,8 @@ object JLineHistory { +@@ -42,7 +41,8 @@ addLineToFile(item) } } @@ -46,11 +40,9 @@ index 18e0ee7..fc33192 100644 } def apply(): JLineHistory = try new JLineFileHistory catch { case x: Exception => new SimpleHistory() } -diff --git a/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala -index 9f4e2b9..8933849 100644 ---- a/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala -+++ b/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala -@@ -10,7 +10,7 @@ package session +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala 2019-11-27 16:04:03.141644641 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala 2019-11-27 16:04:24.461764259 +0100 +@@ -10,7 +10,7 @@ import scala.collection.mutable.{ Buffer, ListBuffer } import scala.collection.JavaConverters._ @@ -59,7 +51,7 @@ index 9f4e2b9..8933849 100644 private var _index: Int = 0 private val buf: Buffer[String] = new ListBuffer[String] private def toEntries(): Seq[JEntry] = buf.zipWithIndex map { case (x, i) => Entry(i, x) } -@@ -32,27 +32,27 @@ class SimpleHistory extends JLineHistory { +@@ -32,27 +32,27 @@ def maxSize: Int = 2500 def last = if (isEmpty) fail("last") else buf.last diff --git a/scala-2.10.3-bootstrap.tgz b/scala-2.10.3-bootstrap.tgz deleted file mode 100644 index 79b8276..0000000 --- a/scala-2.10.3-bootstrap.tgz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dc73608f70f4339bd9fbaec71b029d7e8d41007d80a18837e77a21d261af9a76 -size 27218643 diff --git a/scala-2.10.4.tgz b/scala-2.10.4.tgz deleted file mode 100644 index 5fea6c2..0000000 --- a/scala-2.10.4.tgz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b46db638c5c6066eee21f00c447fc13d1dfedbfb60d07db544e79db67ba810c3 -size 29937534 diff --git a/scala-2.10.6.tar.gz b/scala-2.10.6.tar.gz deleted file mode 100644 index e340f8c..0000000 --- a/scala-2.10.6.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b5effeefd1da8bab690f5c1251ed9da1dd2d8f375a2aa6deaa08aa1dca9dfd8 -size 5490733 diff --git a/scala-2.10.7-jdk11.patch b/scala-2.10.7-jdk11.patch new file mode 100644 index 0000000..17e3f93 --- /dev/null +++ b/scala-2.10.7-jdk11.patch @@ -0,0 +1,147 @@ +--- scala-2.10.7/src/compiler/scala/tools/cmd/gen/AnyVals.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/cmd/gen/AnyVals.scala 2019-11-28 13:37:03.940143371 +0100 +@@ -183,7 +183,7 @@ + } + def objectLines = { + val comp = if (isCardinal) cardinalCompanion else floatingCompanion +- (comp + allCompanions + "\n" + nonUnitCompanions).trim.lines.toList ++ implicitCoercions map interpolate ++ (comp + allCompanions + "\n" + nonUnitCompanions).trim.linesIterator.toList ++ implicitCoercions map interpolate + } + + /** Makes a set of binary operations based on the given set of ops, args, and resultFn. +@@ -225,7 +225,7 @@ + def representation = repr.map(", a " + _).getOrElse("") + + def indent(s: String) = if (s == "") "" else " " + s +- def indentN(s: String) = s.lines map indent mkString "\n" ++ def indentN(s: String) = s.linesIterator map indent mkString "\n" + + def boxUnboxImpls = Map( + "@boxImpl@" -> "%s.valueOf(x)".format(boxedName), +@@ -453,9 +453,9 @@ + def ^(x: Boolean): Boolean + + override def getClass(): Class[Boolean] = null +- """.trim.lines.toList ++ """.trim.linesIterator.toList + +- def objectLines = interpolate(allCompanions + "\n" + nonUnitCompanions).lines.toList ++ def objectLines = interpolate(allCompanions + "\n" + nonUnitCompanions).linesIterator.toList + } + object U extends AnyValRep("Unit", None, "void") { + override def classDoc = """ +@@ -468,7 +468,7 @@ + def classLines = List( + """override def getClass(): Class[Unit] = null""" + ) +- def objectLines = interpolate(allCompanions).lines.toList ++ def objectLines = interpolate(allCompanions).linesIterator.toList + + override def boxUnboxImpls = Map( + "@boxImpl@" -> "scala.runtime.BoxedUnit.UNIT", +--- scala-2.10.7/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala 2019-11-28 13:38:10.892515720 +0100 +@@ -209,7 +209,7 @@ + SafeTags.replaceAllIn(javadoclessComment, { mtch => + java.util.regex.Matcher.quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker) + }) +- markedTagComment.lines.toList map (cleanLine(_)) ++ markedTagComment.linesIterator.toList map (cleanLine(_)) + } + + /** Parses a comment (in the form of a list of lines) to a `Comment` +--- scala-2.10.7/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTestSettings.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTestSettings.scala 2019-11-28 13:39:14.716870692 +0100 +@@ -58,7 +58,7 @@ + val str = try File(optsFile).slurp() catch { + case e: java.io.IOException => "" + } +- str.lines.filter(!_.startsWith(CommentStartDelimiter)).mkString(" ") ++ str.linesIterator.filter(!_.startsWith(CommentStartDelimiter)).mkString(" ") + } + + override protected def printClassPath(implicit reporter: Reporter) { +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala 2019-11-28 13:57:53.339092518 +0100 +@@ -85,7 +85,7 @@ + defineClass(name, bytes, 0, bytes.length) + } + +- private val packages = mutable.Map[String, Package]() ++ private val whatever = mutable.Map[String, Package]() + + override def definePackage(name: String, specTitle: String, specVersion: String, specVendor: String, implTitle: String, implVersion: String, implVendor: String, sealBase: URL): Package = { + throw new UnsupportedOperationException() +@@ -94,7 +94,7 @@ + override def getPackage(name: String): Package = { + findAbstractDir(name) match { + case null => super.getPackage(name) +- case file => packages.getOrElseUpdate(name, { ++ case file => whatever.getOrElseUpdate(name, { + val ctor = classOf[Package].getDeclaredConstructor(classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[String], classOf[URL], classOf[ClassLoader]) + ctor.setAccessible(true) + ctor.newInstance(name, null, null, null, null, null, null, null, this) +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/Formatting.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/Formatting.scala 2019-11-28 13:43:44.162369415 +0100 +@@ -25,7 +25,7 @@ + def indentCode(code: String) = { + val indent = spaces(code) + stringFromWriter(str => +- for (line <- code.lines) { ++ for (line <- code.linesIterator) { + str print indent + str print (line + "\n") + str.flush() +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/IMain.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/IMain.scala 2019-11-28 13:47:12.735529430 +0100 +@@ -454,7 +454,7 @@ + // enclosing in braces it is constructed like "val x =\n5 // foo". + private def removeComments(line: String): String = { + showCodeIfDebugging(line) // as we're about to lose our // show +- line.lines map (s => s indexOf "//" match { ++ line.linesIterator map (s => s indexOf "//" match { + case -1 => s + case idx => s take idx + }) mkString "\n" +@@ -580,7 +580,7 @@ + if (printResults && result != "") + printMessage(result stripSuffix "\n") + else if (isReplDebug) // show quiet-mode activity +- printMessage(result.trim.lines map ("[quiet] " + _) mkString "\n") ++ printMessage(result.trim.linesIterator map ("[quiet] " + _) mkString "\n") + + // Book-keeping. Have to record synthetic requests too, + // as they may have been issued for information, e.g. :type +@@ -1161,8 +1161,8 @@ + /** Secret bookcase entrance for repl debuggers: end the line + * with "// show" and see what's going on. + */ +- def isShow = code.lines exists (_.trim endsWith "// show") +- def isShowRaw = code.lines exists (_.trim endsWith "// raw") ++ def isShow = code.linesIterator exists (_.trim endsWith "// show") ++ def isShowRaw = code.linesIterator exists (_.trim endsWith "// raw") + + // old style + beSilentDuring(parse(code)) foreach { ts => +--- scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/Power.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/interpreter/Power.scala 2019-11-28 13:46:26.087269973 +0100 +@@ -150,7 +150,7 @@ + // Then we import everything from $r. + intp interpret ("import " + intp.pathToTerm("$r") + "._") + // And whatever else there is to do. +- init.lines foreach (intp interpret _) ++ init.linesIterator foreach (intp interpret _) + } + def valsDescription: String = { + def to_str(m: Symbol) = "%12s %s".format( +--- scala-2.10.7/src/scalacheck/org/scalacheck/Pretty.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/scalacheck/org/scalacheck/Pretty.scala 2019-11-28 14:07:48.018400196 +0100 +@@ -45,7 +45,7 @@ + else s.substring(0, length) / break(lead+s.substring(length), lead, length) + + def format(s: String, lead: String, trail: String, width: Int) = +- s.lines.map(l => break(lead+l+trail, " ", width)).mkString("\n") ++ s.linesIterator.map(l => break(lead+l+trail, " ", width)).mkString("\n") + + implicit def prettyAny(t: Any) = Pretty { p => t.toString } + diff --git a/scala-2.10.7-source6.patch b/scala-2.10.7-source6.patch new file mode 100644 index 0000000..c38f893 --- /dev/null +++ b/scala-2.10.7-source6.patch @@ -0,0 +1,20 @@ +--- scala-2.10.7/build.xml 2019-11-27 17:42:56.487021401 +0100 ++++ scala-2.10.7/build.xml 2019-11-27 17:43:39.491264930 +0100 +@@ -757,7 +757,7 @@ + destdir="${@{project}-classes}" + classpath="${@{project}-classes}" + includes="**/*.java" +- target="1.6" source="1.5" ++ target="1.6" source="1.6" + compiler="javac1.6" + includeantruntime="false" > + +@@ -793,7 +793,7 @@ + includes="**/*.java" + excludes="@{excludes}" + includeantruntime="false" +- target="1.6" source="1.5"> ++ target="1.6" source="1.6"> + + + diff --git a/scala-2.10.7.tar.xz b/scala-2.10.7.tar.xz new file mode 100644 index 0000000..a9a617e --- /dev/null +++ b/scala-2.10.7.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0deeee6a636b0da742b4880ae62215aad6f5aa4e0ec8a3b0ce386c40edc53674 +size 2864660 diff --git a/scala-2.10.7.tgz b/scala-2.10.7.tgz new file mode 100644 index 0000000..758d584 --- /dev/null +++ b/scala-2.10.7.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9283119916f6bb7714e076a2840ccf22d58819b355228ed1591ae6f76929f111 +size 29993772 diff --git a/scala-bootstript.xml b/scala-bootstript.xml deleted file mode 100644 index b30caa1..0000000 --- a/scala-bootstript.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scala.changes b/scala.changes index 8ec35a5..726495e 100644 --- a/scala.changes +++ b/scala.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Thu Nov 28 14:27:20 UTC 2019 - Fridrich Strba + +- Upgrade to upstream version 2.10.7 + * Can be built and used with java 11 +- Get sources by a source service instead of a custom script +- Clean a bit the spec file and remove unnecessary sources +- Added patches: + * scala-2.10.7-source6.patch + + Build not only with target level 6, but also with source + level 6, in order to be able to build with jdk9+ + * scala-2.10.7-jdk11.patch + + Fix type conflict with jdk11's java.lang.String.lines + ------------------------------------------------------------------- Tue Nov 26 10:56:50 UTC 2019 - Fridrich Strba diff --git a/scala.gitinfo b/scala.gitinfo index 4a1b8cd..5aee872 100644 --- a/scala.gitinfo +++ b/scala.gitinfo @@ -1,2 +1,2 @@ -bda53196ebbeb1369c70f3d1ec066796c06a6409 -20150918 +89e57bc7ad4a1809864b637617456736fd7b8101 +20171031 diff --git a/scala.spec b/scala.spec index 4e2a595..144cabe 100644 --- a/scala.spec +++ b/scala.spec @@ -29,34 +29,22 @@ %global jline2_jar %{_javadir}/jline/jline.jar %global scaladir %{_datadir}/scala %global base_name scala -%global want_jdk8 1 %define __requires_exclude .*org\.apache\.ant.* -Version: 2.10.6 +Version: 2.10.7 Release: 0 Summary: A hybrid functional/object-oriented language for the JVM License: BSD-3-Clause AND CC0-1.0 AND SUSE-Public-Domain Group: Development/Libraries/Java URL: http://www.scala-lang.org/ -# ./generate-tarball.sh -Source0: %{base_name}-%{version}.tar.gz +Source0: %{base_name}-%{version}.tar.xz Source1: scala-library-2.10.0-bnd.properties -# Bootstrap file generated by ./get-sources.sh -Source2: scala-2.10.3-bootstrap.tgz -# git information generated by ./get-sources.sh +# git log --pretty=format:"%H%n%ci" v%{version} | head -n 2 | sed -e 's/\-//g' -e 's/\s\+.*//g' Source3: scala.gitinfo -# we need this binary copy of the scala 2.10.4 compiler -# for bootstrapping under Java 8; this can be removed if -# necessary after Scala 2.10.5 is released if it uses 2.10.4 -# for bootstrapping. -Source4: http://www.scala-lang.org/files/archive/scala-2.10.4.tgz -# Remove bundled binaries which are possibly proprietary -Source5: generate-tarball.sh -Source6: get-source.sh +Source4: http://www.scala-lang.org/files/archive/%{base_name}-%{version}.tgz Source21: scala.keys Source22: scala.mime Source23: scala-mime-info.xml Source24: scala.ant.d -Source31: scala-bootstript.xml # Change the default classpath (SCALA_HOME) Patch1: scala-2.10.0-tooltemplate.patch # Use system jline2 instead of bundled jline2 @@ -71,6 +59,8 @@ 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 +Patch11: scala-2.10.7-jdk11.patch BuildRequires: ant BuildRequires: ant-contrib BuildRequires: ant-junit @@ -80,7 +70,7 @@ BuildRequires: java-devel >= 1.7 BuildRequires: javapackages-local BuildRequires: jline >= 2.10 BuildRequires: junit -BuildConflicts: java-devel >= 9 +#BuildConflicts: java-devel >= 9 Requires: jansi Requires: java-headless >= 1.7 # Require full javapackages-tools since scripts use @@ -143,9 +133,10 @@ the Scala ant tasks. %patch3 -p1 -b .compiler-pom %patch4 -p1 -b .jdk7 %patch6 -p1 -b .rvk -# %patch7 -p1 -b .bc %patch8 -p1 -b .bld %patch9 -p1 -b .scaladoc +%patch10 -p1 -b .source6 +%patch11 -p1 -b .jdk11 echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number @@ -158,10 +149,7 @@ sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} %global do_bootstrap -DdoBootstrapBuild=yes -tar -xzvf %{SOURCE2} -%if %{want_jdk8} -tar -xzvf %{SOURCE4} --strip-components=1 scala-2.10.4/lib -%endif +tar -xzvf %{SOURCE4} --strip-components=1 %{base_name}-%{version}/lib %else %global do_bootstrap %{nil} %endif @@ -183,8 +171,6 @@ pushd lib popd popd -cp -rf %{SOURCE31} . - sed -i -e 's!@JLINE@!%{jline2_jar}!g' build.xml echo echo $(head -n 1 %{SOURCE3}) > tools/get-scala-commit-sha @@ -199,7 +185,6 @@ export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" # is slow, OBS thinks it is stuck and kills it before it has chance # to finish %ant \ - -Dscalac.args=-verbose \ build || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no @@ -207,27 +192,6 @@ bnd wrap --properties %{SOURCE1} --output scala-library.jar \ --version "%{version}" scala-library.jar.no popd -%check - -# these tests fail, but their failures appear spurious -rm -f test/files/run/parserJavaIdent.scala -rm -rf test/files/presentation/implicit-member -rm -rf test/files/presentation/t5708 -rm -rf test/files/presentation/ide-bug-1000349 -rm -rf test/files/presentation/ide-bug-1000475 -rm -rf test/files/presentation/callcc-interpreter -rm -rf test/files/presentation/ide-bug-1000531 -rm -rf test/files/presentation/visibility -rm -rf test/files/presentation/ping-pong - -rm -f test/osgi/src/ReflectionToolboxTest.scala - -# fails under mock but not under rpmbuild -rm -f test/files/run/t6223.scala - -## Most test dependencies still aren't available in Fedora -# ant test - %install install -d %{buildroot}%{_bindir} From a076c957b97fa524cfe61992fc54ca5472fede5e8b1c6d868979df69aa773e71 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 14:40:21 +0000 Subject: [PATCH 15/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=24 --- scala.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scala.spec b/scala.spec index 144cabe..56ac351 100644 --- a/scala.spec +++ b/scala.spec @@ -83,7 +83,7 @@ Name: %{base_name}-bootstrap Provides: %{base_name} %else Name: %{base_name} -BuildRequires: %{base_name} +BuildRequires: %{base_name} >= 2.10.7 Provides: %{base_name}-bootstrap Obsoletes: %{base_name}-bootstrap %endif From b2ab66188635e0603d13e9f60a5777d12e7827fc52a7bfa0371cff3acb22fee2 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 14:42:29 +0000 Subject: [PATCH 16/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=25 --- scala.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scala.spec b/scala.spec index 56ac351..4b07e2b 100644 --- a/scala.spec +++ b/scala.spec @@ -80,11 +80,10 @@ Requires: jline >= 2.10 BuildArch: noarch %if %{with bootstrap} Name: %{base_name}-bootstrap -Provides: %{base_name} %else Name: %{base_name} -BuildRequires: %{base_name} >= 2.10.7 -Provides: %{base_name}-bootstrap +BuildRequires: %{base_name}-bootstrap >= 2.10.7 +Provides: %{base_name}-bootstrap = %{version}-%{release} Obsoletes: %{base_name}-bootstrap %endif From 83607f1a6cfad9bd00a34bb837edb5bd22c6f7b0dcf2c490ce6aa23feb13b6e4 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 14:45:38 +0000 Subject: [PATCH 17/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=26 --- scala.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scala.spec b/scala.spec index 4b07e2b..e8d5c19 100644 --- a/scala.spec +++ b/scala.spec @@ -82,7 +82,7 @@ BuildArch: noarch Name: %{base_name}-bootstrap %else Name: %{base_name} -BuildRequires: %{base_name}-bootstrap >= 2.10.7 +BuildRequires: %{base_name}-bootstrap >= %{version} Provides: %{base_name}-bootstrap = %{version}-%{release} Obsoletes: %{base_name}-bootstrap %endif From 00a57270feeb5380adc4b955da3e89c7ebe9af5c9bc6438eb954169e812208bd Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 14:48:24 +0000 Subject: [PATCH 18/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=27 --- scala.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/scala.spec b/scala.spec index e8d5c19..07d1778 100644 --- a/scala.spec +++ b/scala.spec @@ -70,7 +70,6 @@ BuildRequires: java-devel >= 1.7 BuildRequires: javapackages-local BuildRequires: jline >= 2.10 BuildRequires: junit -#BuildConflicts: java-devel >= 9 Requires: jansi Requires: java-headless >= 1.7 # Require full javapackages-tools since scripts use From b0196b30ea47268b6dc90d28a6c418c5014348d1c67af97b538da25e7cb83dc7 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 28 Nov 2019 17:28:37 +0000 Subject: [PATCH 19/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=28 --- scala-2.10.7-java8compat.patch | 184 +++++++++++++++++++++++++++++++++ scala.spec | 2 + 2 files changed, 186 insertions(+) create mode 100644 scala-2.10.7-java8compat.patch diff --git a/scala-2.10.7-java8compat.patch b/scala-2.10.7-java8compat.patch new file mode 100644 index 0000000..c947217 --- /dev/null +++ b/scala-2.10.7-java8compat.patch @@ -0,0 +1,184 @@ +--- scala-2.10.7/src/compiler/scala/tools/nsc/io/SourceReader.scala 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/compiler/scala/tools/nsc/io/SourceReader.scala 2019-11-28 18:22:37.444126737 +0100 +@@ -8,7 +8,7 @@ + package io + + import java.io.{ FileInputStream, InputStream, IOException } +-import java.nio.{ByteBuffer, CharBuffer} ++import java.nio.{Buffer, ByteBuffer, CharBuffer} + import java.nio.channels.{FileChannel, ReadableByteChannel, Channels} + import java.nio.charset.{CharsetDecoder, CoderResult} + import scala.tools.nsc.reporters._ +@@ -61,13 +61,13 @@ + /** Reads the specified byte channel. */ + protected def read(input: ReadableByteChannel): Array[Char] = { + val decoder: CharsetDecoder = this.decoder.reset() +- val bytes: ByteBuffer = this.bytes; bytes.clear() +- var chars: CharBuffer = this.chars; chars.clear() ++ val bytes: ByteBuffer = this.bytes; bytes.asInstanceOf[Buffer].clear() ++ var chars: CharBuffer = this.chars; chars.asInstanceOf[Buffer].clear() + var endOfInput = false + + while (!endOfInput ) { + endOfInput = input.read(bytes) < 0 +- bytes.flip() ++ bytes.asInstanceOf[Buffer].flip() + chars = decode(decoder, bytes, chars, endOfInput) + } + terminate(flush(decoder, chars)) +@@ -76,7 +76,7 @@ + /** Reads the specified byte buffer. */ + protected def read(bytes: ByteBuffer): Array[Char] = { + val decoder: CharsetDecoder = this.decoder.reset() +- val chars: CharBuffer = this.chars; chars.clear() ++ val chars: CharBuffer = this.chars; chars.asInstanceOf[Buffer].clear() + terminate(flush(decoder, decode(decoder, bytes, chars, true))) + } + +@@ -128,7 +128,7 @@ + def flush(decoder: CharsetDecoder, chars: CharBuffer): CharBuffer = { + val result: CoderResult = decoder.flush(chars) + if (result.isUnderflow()) { +- chars.flip() ++ chars.asInstanceOf[Buffer].flip() + chars + } else { + if (result.isError()) throw new IOException(result.toString()) +@@ -142,7 +142,7 @@ + * content but with an increased capacity. + */ + private def increaseCapacity(buffer: CharBuffer): CharBuffer = { +- buffer.flip() ++ buffer.asInstanceOf[Buffer].flip() + val capacity = 2 * buffer.capacity() + CharBuffer.allocate(capacity).put(buffer) + } +--- scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/Attribute.java 2019-11-28 17:28:47.932834776 +0100 +@@ -11,6 +11,7 @@ + import java.util.HashMap; + import java.util.LinkedHashMap; + import java.util.Iterator; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.io.UnsupportedEncodingException; +@@ -462,7 +463,7 @@ + return null; + try { str = new String(value, buf.position(), length, "UTF-8" ); } + catch (UnsupportedEncodingException e) { throw new Error(e); } +- buf.position(buf.position() + length); ++ ((Buffer)buf).position(buf.position() + length); + return str; + } + +--- scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/PEFile.java 2019-11-28 17:32:27.926199324 +0100 +@@ -17,6 +17,7 @@ + import java.io.IOException; + import java.io.FileNotFoundException; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.channels.FileChannel; + import java.nio.MappedByteBuffer; +@@ -454,7 +455,7 @@ + + /** Go to the specified position in the file. */ + public void seek(int pos) { +- buf.position(pos); ++ ((Buffer)buf).position(pos); + } + + +@@ -485,7 +486,7 @@ + + /** Move the forward in the file by the specified number of bytes. */ + public void skip(int n) { +- buf.position(buf.position() + n); ++ ((Buffer)buf).position(buf.position() + n); + } + + /** +@@ -503,11 +504,11 @@ + + /** Returns a buffer from the given offset to the end of the file. */ + public ByteBuffer getBuffer(long offset, int size) { +- buf.mark(); +- buf.position((int)offset); ++ ((Buffer)buf).mark(); ++ ((Buffer)buf).position((int)offset); + ByteBuffer bb = buf.slice(); +- buf.reset(); +- bb.limit(size); ++ ((Buffer)buf).reset(); ++ ((Buffer)bb).limit(size); + bb.order(java.nio.ByteOrder.LITTLE_ENDIAN); + return bb; + } +@@ -707,11 +708,11 @@ + if (i < length - 1) + b.append(" "); + } +- buf.position(savedPos); ++ ((Buffer)buf).position(savedPos); + return b.append(")").toString(); + } + +- public Sig reset() { buf.position(pos); return this; } ++ public Sig reset() { ((Buffer)buf).position(pos); return this; } + + public int pos() { return buf.position() - pos; } + +--- scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/util/PEStream.java 2019-11-28 17:36:37.103730311 +0100 +@@ -11,6 +11,7 @@ + import java.io.PrintStream; + import java.io.IOException; + ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.channels.FileChannel; + +@@ -64,7 +65,7 @@ + /** Move to the specified position in the stream. */ + private void seek(int pos) { + try { +- buffer.position(pos); ++ ((Buffer)buffer).position(pos); + } catch (IllegalArgumentException e) { + System.err.println("\nSeek failed in file " + file + + " for position " + pos +@@ -76,11 +77,11 @@ + /** Return a string from the specified position in the stream. */ + public String getString(int pos) { + seek(pos); +- buffer.mark(); ++ ((Buffer)buffer).mark(); + int i; + for (i = 0; getByte() != 0; i++); + byte[] buf = new byte[i]; +- buffer.reset(); // go back to the marked position ++ ((Buffer)buffer).reset(); // go back to the marked position + buffer.get(buf); + try { + return new String(buf, "UTF-8"); +--- scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java 2017-11-01 04:52:36.000000000 +0100 ++++ scala-2.10.7/src/msil/ch/epfl/lamp/compiler/msil/util/Table.java 2019-11-28 17:34:43.543040457 +0100 +@@ -9,6 +9,7 @@ + import ch.epfl.lamp.compiler.msil.PEFile.Sig; + + import java.io.PrintStream; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.MappedByteBuffer; + +@@ -327,7 +328,7 @@ + protected final void seekRow(int row) { + assert row > 0 && row <= rows + : "Index " + row + " is not within the table with #rows = " + rows; +- buffer.position((row - 1)* rowSize()); ++ ((Buffer)buffer).position((row - 1)* rowSize()); + } + + public final int currentRow() { return currentRow; } diff --git a/scala.spec b/scala.spec index 07d1778..83deefa 100644 --- a/scala.spec +++ b/scala.spec @@ -61,6 +61,7 @@ Patch8: scala-2.10.4-build_xml.patch Patch9: scala-2.10.6-scaladoc-resources.patch Patch10: scala-2.10.7-source6.patch Patch11: scala-2.10.7-jdk11.patch +Patch12: scala-2.10.7-java8compat.patch BuildRequires: ant BuildRequires: ant-contrib BuildRequires: ant-junit @@ -135,6 +136,7 @@ the Scala ant tasks. %patch9 -p1 -b .scaladoc %patch10 -p1 -b .source6 %patch11 -p1 -b .jdk11 +%patch12 -p1 -b .java8compat echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number From 7562c41ed029b95bf7018efd7cdf99447f646d09c62890e0f287aaa5a4dd9115 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 29 Nov 2019 10:57:24 +0000 Subject: [PATCH 20/20] OBS-URL: https://build.opensuse.org/package/show/Java:packages/scala?expand=0&rev=29 --- ....7-jdk11.patch => scala-2.10.7-lines.patch | 0 scala.changes | 11 +++++- scala.spec | 36 +++++++++++++++++-- 3 files changed, 44 insertions(+), 3 deletions(-) rename scala-2.10.7-jdk11.patch => scala-2.10.7-lines.patch (100%) diff --git a/scala-2.10.7-jdk11.patch b/scala-2.10.7-lines.patch similarity index 100% rename from scala-2.10.7-jdk11.patch rename to scala-2.10.7-lines.patch diff --git a/scala.changes b/scala.changes index 726495e..eecec02 100644 --- a/scala.changes +++ b/scala.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Nov 29 10:53:22 UTC 2019 - Fridrich Strba + +- Do not package ant tasks in bootstrap build +- Added patch: + * scala-2.10.7-java8compat.patch + + Build binaries compatible with java 8 even when building + with jdk >= 9 + ------------------------------------------------------------------- Thu Nov 28 14:27:20 UTC 2019 - Fridrich Strba @@ -9,7 +18,7 @@ Thu Nov 28 14:27:20 UTC 2019 - Fridrich Strba * scala-2.10.7-source6.patch + Build not only with target level 6, but also with source level 6, in order to be able to build with jdk9+ - * scala-2.10.7-jdk11.patch + * scala-2.10.7-lines.patch + Fix type conflict with jdk11's java.lang.String.lines ------------------------------------------------------------------- diff --git a/scala.spec b/scala.spec index 83deefa..e990a0d 100644 --- a/scala.spec +++ b/scala.spec @@ -60,7 +60,7 @@ Patch8: scala-2.10.4-build_xml.patch # 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 -Patch11: scala-2.10.7-jdk11.patch +Patch11: scala-2.10.7-lines.patch Patch12: scala-2.10.7-java8compat.patch BuildRequires: ant BuildRequires: ant-contrib @@ -93,6 +93,20 @@ common programming patterns in a concise and type-safe way. It integrates features of object-oriented and functional languages. It is also interoperable with Java. +%if %{without bootstrap} +%package apidoc +Summary: Documentation for the Scala programming language +Group: Documentation/HTML +%if %{without bootstrap} +Obsoletes: %{base_name}-bootstrap-apidoc +%endif + +%description apidoc +Scala is a general purpose programming language for the JVM that blends +object-oriented and functional programming. This package provides +reference and API documentation for the Scala programming language. +%endif + %package swing Summary: The swing library for the Scala programming languages Group: Development/Libraries/Java @@ -149,9 +163,11 @@ sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} %global do_bootstrap -DdoBootstrapBuild=yes +%global docs_target %{nil} tar -xzvf %{SOURCE4} --strip-components=1 %{base_name}-%{version}/lib %else %global do_bootstrap %{nil} +%global docs_target docs %endif pushd lib @@ -185,7 +201,7 @@ export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" # is slow, OBS thinks it is stuck and kills it before it has chance # to finish %ant \ - build || exit 1 + build %{docs_target} || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ @@ -225,8 +241,10 @@ done ln -s $(abs2rel %{jline2_jar} %{scaladir}/lib) %{buildroot}%{scaladir}/lib ln -s $(abs2rel %{jansi_jar} %{scaladir}/lib) %{buildroot}%{scaladir}/lib +%if %{without bootstrap} install -d %{buildroot}%{_sysconfdir}/ant.d install -p -m 644 %{SOURCE24} %{buildroot}%{_sysconfdir}/ant.d/scala +%endif install -d %{buildroot}%{_datadir}/mime-info install -p -m 644 %{SOURCE21} %{SOURCE22} %{buildroot}%{_datadir}/mime-info/ @@ -236,6 +254,11 @@ install -p -m 644 %{SOURCE23} %{buildroot}%{_datadir}/mime/packages/ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot}%{_bindir}/* +%if %{without bootstrap} +install -d %{buildroot}%{_mandir}/man1 +install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 +%endif + %files -f .mfiles %{_bindir}/* %dir %{_datadir}/%{base_name} @@ -245,15 +268,24 @@ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot %{_datadir}/mime-info %{_datadir}/mime/packages/* %license docs/LICENSE +%if %{without bootstrap} +%{_mandir}/man1/* +%endif %files swing -f .mfiles-swing %license docs/LICENSE %{_datadir}/%{base_name}/lib/scala-swing.jar +%if %{without bootstrap} %files -n ant-%{name} # Following is plain config because the ant task classpath could change from # release to release %config %{_sysconfdir}/ant.d/* %license docs/LICENSE +%files apidoc +%doc build/scaladoc/library/* +%license docs/LICENSE +%endif + %changelog