Skip to content
This repository was archived by the owner on Jul 9, 2018. It is now read-only.

Commit a86ced4

Browse files
author
Randy
committed
modifications to support cygwin building and running. credit goes to gyokuro for his work in getting earlier pad versions to build with cygwin.
1 parent 1167560 commit a86ced4

File tree

9 files changed

+118
-14
lines changed

9 files changed

+118
-14
lines changed

INSTALL

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,27 @@ etherpad*.deb in the directory one level above your current directory.
5959

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

62+
OPTION #3. INSTALLING ON WINDOWS SYSTEMS WITH CYGWIN
63+
64+
* Install the dependencies in paths that do not contain spaces: cygwin, Scala 2.7, Sun Java JDK 6 or OpenJDK 6, libmysql-java
65+
66+
* Uninstall gcj if it's installed as it seems to interfere with the
67+
Scala compiler. You can safely reinstall it after compiling Etherpad
68+
if you want to.
69+
70+
* Run bin/build.sh
71+
72+
* Create a MySQL database "etherpad" and a database user "etherpad"
73+
74+
* Copy etherpad/etc/etherpad.localdev-default.properties to etherpad/etc/etherpad.local.properties
75+
76+
* Edit etherpad/etc/etherpad.local.properties and set
77+
etherpad.SQL_JDBC_URL
78+
Example etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad
79+
etherpad.SQL_PASSWORD
80+
etherpad.SQL_USERNAME = etherpad
81+
etherpad.adminPass
82+
topdomains
83+
Example: topdomains = yourhostname.com,localhost
84+
85+
* You can now run etherpad via bin/run.sh

bin/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cp "$ETHERPADDIR"/infrastructure/build/appjet.jar $ETHERPADDIR/etherpad/appjet-e
3131
rm -rf "$ETHERPADDIR"/infrastructure/{appjet,build,buildjs,buildcache}
3232

3333
# Rebuild modules
34+
if [[ $(uname -s) != CYGWIN* ]]; then
3435
(
3536
cd "$ETHERPADDIR"
3637
ls etherpad/src/plugins/ | while read name; do
@@ -42,3 +43,4 @@ rm -rf "$ETHERPADDIR"/infrastructure/{appjet,build,buildjs,buildcache}
4243
)
4344
done
4445
)
46+
fi

bin/exports.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ if [ `uname` == "FreeBSD" ]; then
3636
export SCALA_LIBRARY_JAR="/usr/local/share/scala-2.7.7/lib/scala-library.jar"
3737
export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:/usr/local/mysql/bin:$PATH"
3838
export MYSQL_CONNECTOR_JAR="/usr/local/share/java/classes/mysql-connector-java.jar"
39+
elif [[ $(uname -s) == CYGWIN* ]]; then
40+
export JAVA_HOME="C:\Etherpad\JDK1.6_23"
41+
export SCALA_HOME="C:\Etherpad\scala-2.7.4.final"
42+
export JAVA="$JAVA_HOME\bin\java"
43+
export SCALA="$SCALA_HOME\bin\scala"
44+
export SCALA_LIBRARY_JAR="$SCALA_HOME\lib\scala-library.jar"
45+
export PATH="$JAVA_HOME\bin:$SCALA_HOME\bin:$PATH"
46+
export MYSQL_CONNECTOR_JAR="C:\Etherpad\mysql-connector-java-5.1.16\mysql-connector-java-5.1.16-bin.jar"
3947
else
4048
[ -e "/usr/lib/jvm/java-6-openjdk" ] && export JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
4149
[ -e "/usr/lib/jvm/java-6-sun" ] && export JAVA_HOME="/usr/lib/jvm/java-6-sun"
@@ -67,4 +75,3 @@ if ! [ -e "$SCALA" ]; then
6775
echo "Scala cannot be found '$SCALA' not found - Download it here: http://www.scala-lang.org/"
6876
exit 1
6977
fi
70-

etherpad/bin/run-local.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,31 @@ if [ ! -z $1 ]; then
6565
fi
6666
fi
6767

68-
CP="appjet-eth-dev.jar:data"
69-
for f in lib/*.jar; do
70-
CP="$CP:$f"
71-
done
68+
CP=""
69+
if [[ $(uname -s) == CYGWIN* ]]; then
70+
_tmp=`readlink -f "appjet-eth-dev.jar"`
71+
CP=`cygpath -wp "${_tmp}"`
72+
_tmp=`readlink -f "data"`
73+
CP="${CP}\;"`cygpath -wp "${tmp}"`
74+
for f in `readlink -f "lib/*.jar"`; do
75+
CP="$CP\;"`cygpath -wp "${f}"`
76+
done
77+
else
78+
CP="appjet-eth-dev.jar:data"
79+
for f in lib/*.jar; do
80+
CP="$CP:$f"
81+
done
82+
fi
83+
7284

7385
if [ -z "$JAVA" ]; then
7486
JAVA=java
7587
fi
7688

89+
if [[ $(uname -s) == CYGWIN* ]]; then
90+
JAVA=java
91+
fi
92+
7793
# etherpad properties file
7894
cfg_file=./etc/etherpad.local.properties
7995
if [ ! -f $cfg_file ]; then

infrastructure/ace/bin/classpath.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Copyright 2009 Google Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS-IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
CP="./"
18+
for f in `readlink -f "lib/*.jar"`; do
19+
CP="${CP}\;"`cygpath -wp "${f}"`
20+
done
21+
echo $CP
22+

infrastructure/ace/bin/make

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
#!/bin/sh
22
mkdir -p ../../etherpad/src/etherpad/collab/ace
33
mkdir -p ../../etherpad/src/static/js
4-
exec scala -nocompdaemon -classpath lib/yuicompressor-2.4-appjet.jar:lib/rhino-js-1.7r1.jar $0 $@
4+
5+
JARFILES="."
6+
if [[ $(uname -s) == CYGWIN* ]]; then
7+
CP=`bin/classpath.sh`
8+
exec scala -classpath $CP $0 $@
9+
else
10+
exec scala -nocompdaemon -classpath lib/yuicompressor-2.4-appjet.jar:lib/rhino-js-1.7r1.jar $0 $@
11+
fi
12+
513
!#
614

715
import java.io._;

infrastructure/bin/classpath.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
# limitations under the License.
1616

1717
CP="./"
18-
for f in `ls lib/*.jar`; do
19-
CP="${CP}:${f}"
20-
done
18+
19+
if [[ $(uname -s) == CYGWIN* ]]; then
20+
for f in `readlink -f "lib/*.jar"`; do
21+
CP="${CP}\;"`cygpath -wp "${f}"`
22+
done
23+
else
24+
for f in `ls lib/*.jar`; do
25+
CP="${CP}:${f}"
26+
done
27+
fi
2128
echo $CP

infrastructure/bin/comp.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ fi
3232
echo compiling with \'$CC\'...
3333

3434
CP=`bin/classpath.sh`
35-
CP="build/:${CP}"
35+
36+
if [[ $(uname -s) == CYGWIN* ]]; then
37+
_tmp=`readlink -f build`
38+
CP="${CP}\;"`cygpath -wp "${_tmp}"`
39+
else
40+
CP="build/:${CP}"
41+
fi
3642

3743
if [ -z "$OBFUSC" ]; then
3844
OBFUSC=0
@@ -183,17 +189,24 @@ echo "copying files..."
183189
cp net.appjet.ajstdlib/streaming-client.js build/net/appjet/ajstdlib/
184190
if [ $OBFUSC ] ; then
185191
echo obfuscating...
186-
scala -classpath $CP:. net.appjet.bodylock.compressor \
187-
build/net/appjet/ajstdlib/streaming-client.js
192+
if [[ $(uname -s) == CYGWIN* ]]; then
193+
scala -classpath $CP net.appjet.bodylock.compressor \
194+
build/net/appjet/ajstdlib/streaming-client.js
195+
else
196+
scala -classpath $CP:. net.appjet.bodylock.compressor \
197+
build/net/appjet/ajstdlib/streaming-client.js
198+
fi
188199
fi
189200

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

204+
JSFILES=`find framework-src -name '*.js'`
205+
193206
echo "building javascript classfiles..."
194207
scala -classpath $CP net.appjet.bodylock.Compiler \
195208
-destination=build/net/appjet/ajstdlib/ \
196209
-cutPrefix=framework-src \
197-
`find framework-src -name '*.js'`
210+
$JSFILES
198211

199212
echo "done."

infrastructure/bin/makejar.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ cp ../buildcache/JAR/appjet.jar ./
6363

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

6974
echo "cleaning up..."

0 commit comments

Comments
 (0)