diff -ruN grass-6.4.1-orig/lib/init/init.sh grass-6.4.1/lib/init/init.sh --- grass-6.4.1-orig/lib/init/init.sh 2011-05-23 20:38:02.000000000 +0900 +++ grass-6.4.1/lib/init/init.sh 2011-05-23 21:34:33.000000000 +0900 @@ -25,7 +25,8 @@ trap "echo 'User break!' ; exit" 2 3 15 # Set default GUI -DEFAULT_GUI="wxpython" +# Fink's GRASS does not support wxPython. +DEFAULT_GUI="tcltk" # the following is only meant to be an internal variable for debugging this script. # use 'g.gisenv set="DEBUG=[0-5]"' to turn GRASS debug mode on properly. @@ -303,11 +304,12 @@ fi if [ ! "$GRASS_PYTHON" ] ; then - if [ "$MACOSX" ] ; then - GRASS_PYTHON=pythonw - else +# if [ "$MACOSX" ] ; then +# GRASS_PYTHON=pythonw +# else +# Fink's python does not include pythonw GRASS_PYTHON=python - fi +# fi export GRASS_PYTHON fi @@ -819,16 +821,13 @@ # Check for tcltk interface tcltk | gis.m) - if [ "$sh" != "bash" ] && [ "$sh" != "msh" ] && [ "$sh" != "cygwin" ]; then - # trap is not supported by csh/tcsh and rc - "$GISBASE/scripts/gis.m" - fi; + "$GISBASE/scripts/gis.m" ;; oldtcltk | d.m) "$GISBASE/scripts/d.m" ;; wxpython) - "$GRASS_PYTHON" "$GISBASE/etc/wxpython/wxgui.py" & + "$GISBASE/etc/wxpython/scripts/wxgui" ;; # Ignore others @@ -971,11 +970,6 @@ echo "export PATH=\"$PATH\"" >> "$bashrc" echo "export HOME=\"$USERHOME\"" >> "$bashrc" # restore user home path - echo 'export GRASS_SHELL_PID=$$' >> "$bashrc" # can be used to terminate GRASS session from GUI - if [ "$GRASS_GUI" = tcltk ] || [ "$GRASS_GUI" = gis.m ]; then - echo '$GISBASE/scripts/gis.m' >> "$bashrc" # Start gis.m - fi; - echo 'trap "echo \"GUI issued an exit\"; exit" SIGQUIT' >> "$bashrc" "$ETC/run" "$SHELL" EXIT_VAL=$? @@ -1025,15 +1019,6 @@ d.mon stop="$MON" done -# Attempt to close any open gis.m instances. -if [ -n "$TCLTKGRASSBASE" ] && [ `ps -a | grep -c "$GRASS_WISH"` -ge 1 ] ; then - echo "Closing open gis.m sessions....." - echo 'foreach gwin [lsearch -all -inline [winfo interps] gm_tcl*] { - catch {send -async $gwin Gm::remoteExit $env(GIS_LOCK)} - } - exit' | "$GRASS_WISH" #>/dev/null 2>&1 -fi - echo "Cleaning up temporary files ..." "$ETC/clean_temp" > /dev/null diff -ruN grass-6.4.1-orig/macosx/Makefile grass-6.4.1/macosx/Makefile --- grass-6.4.1-orig/macosx/Makefile 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/Makefile 2011-05-23 21:35:02.000000000 +0900 @@ -4,8 +4,8 @@ MACOSX_APP_NAME = GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.app MACOSX_APPDIR = ${MACOSX_APP_NAME}/Contents/MacOS -INST_DIR_MACOSX = ${prefix}/${MACOSX_APPDIR} -MACOSX_SUPPDIR = /Library/GRASS/${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} +INST_DIR_MACOSX = ${INST_DIR}/Applications/${MACOSX_APPDIR} +MACOSX_SUPPDIR = ${INST_DIR}/lib/GRASS/${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} MACOSX_BUNDLE_PREFIX = ${GRASS_HOME}/macosx/dist/${MACOSX_APPDIR} VER_MINOR_REL = `printf "%d0%d" ${GRASS_VERSION_MINOR} ${GRASS_VERSION_RELEASE}` VER_DATE = `date +"%g%m%d"` @@ -50,12 +50,12 @@ # Duplicated, mostly, from the top-level makefile. -real-install-macosx: INST_DIR_TARGET = ${INST_DIR} -real-install-macosx: PREFIX_TARGET = ${prefix} +real-install-macosx: INST_DIR_TARGET = ${INST_DIR_MACOSX} +real-install-macosx: PREFIX_TARGET = ${INST_DIR} real-install-macosx: install-basic-macosx macosx-support-dir bundle-macosx -cd ${GISBASE} ; tar cBf - modbuild | (cd ${MACOSX_SUPPDIR} ; tar xBf - ) 2>/dev/null @# help file package - ${LN_DIR} "${INST_DIR_TARGET}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} + ${LN_DIR} "${INST_DIR_TARGET}/docs/html" ${INST_DIR_MACOSX}/share/doc/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} # create a packagemaker installer package. # pretty much the same as install, but needs intermediate install location @@ -85,7 +85,7 @@ install-basic-macosx: ${MAKE_DIR_CMD} ${INST_DIR_TARGET} - -cd ${GISBASE} ; tar cBf - ${MACOSX_APP_NAME} | (cd ${PREFIX_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - ${MACOSX_APP_NAME} | (cd ${PREFIX_TARGET}/Applications ; tar xBf - ) 2>/dev/null -cd ${GISBASE} ; tar cBf - $(FILES) | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null -cd ${GISBASE} ; tar cBf - bin | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null -cd ${GISBASE} ; tar cBf - bwidget | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null @@ -99,10 +99,10 @@ -cd ${GISBASE} ; tar cBf - include | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null -cd ${GISBASE} ; tar cBf - lib | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null -sed 's#'${GISBASE}'#'${INST_DIR_TARGET}'#g' ${GISBASE}/etc/monitorcap > ${INST_DIR_TARGET}/etc/monitorcap - -chmod -R a+rX ${PREFIX_TARGET}/${MACOSX_APP_NAME} 2>/dev/null + -chmod -R a+rX ${PREFIX_TARGET}/Applications/${MACOSX_APP_NAME} 2>/dev/null -cd ${GRASS_HOME} ; tar cBf - gem/skeleton | (cd ${INST_DIR_TARGET}/etc ; tar xBf - ) 2>/dev/null -${INSTALL} ${GRASS_HOME}/gem/gem6 ${INST_DIR_TARGET} 2>/dev/null - -touch ${PREFIX_TARGET}/${MACOSX_APP_NAME} + -touch ${PREFIX_TARGET}/Applications/${MACOSX_APP_NAME} macosx-support-dir: ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR} diff -ruN grass-6.4.1-orig/macosx/app/build_gui_user_menu.sh grass-6.4.1/macosx/app/build_gui_user_menu.sh --- grass-6.4.1-orig/macosx/app/build_gui_user_menu.sh 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/app/build_gui_user_menu.sh 2011-05-24 07:27:20.000000000 +0900 @@ -13,7 +13,7 @@ GRASS_MMVER=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"` BINDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/bin" -BINDIRG="/Library/GRASS/$GRASS_MMVER/Modules/bin" +BINDIRG="@PREFIX@/lib/GRASS/$GRASS_MMVER/Modules/bin" MENUDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/etc" echo "Rebuilding Addon menu..." diff -ruN grass-6.4.1-orig/macosx/app/build_html_user_index.sh grass-6.4.1/macosx/app/build_html_user_index.sh --- grass-6.4.1-orig/macosx/app/build_html_user_index.sh 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/app/build_html_user_index.sh 2011-05-24 07:31:21.000000000 +0900 @@ -19,13 +19,13 @@ GRASS_MMVER=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"` GRASSVERSION=`cat "$GISBASE/etc/VERSIONNUMBER"` HTMLDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/docs/html" -HTMLDIRG="/Library/GRASS/$GRASS_MMVER/Modules/docs/html" +HTMLDIRG="@PREFIX@/lib/GRASS/$GRASS_MMVER/Modules/docs/html" # $1 is current path to GRASS.app/Contents/MacOS, defaults to /Applications if [ "$1" != "" ] ; then GISBASE=$1 else - GISBASE="/Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS" + GISBASE="@PREFIX@/Applications/GRASS-$GRASS_MMVER.app/Contents/MacOS" fi write_html_header() @@ -184,4 +184,5 @@ # add Help Viewer link in user docs folder +mkdir -p $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER ln -sfh ../../GRASS/$GRASS_MMVER/Modules/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER diff -ruN grass-6.4.1-orig/macosx/app/grass.sh.in grass-6.4.1/macosx/app/grass.sh.in --- grass-6.4.1-orig/macosx/app/grass.sh.in 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/app/grass.sh.in 2011-05-24 07:28:43.000000000 +0900 @@ -32,7 +32,7 @@ grass_ver=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"` GISBASE_USER="$HOME/Library/GRASS/$grass_ver" -GISBASE_SYSTEM="/Library/GRASS/$grass_ver" +GISBASE_SYSTEM="@PREFIX@/lib/GRASS/$grass_ver" # for extra utils # ideally user should have these in their PATH, but make sure here @@ -96,47 +96,13 @@ # assume user TclTk progs in default build location /usr/local/bin. # check even if /usr/local/bin not in PATH, this is where Aqua will be # also assume matching tclsh alongside wish -if [ ! "$GRASS_WISH" ] ; then - gwish="" - gtclsh="" - if [ -e "/usr/local/bin/wish8.5" ] ; then - gwish="/usr/local/bin/wish8.5" - gtclsh="/usr/local/bin/tclsh8.5" - else - # check for any other wish8.5 - wish85=`type -p wish8.5` - tclsh85=`type -p tclsh8.5` - if [ "$wish85" ] ; then - gwish="$wish85" - gtclsh="$tclsh85" - else - # check for any wish8.4 - wish84=`type -p wish8.4` - tclsh84=`type -p tclsh8.4` - if [ ! "$wish84" ] ; then - # or maybe /usr/local/bin not in PATH - wish84="/usr/local/bin/wish8.4" - tclsh84="/usr/local/bin/tclsh8.4" - fi - if [ -e "$wish84" ] ; then - # make sure it's not aqua - # aqua wish is a shell script that starts framework wish - if [ "`file $wish84 | grep 'shell script'`" ] ; then - echo "Warning: TclTk Aqua 8.4 unsupported" - else - gwish="$wish84" - gtclsh="$tclsh84" - fi - fi - fi - fi - if [ "$gwish" ] ; then - GRASS_WISH="$gwish" - export GRASS_WISH - GRASS_TCLSH="$gtclsh" - export GRASS_TCLSH - fi -fi + +gwish="MACORX11/bin/wish" +gtclsh="MACORX11/bin/tclsh" +GRASS_WISH="$gwish" +export GRASS_WISH +GRASS_TCLSH="$gtclsh" +export GRASS_TCLSH ### X11 stuff @@ -184,62 +150,15 @@ # change GRASS_WXBUNDLED and pyver_want here from bundle.make, or manually GRASS_WXBUNDLED= export GRASS_WXBUNDLED -pyexe="pythonw" +pyexe="python" GRASS_PYTHONWX="$pyexe" pyver_want="@PYVER@" GRASS_WX64BIT="@WX64BIT@" export GRASS_WX64BIT -# make sure python version used matches what wxpython wants -py="" -# did user set GRASS_PYTHON already? check it (must have pythonw) -if [ "$GRASS_PYTHON" ] ; then - py=`echo "$GRASS_PYTHON" | grep pythonw` - if [ "$py" ] ; then - case $GRASS_PYTHON in - /*) py="$GRASS_PYTHON" ;; - *) py=`type -p $GRASS_PYTHON` - esac - pyver=`$py -V 2>&1 | grep " $pyver_want"` - if [ ! "$pyver" ] ; then - py="" - fi - else - py="" - fi -fi # GRASS_PYTHON -# try in shell path -if [ ! "$py" ] ; then - py=`type -p pythonw$pyver_want` - if [ "$py" ] ; then - pyver=`$py -V 2>&1 | grep " $pyver_want"` - if [ ! "$pyver" ] ; then - py="" - fi - fi -fi -# try standard framework -if [ ! "$py" ] ; then - py="/Library/Frameworks/Python.framework/Versions/$pyver_want/bin/python" - if [ ! -x "$py" ] ; then - py="" - fi -fi -# try system (may be the same as in shell path) -if [ ! "$py" ] ; then - py="/usr/bin/pythonw$pyver_want" - pyver=`$py -V 2>&1 | grep " $pyver_want"` - if [ ! "$pyver" ] ; then - py="" - fi -fi -if [ "$py" ] ; then - echo "$pyver found." - GRASS_PYTHONWX="$py" -else - echo "Warning: No Python $pyver_want found, needed by wxPython." - echo " The wxPython GUI may not work properly." -fi + +# Use Fink's python +GRASS_PYTHONWX="@PREFIX@/bin/python" export GRASS_PYTHONWX # we will execute python scripts from the python wrapper script GRASS_PYTHON="python" @@ -252,8 +171,8 @@ if [ -f "$GRASSRC" ] ; then GRASS_GUI=`awk '/GRASS_GUI/ {print $2}' "$GRASSRC"` fi - if [ -z "$GRASS_GUI" ] ; then - unset GRASS_GUI + if [ ! "$GRASS_GUI" ] ; then + GRASS_GUI="tcltk" fi fi if [ "$GRASS_GUI" = "text" ] && [ "$x11" = "tig" ] ; then diff -ruN grass-6.4.1-orig/macosx/app/python_wrapper grass-6.4.1/macosx/app/python_wrapper --- grass-6.4.1-orig/macosx/app/python_wrapper 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/app/python_wrapper 2011-05-23 21:37:19.000000000 +0900 @@ -29,9 +29,7 @@ SYSARCH=`uname -p` SYSVER=`uname -r | cut -d . -f 1` -if [ ! "$GRASS_PYTHONWX" ] ; then - GRASS_PYTHONWX="pythonw" -fi +GRASS_PYTHONWX="python" # can't run python 64bit if wx not 64bit, assume OSX 10.5+ possible 64bit if [ $(($SYSVER)) -gt 5 ] && [ "$GRASS_WX64BIT" = "0" ] ; then case $SYSARCH in diff -ruN grass-6.4.1-orig/macosx/modbuild/Makefile grass-6.4.1/macosx/modbuild/Makefile --- grass-6.4.1-orig/macosx/modbuild/Makefile 2011-05-23 20:38:04.000000000 +0900 +++ grass-6.4.1/macosx/modbuild/Makefile 2011-05-24 07:29:31.000000000 +0900 @@ -9,7 +9,7 @@ MACOSX_APP_NAME = GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.app endif MACOSX_APPDIR = ${MACOSX_APP_NAME}/Contents/MacOS -INST_DIR_MACOSX = ${prefix}/${MACOSX_APPDIR} +INST_DIR_MACOSX = ${INST_DIR}/Applications/${MACOSX_APPDIR} default: modbuild @@ -19,7 +19,7 @@ -cp -f ReadMe.rtf $(ARCH_DISTDIR)/modbuild/ mkdir -p $(ARCH_DISTDIR)/modbuild/dist.$(ARCH) -cp -rf $(ARCH_DISTDIR)/demolocation $(ARCH_DISTDIR)/modbuild/dist.$(ARCH)/ - -sed -e 's,^GISDBASE.*,GISDBASE = /Library/GRASS/$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)/modbuild/dist.$(ARCH),g' $(ARCH_DISTDIR)/demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) > $(ARCH_DISTDIR)/modbuild/dist.$(ARCH)/demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) + -sed -e 's,^GISDBASE.*,GISDBASE = @PREFIX@/lib/GRASS/$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)/modbuild/dist.$(ARCH),g' $(ARCH_DISTDIR)/demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) > $(ARCH_DISTDIR)/modbuild/dist.$(ARCH)/demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) mkdir -p $(ARCH_DISTDIR)/modbuild/module mkdir -p $(ARCH_DISTDIR)/modbuild/include/Make -cp $(MODULE_TOPDIR)/include/Make/Dir.make $(ARCH_DISTDIR)/modbuild/include/Make/ @@ -44,7 +44,7 @@ @#GISBASE = $(INST_DIR_MACOSX)\ @#endif#g' @# html.make needs a little change - sed -e 's,GISRC=$$(RUN_GISBASE),GISRC=/Library/GRASS/$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)/modbuild/dist.$$(ARCH),g' $(MODULE_TOPDIR)/include/Make/Html.make > $(ARCH_DISTDIR)/modbuild/include/Make/Html.make + sed -e 's,GISRC=$$(RUN_GISBASE),GISRC=@PREFIX@/lib/GRASS/$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)/modbuild/dist.$$(ARCH),g' $(MODULE_TOPDIR)/include/Make/Html.make > $(ARCH_DISTDIR)/modbuild/include/Make/Html.make -cp $(MODULE_TOPDIR)/include/Make/Lib.make $(ARCH_DISTDIR)/modbuild/include/Make/ -cp $(MODULE_TOPDIR)/include/Make/Man.make $(ARCH_DISTDIR)/modbuild/include/Make/ sed -e 's,$$(DEPENDENCIES),,g' $(MODULE_TOPDIR)/include/Make/Module.make > $(ARCH_DISTDIR)/modbuild/include/Make/Module.make