Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request ether#270 from kingkaeru/master
Browse files Browse the repository at this point in the history
Modifications to support cygwin
  • Loading branch information
JohnMcLear committed Jun 1, 2011
2 parents 84b081c + a86ced4 commit b9857b9
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 14 deletions.
24 changes: 24 additions & 0 deletions INSTALL
Expand Up @@ -59,3 +59,27 @@ etherpad*.deb in the directory one level above your current directory.

* To run it, do etc/init.d/etherpad start

OPTION #3. INSTALLING ON WINDOWS SYSTEMS WITH CYGWIN

* Install the dependencies in paths that do not contain spaces: cygwin, Scala 2.7, Sun Java JDK 6 or OpenJDK 6, libmysql-java

* Uninstall gcj if it's installed as it seems to interfere with the
Scala compiler. You can safely reinstall it after compiling Etherpad
if you want to.

* Run bin/build.sh

* Create a MySQL database "etherpad" and a database user "etherpad"

* Copy etherpad/etc/etherpad.localdev-default.properties to etherpad/etc/etherpad.local.properties

* Edit etherpad/etc/etherpad.local.properties and set
etherpad.SQL_JDBC_URL
Example etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad
etherpad.SQL_PASSWORD
etherpad.SQL_USERNAME = etherpad
etherpad.adminPass
topdomains
Example: topdomains = yourhostname.com,localhost

* You can now run etherpad via bin/run.sh
2 changes: 2 additions & 0 deletions bin/build.sh
Expand Up @@ -31,6 +31,7 @@ cp "$ETHERPADDIR"/infrastructure/build/appjet.jar $ETHERPADDIR/etherpad/appjet-e
rm -rf "$ETHERPADDIR"/infrastructure/{appjet,build,buildjs,buildcache}

# Rebuild modules
if [[ $(uname -s) != CYGWIN* ]]; then
(
cd "$ETHERPADDIR"
ls etherpad/src/plugins/ | while read name; do
Expand All @@ -42,3 +43,4 @@ rm -rf "$ETHERPADDIR"/infrastructure/{appjet,build,buildjs,buildcache}
)
done
)
fi
9 changes: 8 additions & 1 deletion bin/exports.sh
Expand Up @@ -36,6 +36,14 @@ if [ `uname` == "FreeBSD" ]; then
export SCALA_LIBRARY_JAR="/usr/local/share/scala-2.7.7/lib/scala-library.jar"
export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:/usr/local/mysql/bin:$PATH"
export MYSQL_CONNECTOR_JAR="/usr/local/share/java/classes/mysql-connector-java.jar"
elif [[ $(uname -s) == CYGWIN* ]]; then
export JAVA_HOME="C:\Etherpad\JDK1.6_23"
export SCALA_HOME="C:\Etherpad\scala-2.7.4.final"
export JAVA="$JAVA_HOME\bin\java"
export SCALA="$SCALA_HOME\bin\scala"
export SCALA_LIBRARY_JAR="$SCALA_HOME\lib\scala-library.jar"
export PATH="$JAVA_HOME\bin:$SCALA_HOME\bin:$PATH"
export MYSQL_CONNECTOR_JAR="C:\Etherpad\mysql-connector-java-5.1.16\mysql-connector-java-5.1.16-bin.jar"
else
[ -e "/usr/lib/jvm/java-6-openjdk" ] && export JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
[ -e "/usr/lib/jvm/java-6-sun" ] && export JAVA_HOME="/usr/lib/jvm/java-6-sun"
Expand Down Expand Up @@ -67,4 +75,3 @@ if ! [ -e "$SCALA" ]; then
echo "Scala cannot be found '$SCALA' not found - Download it here: http://www.scala-lang.org/"
exit 1
fi

24 changes: 20 additions & 4 deletions etherpad/bin/run-local.sh
Expand Up @@ -65,15 +65,31 @@ if [ ! -z $1 ]; then
fi
fi

CP="appjet-eth-dev.jar:data"
for f in lib/*.jar; do
CP="$CP:$f"
done
CP=""
if [[ $(uname -s) == CYGWIN* ]]; then
_tmp=`readlink -f "appjet-eth-dev.jar"`
CP=`cygpath -wp "${_tmp}"`
_tmp=`readlink -f "data"`
CP="${CP}\;"`cygpath -wp "${tmp}"`
for f in `readlink -f "lib/*.jar"`; do
CP="$CP\;"`cygpath -wp "${f}"`
done
else
CP="appjet-eth-dev.jar:data"
for f in lib/*.jar; do
CP="$CP:$f"
done
fi


if [ -z "$JAVA" ]; then
JAVA=java
fi

if [[ $(uname -s) == CYGWIN* ]]; then
JAVA=java
fi

# etherpad properties file
cfg_file=./etc/etherpad.local.properties
if [ ! -f $cfg_file ]; then
Expand Down
22 changes: 22 additions & 0 deletions infrastructure/ace/bin/classpath.sh
@@ -0,0 +1,22 @@
#!/bin/bash

# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

CP="./"
for f in `readlink -f "lib/*.jar"`; do
CP="${CP}\;"`cygpath -wp "${f}"`
done
echo $CP

10 changes: 9 additions & 1 deletion infrastructure/ace/bin/make
@@ -1,7 +1,15 @@
#!/bin/sh
mkdir -p ../../etherpad/src/etherpad/collab/ace
mkdir -p ../../etherpad/src/static/js
exec scala -nocompdaemon -classpath lib/yuicompressor-2.4-appjet.jar:lib/rhino-js-1.7r1.jar $0 $@

JARFILES="."
if [[ $(uname -s) == CYGWIN* ]]; then
CP=`bin/classpath.sh`
exec scala -classpath $CP $0 $@
else
exec scala -nocompdaemon -classpath lib/yuicompressor-2.4-appjet.jar:lib/rhino-js-1.7r1.jar $0 $@
fi

!#

import java.io._;
Expand Down
13 changes: 10 additions & 3 deletions infrastructure/bin/classpath.sh
Expand Up @@ -15,7 +15,14 @@
# limitations under the License.

CP="./"
for f in `ls lib/*.jar`; do
CP="${CP}:${f}"
done

if [[ $(uname -s) == CYGWIN* ]]; then
for f in `readlink -f "lib/*.jar"`; do
CP="${CP}\;"`cygpath -wp "${f}"`
done
else
for f in `ls lib/*.jar`; do
CP="${CP}:${f}"
done
fi
echo $CP
21 changes: 17 additions & 4 deletions infrastructure/bin/comp.sh
Expand Up @@ -32,7 +32,13 @@ fi
echo compiling with \'$CC\'...

CP=`bin/classpath.sh`
CP="build/:${CP}"

if [[ $(uname -s) == CYGWIN* ]]; then
_tmp=`readlink -f build`
CP="${CP}\;"`cygpath -wp "${_tmp}"`
else
CP="build/:${CP}"
fi

if [ -z "$OBFUSC" ]; then
OBFUSC=0
Expand Down Expand Up @@ -183,17 +189,24 @@ echo "copying files..."
cp net.appjet.ajstdlib/streaming-client.js build/net/appjet/ajstdlib/
if [ $OBFUSC ] ; then
echo obfuscating...
scala -classpath $CP:. net.appjet.bodylock.compressor \
build/net/appjet/ajstdlib/streaming-client.js
if [[ $(uname -s) == CYGWIN* ]]; then
scala -classpath $CP net.appjet.bodylock.compressor \
build/net/appjet/ajstdlib/streaming-client.js
else
scala -classpath $CP:. net.appjet.bodylock.compressor \
build/net/appjet/ajstdlib/streaming-client.js
fi
fi

cp net.appjet.ajstdlib/streaming-iframe.html build/net/appjet/ajstdlib/
mkdir -p build/net/appjet/ajstdlib/modules

JSFILES=`find framework-src -name '*.js'`

echo "building javascript classfiles..."
scala -classpath $CP net.appjet.bodylock.Compiler \
-destination=build/net/appjet/ajstdlib/ \
-cutPrefix=framework-src \
`find framework-src -name '*.js'`
$JSFILES

echo "done."
7 changes: 6 additions & 1 deletion infrastructure/bin/makejar.sh
Expand Up @@ -63,7 +63,12 @@ cp ../buildcache/JAR/appjet.jar ./

echo "making JAR..."
mv appjet.jar /tmp/appjet.jar
$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala dojox
if [[ $(uname -s) == CYGWIN* ]]; then
_tmp=`readlink -f "/tmp/appjet.jar"`
$JAR uf `cygpath -wp "${_tmp}"` . #META-INF com javax org net uk v scala dojox
else
$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala dojox
fi
mv /tmp/appjet.jar ./

echo "cleaning up..."
Expand Down

0 comments on commit b9857b9

Please sign in to comment.