3 SCRIPTDIR=`dirname "$0"`
4 RESDIR=${SCRIPTDIR}/../Resources/
5 PKGDIR=${SCRIPTDIR}/../Pkgs/
7 #run the path_helper to set the $PATH for accessing python
8 if [ -x /usr/libexec/path_helper ]; then
9 eval `/usr/libexec/path_helper -s`
14 /usr/bin/osascript > /dev/null <<-EOF
15 tell application "System Events"
17 display dialog "$@" buttons {"Ok"}
22 #Testing for python2.7, which we need and is not always installed on MacOS 1.6
26 displayMessage "Python 2.7 is missing from your system. Cura requires Python2.7.\nStarting the installer" $PATH
28 hdiutil attach $PKGDIR/python-2.7.3-macosx10.6.dmg
29 open -W /Volumes/Python\ 2.7.3/Python.mpkg
30 hdiutil detach /Volumes/Python\ 2.7.3
31 # Check the installation
34 displayMessage "Failed to install python2.7"
39 #Next check for numpy, numpy does not always run under 64bit, so we need to check if we need to use "arch -i386"
40 $PY -c 'import numpy' 2> /dev/null
42 PY="arch -i386 python2.7"
45 displayMessage "Numpy is missing from your system, this is required.\nStarting the installer"
47 hdiutil attach $PKGDIR/numpy-1.6.2-py2.7-python.org-macosx10.3.dmg
48 open -W /Volumes/numpy/numpy-1.6.2-py2.7.mpkg
49 hdiutil detach /Volumes/numpy
50 #After installing numpy, we need to check if we need to use arch -386 again
54 PY="arch -i386 python2.7"
57 displayMessage "Failed to install numpy."
67 displayMessage "wxPython is missing from your system. Cura requires wxPython.\nStarting the installer"
68 # Start wxPython installer
69 hdiutil attach $PKGDIR/wxPython2.9-osx-2.9.4.0-cocoa-py2.7.dmg
70 open -W /Volumes/wxPython2.9-osx-2.9.4.0-cocoa-py2.7/wxPython2.9-osx-cocoa-py2.7.pkg
71 hdiutil detach /Volumes/wxPython2.9-osx-2.9.4.0-cocoa-py2.7
72 #Check if wxPython is installed correctly
75 displayMessage "Failed to properly install wxPython."
81 $PY -c 'import OpenGL'
84 if [ ! -d "$PKGDIR/PyOpenGL-3.0.2/build/lib" ]; then
86 tar -xzf PyOpenGL-3.0.2.tar.gz
90 export PYTHONPATH="$PYTHONPATH:$PKGDIR/PyOpenGL-3.0.2/build/lib"
91 # Test if the installation was succesful
93 $PY -c 'import OpenGL'
95 displayMessage "Failed to properly use PyOpenGL."
101 $PY -c 'import serial'
104 if [ ! -d "$PKGDIR/pyserial-2.6/build/lib" ]; then
106 tar -xzf pyserial-2.6.tar.gz
110 export PYTHONPATH="$PYTHONPATH:$PKGDIR/pyserial-2.6/build/lib"
112 #Test if we have pyserial now
113 $PY -c 'import serial'
115 displayMessage "Failed to properly use PySerial."
120 #All checks passed, start Cura
121 $PY "${RESDIR}Cura/cura.py" &