[scala] New upstream release

Jochen Schmitt s4504kr at fedoraproject.org
Tue Nov 8 20:25:11 UTC 2011


commit 3fb42aec57cc322b10e7419730c36ba63f047cc3
Author: Jochen Schmitt <Jochen at herr-schmitt.de>
Date:   Tue Nov 8 19:33:36 2011 +0100

    New upstream release

 scala-2.8.0-tooltemplate.patch     |   74 -----------------
 scala-2.8.1-use_system_jline.patch |   25 ------
 scala-2.9.1-tooltemplate.patch     |   72 +++++++++++++++++
 scala-2.9.1-use_system_jline.patch |  154 ++++++++++++++++++++++++++++++++++++
 scala-buildfile.patch              |   27 ------
 scala.spec                         |   30 ++++++-
 6 files changed, 251 insertions(+), 131 deletions(-)
---
diff --git a/scala-2.9.1-tooltemplate.patch b/scala-2.9.1-tooltemplate.patch
new file mode 100644
index 0000000..2b3a885
--- /dev/null
+++ b/scala-2.9.1-tooltemplate.patch
@@ -0,0 +1,72 @@
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/ant/templates/tool-unix.tmpl.tool scala-2.9.1.final-sources/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/ant/templates/tool-unix.tmpl.tool	2011-05-02 12:20:26.000000000 +0200
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/ant/templates/tool-unix.tmpl	2011-11-03 19:49:45.558715195 +0100
+@@ -47,24 +47,13 @@ case "`uname`" in
+     CYGWIN*) cygwin=true ;;
+ esac
+ 
+-# Finding the root folder for this Scala distribution
+-SOURCE=$0;
+-SCRIPT=`basename "$SOURCE"`;
+-while [ -h "$SOURCE" ]; do
+-    SCRIPT=`basename "$SOURCE"`;
+-    LOOKUP=`ls -ld "$SOURCE"`;
+-    TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`;
+-    if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then
+-        SOURCE=${TARGET:-.};
+-    else
+-        SOURCE=`dirname "$SOURCE"`/${TARGET:-.};
+-    fi;
+-done;
+-
+-# see #2092
+-SCALA_HOME=`dirname "$SOURCE"`
+-SCALA_HOME=`cd "$SCALA_HOME"; pwd -P`
+-SCALA_HOME=`cd "$SCALA_HOME"/..; pwd`
++[ -r @@JAVADIR@@-utils/java-functions ] && . @@JAVADIR@@-utils/java-functions || exit 1
++
++set_javacmd || exit 3
++check_java_env || exit 4
++set_jvm_dirs || exit 5
++
++SCALA_HOME="@@DATADIR@@/scala"
+ 
+ # Remove spaces from SCALA_HOME on windows
+ if $cygwin; then
+@@ -84,23 +73,6 @@ if [ -z "$TOOL_CLASSPATH" ] ; then
+     done
+ fi
+ 
+-CYGWIN_JLINE_TERMINAL=
+-if $cygwin; then
+-    if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+-        format=mixed
+-    else
+-        format=windows
+-    fi
+-    SCALA_HOME=`cygpath --$format "$SCALA_HOME"`
+-    TOOL_CLASSPATH=`cygpath --path --$format "$TOOL_CLASSPATH"`
+-    case "$TERM" in
+-        rxvt* | xterm*)
+-            stty -icanon min 1 -echo
+-            CYGWIN_JLINE_TERMINAL="-Djline.terminal=scala.tools.jline.UnixTerminal"
+-        ;;
+-    esac
+-fi
+-
+ [ -n "$JAVA_OPTS" ] || JAVA_OPTS="@javaflags@"
+ 
+ # break out -D and -J options and add them to JAVA_OPTS as well
+@@ -146,11 +118,7 @@ done
+ # reset "$@@" to the remaining args
+ set -- "${scala_args[@@]}"
+ 
+-if [ -z "$JAVACMD" -a -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
+-    JAVACMD="$JAVA_HOME/bin/java"
+-fi
+-
+-"${JAVACMD:=java}" \
++exec ${JAVACMD} \
+   $JAVA_OPTS \
+   "${java_args[@@]}" \
+   ${CPSELECT}${TOOL_CLASSPATH} \
diff --git a/scala-2.9.1-use_system_jline.patch b/scala-2.9.1-use_system_jline.patch
new file mode 100644
index 0000000..d147669
--- /dev/null
+++ b/scala-2.9.1-use_system_jline.patch
@@ -0,0 +1,154 @@
+diff -up scala-2.9.1.final-sources/build.xml.sysjline scala-2.9.1.final-sources/build.xml
+--- scala-2.9.1.final-sources/build.xml.sysjline	2011-08-29 12:44:33.000000000 +0200
++++ scala-2.9.1.final-sources/build.xml	2011-11-08 19:24:10.840819241 +0100
+@@ -162,7 +162,7 @@ PROPERTIES
+   <!-- Sets location of pre-compiled libraries -->
+   <property name="lib.starr.jar" value="${lib.dir}/scala-library.jar"/>
+   <property name="comp.starr.jar" value="${lib.dir}/scala-compiler.jar"/>
+-  <property name="jline.jar" value="${lib.dir}/jline.jar"/>
++  <property name="jline2.jar" value="/usr/share/java/jline2.jar"/>
+   <property name="ant.jar" value="${ant.home}/lib/ant.jar"/>
+   <property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/>
+ 
+@@ -358,7 +358,7 @@ LOCAL REFERENCE BUILD (LOCKER)
+         <pathelement location="${build-locker.dir}/classes/library"/>
+         <pathelement location="${build-locker.dir}/classes/compiler"/>
+         <path refid="aux.libs"/>
+-        <pathelement location="${jline.jar}"/>
++        <pathelement location="${jline2.jar}"/>
+       </compilationpath>
+     </scalacfork>
+     <propertyfile file="${build-locker.dir}/classes/compiler/compiler.properties">
+@@ -573,7 +573,7 @@ QUICK BUILD (QUICK)
+         <pathelement location="${build-quick.dir}/classes/library"/>
+         <pathelement location="${build-quick.dir}/classes/compiler"/>
+         <path refid="aux.libs"/>
+-        <pathelement location="${jline.jar}"/>
++        <pathelement location="${jline2.jar}"/>
+       </compilationpath>
+     </scalacfork>
+     <propertyfile file="${build-quick.dir}/classes/compiler/compiler.properties">
+@@ -751,7 +751,7 @@ QUICK BUILD (QUICK)
+       <pathelement location="${build-quick.dir}/classes/compiler"/>
+       <pathelement location="${build-quick.dir}/classes/scalap"/>
+       <path refid="aux.libs"/>
+-      <pathelement location="${jline.jar}"/>
++      <pathelement location="${jline2.jar}"/>
+     </path>
+     <taskdef name="quick-bin" classname="scala.tools.ant.ScalaTool" classpathref="quick.bin.classpath"/>
+     <mkdir dir="${build-quick.dir}/bin"/>
+@@ -857,7 +857,6 @@ PACKED QUICK BUILD (PACK)
+       <zipfileset dirmode="755" filemode="644" src="${fjbg.jar}"/>
+       <zipfileset dirmode="755" filemode="644" src="${msil.jar}"/>
+     </jar>
+-    <copy file="${jline.jar}" toDir="${build-pack.dir}/lib"/>
+     <copy todir="${build-pack.dir}/lib">
+       <fileset dir="${lib-extra.dir}">
+         <include name="**/*.jar"/>
+@@ -926,7 +925,7 @@ PACKED QUICK BUILD (PACK)
+       <classpath>
+         <pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
+         <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
+-        <pathelement location="${build-pack.dir}/lib/jline.jar"/>
++      
+       </classpath>
+     </taskdef>
+     <mkdir dir="${build-pack.dir}/bin"/>
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala.sysjline	2011-04-26 10:50:33.000000000 +0200
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala	2011-11-08 19:13:18.272033791 +0100
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.{ ConsoleReader, CursorBuffer }
+-import scala.tools.jline.console.completer.CompletionHandler
++import jline.console.{ ConsoleReader, CursorBuffer }
++import jline.console.completer.CompletionHandler
+ import Completion._
+ 
+ trait ConsoleReaderHelper extends ConsoleReader {
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Delimited.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Delimited.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Delimited.scala.sysjline	2011-02-02 14:55:56.000000000 +0100
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Delimited.scala	2011-11-08 19:13:18.272033791 +0100
+@@ -6,7 +6,7 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
++import jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
+ 
+ class JLineDelimiter extends ArgumentDelimiter {
+   def toJLine(args: List[String], cursor: Int) = args match {
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala.sysjline	2011-07-24 13:36:45.000000000 +0200
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala	2011-11-08 19:13:18.272033791 +0100
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline._
+-import scala.tools.jline.console.completer._
++import jline._
++import jline.console.completer._
+ import Completion._
+ import collection.mutable.ListBuffer
+ 
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala.sysjline	2011-07-24 13:36:45.000000000 +0200
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala	2011-11-08 19:13:18.273033788 +0100
+@@ -6,8 +6,8 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.ConsoleReader
+-import scala.tools.jline.console.completer._
++import jline.console.ConsoleReader
++import jline.console.completer._
+ import session._
+ import scala.collection.JavaConverters._
+ import Completion._
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Parsed.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Parsed.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Parsed.scala.sysjline	2011-02-02 14:55:56.000000000 +0100
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/Parsed.scala	2011-11-08 19:13:18.273033788 +0100
+@@ -6,7 +6,7 @@
+ package scala.tools.nsc
+ package interpreter
+ 
+-import scala.tools.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
++import jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, ArgumentList }
+ import util.returning
+ 
+ /** One instance of a command buffer.
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala.sysjline	2011-08-24 07:55:31.000000000 +0200
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/ReplProps.scala	2011-11-08 19:13:18.273033788 +0100
+@@ -11,8 +11,8 @@ import scala.sys._
+ class ReplProps {
+   private def bool(name: String) = BooleanProp.keyExists(name)
+   
+-  val jlineDebug = bool("scala.tools.jline.internal.Log.debug")
+-  val jlineTrace = bool("scala.tools.jline.internal.Log.trace")
++  val jlineDebug = bool("jline.internal.Log.debug")
++  val jlineTrace = bool("jline.internal.Log.trace")
+   val noThreads  = bool("scala.repl.no-threads")
+ 
+   val info  = bool("scala.repl.info")
+diff -up scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/session/package.scala.sysjline scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/session/package.scala
+--- scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/session/package.scala.sysjline	2011-03-17 13:59:48.000000000 +0100
++++ scala-2.9.1.final-sources/src/compiler/scala/tools/nsc/interpreter/session/package.scala	2011-11-08 19:13:18.274033785 +0100
+@@ -13,10 +13,10 @@ package object session {
+   type JIterator[T]       = java.util.Iterator[T]
+   type JListIterator[T]   = java.util.ListIterator[T]
+ 
+-  type JEntry             = scala.tools.jline.console.history.History.Entry
+-  type JHistory           = scala.tools.jline.console.history.History
+-  type JMemoryHistory     = scala.tools.jline.console.history.MemoryHistory
+-  type JPersistentHistory = scala.tools.jline.console.history.PersistentHistory
++  type JEntry             = jline.console.history.History.Entry
++  type JHistory           = jline.console.history.History
++  type JMemoryHistory     = jline.console.history.MemoryHistory
++  type JPersistentHistory = jline.console.history.PersistentHistory
+   
+   private[interpreter] implicit def charSequenceFix(x: CharSequence): String = x.toString
+ }
diff --git a/scala.spec b/scala.spec
index 3c87c48..35269d9 100644
--- a/scala.spec
+++ b/scala.spec
@@ -14,6 +14,12 @@ URL:            http://www.scala-lang.org/
 # Source
 Source0:        http://www.scala-lang.org/downloads/distrib/files/scala-%{fullversion}-sources.tgz
 
+# Change the default classpath (SCALA_HOME)
+Patch1:		scala-2.9.1-tooltemplate.patch
+
+# Use system jline2 instead of bundled jline2
+Patch2:	        scala-2.9.1-use_system_jline.patch
+
 Source21:       scala.keys
 Source22:       scala.mime
 Source23:       scala-mime-info.xml
@@ -21,7 +27,8 @@ Source24:       scala.ant.d
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-%define jline_jar /usr/share/java/jline2.jar
+%global jline2_jar /usr/share/java/jline2.jar
+%global jansi_jar /usr/share/java/jansi.jar
 
 # Force build with openjdk/icedtea because gij is horribly slow and I haven't
 # been successful at integrating aot compilation with the build process
@@ -35,7 +42,8 @@ BuildRequires:  shtool
 Requires:       java
 Requires:       jline2
 Requires:       jpackage-utils
-Requires:       %{jline_jar}
+Requires:       %{jline2_jar}
+Requires:	%{jansi_jar}
 
 %description
 Scala is a general purpose programming language designed to express common
@@ -78,10 +86,17 @@ the Scala programming language
 
 %prep
 %setup -q -n scala-%{fullversion}-sources
+%patch1 -p1 -b .tool
+%patch2 -p1 -b .sysjline
+
+pushd src
+rm -rf jline
+popd
 
 %build
+
 export ANT_OPTS="-Xms1024m -Xmx1024m"
-%ant build
+%ant build docs
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -98,7 +113,8 @@ for libname in scala-compiler scala-dbc scala-library scala-partest scala-swing
         ln -s $libname-%{fullversion}.jar $RPM_BUILD_ROOT%{_javadir}/scala/$libname.jar
         shtool mkln -s $RPM_BUILD_ROOT%{_javadir}/scala/$libname.jar $RPM_BUILD_ROOT%{scaladir}/lib
 done
-shtool mkln -s $RPM_BUILD_ROOT%{jline_jar} $RPM_BUILD_ROOT%{scaladir}/lib
+shtool mkln -s $RPM_BUILD_ROOT%{jline2_jar} $RPM_BUILD_ROOT%{scaladir}/lib
+shtool mkln -s $RPM_BUILD_ROOT%{jansi_jar} $RPM_BUILD_ROOT%{scaladir}/lib
 
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/ant.d
 install -p -m 644 %{SOURCE24} $RPM_BUILD_ROOT%{_sysconfdir}/ant.d/scala
@@ -113,6 +129,9 @@ install -p -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_datadir}/mime/packages/
 
 sed -i -e 's, at JAVADIR@,%{_javadir},g' -e 's, at DATADIR@,%{_datadir},g' $RPM_BUILD_ROOT%{_bindir}/*
 
+install -d $RPM_BUILD_ROOT%{_mandir}/man1
+install -p -m 644 build/scaladoc/manual/man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1
+
 %post
 update-mime-database %{_datadir}/mime &> /dev/null || :
 
@@ -132,6 +151,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc README
 %{_datadir}/mime-info/*
 %{_datadir}/mime/packages/*
+%{_mandir}/man1/*
 
 %files -n ant-scala
 %defattr(-,root,root,-)
@@ -141,7 +161,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files apidoc
 %defattr(-,root,root,-)
-# %doc dists/scala-%{fullversion}/doc/scala-devel-docs/api
+%doc build/scaladoc/library/*
 %doc docs/LICENSE
 
 %files examples


More information about the scm-commits mailing list