forked from kovzol/geogebra-discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun5
executable file
·54 lines (48 loc) · 1.65 KB
/
run5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# This script can be called from anywhere.
MYBASENAME=`perl -MCwd -e 'print Cwd::abs_path shift' "$0"`
MYPATH=`dirname "$MYBASENAME"`
. "$MYPATH"/helper/detect
BINDIR=fork/geogebra/desktop/build/install/desktop/bin
test -r "$MYPATH"/$BINDIR/desktop
if [ "$OS_VARIANT" = Mac ]; then
export JAVA_HOME=`perl -MCwd -e 'print Cwd::abs_path shift' buildtools/jbrsdk/Contents/Home`
else
if [ "$OS_VARIANT" != Raspbian ]; then
if [ "$OS_VARIANT" != Windows ]; then
export JAVA_HOME=`perl -MCwd -e 'print Cwd::abs_path shift' buildtools/jbr`
else
# If a 32-bit toolchain is started, we go for running a 32-bit Java:
if [[ "$OS_VERSION" == *"MINGW32"* ]]; then
export JAVA_HOME=`find /c/Program\ Files\ \(x86\)\/Java/* | sort | grep jdk | head -1`
else
# ...otherwise we use a 64-bit version.
# export JAVA_HOME=`find /c/Program\ Files\/OpenJDK/* | sort | head -1`
export JAVA_HOME=`find /c/Program\ Files\/Microsoft/jdk* | sort | head -1`
fi
fi
fi
fi
export MYPATH
REALGEOMWS=""
if [ "$MATHEMATICA" = "" ] ; then
CAS=tarski
else
CAS=mathematica
fi
# realgeom will be started only on Rasbian:
if [ "$OS_VARIANT" = Raspbian ]; then
. "$MYPATH"/helper/start-realgeom
REALGEOMWS="--realgeomws=remoteurl:http\\://localhost\\:8765,cas:$CAS,timeout:10,enable:true"
fi
if [ "$REALGEOMWS" != "" ]; then
echo -n "Launching GeoGebra..."
fi
export JAVA_OPTS="-Djava.library.path=\"$MYPATH\"/fork/geogebra/desktop/build"
$MYPATH/$BINDIR/desktop $REALGEOMWS "$@"
if [ "$REALGEOMWS" != "" ]; then
echo "GeoGebra session ended."
echo "Stopping RealGeom session..."
kill_descendant_processes $REALGEOM_PID
kill_descendant_processes $$
fi