diff -uNr grass-6.4.3/include/iostream/empq_impl.h grass-6.4.3.fink/include/iostream/empq_impl.h --- grass-6.4.3/include/iostream/empq_impl.h 2012-12-22 05:52:06.000000000 -0500 +++ grass-6.4.3.fink/include/iostream/empq_impl.h 2013-11-22 18:38:57.000000000 -0500 @@ -36,6 +36,8 @@ #define __EMPQ_IMPL_H #include +#include + using namespace std; #include "empq.h" diff -uNr grass-6.4.3/include/iostream/imbuffer.h grass-6.4.3.fink/include/iostream/imbuffer.h --- grass-6.4.3/include/iostream/imbuffer.h 2012-12-22 05:52:06.000000000 -0500 +++ grass-6.4.3.fink/include/iostream/imbuffer.h 2013-11-22 18:38:57.000000000 -0500 @@ -22,6 +22,9 @@ #include + +#include + #include #include diff -uNr grass-6.4.3/lib/init/init.sh grass-6.4.3.fink/lib/init/init.sh --- grass-6.4.3/lib/init/init.sh 2013-04-27 05:52:12.000000000 -0400 +++ grass-6.4.3.fink/lib/init/init.sh 2013-11-22 18:47:08.000000000 -0500 @@ -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. @@ -328,11 +329,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 @@ -844,16 +846,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 @@ -996,11 +995,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=$? @@ -1050,15 +1044,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 -uNr grass-6.4.3/lib/python/ctypes/ctypesgencore/printer/defaultheader.py grass-6.4.3.fink/lib/python/ctypes/ctypesgencore/printer/defaultheader.py --- grass-6.4.3/lib/python/ctypes/ctypesgencore/printer/defaultheader.py 2011-04-16 05:52:08.000000000 -0400 +++ grass-6.4.3.fink/lib/python/ctypes/ctypesgencore/printer/defaultheader.py 2013-11-22 18:38:57.000000000 -0500 @@ -1,7 +1,5 @@ '''Wrapper for %(name)s -Generated with: -%(argv)s Do not modify this file. ''' diff -uNr grass-6.4.3/macosx/Makefile grass-6.4.3.fink/macosx/Makefile --- grass-6.4.3/macosx/Makefile 2013-06-01 05:52:06.000000000 -0400 +++ grass-6.4.3.fink/macosx/Makefile 2013-11-22 18:38:57.000000000 -0500 @@ -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 @@ -106,10 +106,10 @@ ${GISBASE}/include/Make/Grass.make > ${INST_DIR_TARGET}/include/Make/Grass.make -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 -uNr grass-6.4.3/macosx/Makefile.orig grass-6.4.3.fink/macosx/Makefile.orig --- grass-6.4.3/macosx/Makefile.orig 1969-12-31 19:00:00.000000000 -0500 +++ grass-6.4.3.fink/macosx/Makefile.orig 2013-06-01 05:52:06.000000000 -0400 @@ -0,0 +1,123 @@ +MODULE_TOPDIR = .. + +include $(MODULE_TOPDIR)/include/Make/Platform.make + +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} +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"` +MAKE_DIR_CMD = mkdir -p -m 755 +LN = /bin/ln -sf +LN_DIR = /bin/ln -sfh +# get python version - use python in path, should be config'd python +PYVER = `python -V 2>&1 | cut -d \ -f 2 | cut -d . -f 1,2` + +# packagemaker location, options and behaviour changed in xcode 3 +ifeq ($(findstring darwin8,$(ARCH)),darwin8) +XCODE_VER = xcode2 +PACKAGEMAKER = /Developer/Tools/packagemaker +PKG_INST_DIR = ${prefix}/${MACOSX_APP_NAME} +else +XCODE_VER = xcode3 +PACKAGEMAKER = /Developer/usr/bin/packagemaker +PKG_INST_DIR = ${prefix} +endif + +SUBDIRS = +ifeq ($(MACOSX_APP),1) +SUBDIRS = app modbuild +endif + +FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT + +include $(MODULE_TOPDIR)/include/Make/Dir.make + +default: subdirs + +include bundle.make + +install-macosx: + echo ${ARCH_DISTDIR}/${MACOSX_APP_NAME} + @ if [ ! -d ${ARCH_DISTDIR}/${MACOSX_APP_NAME} ] ; then \ + echo "ERROR: GRASS.app has not been compiled. Try \"make\" in the top level source dir first."; \ + echo " Installation aborted, exiting Make."; \ + exit; \ + fi; \ + ${MAKE} real-install-macosx + +# Duplicated, mostly, from the top-level makefile. + +real-install-macosx: INST_DIR_TARGET = ${INST_DIR} +real-install-macosx: PREFIX_TARGET = ${prefix} +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} + +# create a packagemaker installer package. +# pretty much the same as install, but needs intermediate install location +# to assemble package parts. + +bindist-macosx: INST_DIR_TARGET = ${MACOSX_BUNDLE_PREFIX} +bindist-macosx: PREFIX_TARGET = ${GRASS_HOME}/macosx/dist +bindist-macosx: install-basic-macosx bundle-macosx + @# installer pkg resources + ${MAKE_DIR_CMD} dist/resources + -sed -e "s#@INST_DIR@#${INST_DIR}#g" -e "s#@MACOSX_SUPPDIR@#${MACOSX_SUPPDIR}#g" -e "s#@GRASS_VER@#${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}#g" -e "s#@PYVER@#${PYVER}#g" pkg/resources/postflight.in > dist/resources/postflight + -chmod a+rx dist/resources/postflight + -sed -e "s#@GRASS_VER@#${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}#g" pkg/resources/Description.plist.in > dist/Description.plist + -sed -e "s#@GRASS_VERSION_MAJOR@#${GRASS_VERSION_MAJOR}#g" -e "s#@GRASS_VERSION_MINOR@#${GRASS_VERSION_MINOR}#g" -e "s#@GRASS_VERSION_RELEASE@#${GRASS_VERSION_RELEASE}#g" -e "s#@VER_MINOR_REL@#${VER_MINOR_REL}#g" -e "s#@VER_DATE@#${VER_DATE}#g" -e "s#@PKG_INST_DIR@#${PKG_INST_DIR}#g" pkg/resources/Info.plist.in > dist/Info.plist + -${INSTALL_DATA} pkg/resources/License.rtf dist/resources + -${INSTALL_DATA} pkg/resources/ReadMe.rtf dist/resources + -cd ${GISBASE} ; tar cBf - modbuild | (cd ${GRASS_HOME}/macosx/dist/resources ; tar xBf - ) 2>/dev/null + @# build the package +ifeq ($(XCODE_VER),xcode3) + ${PACKAGEMAKER} --target 10.4 --root-volume-only --id org.osgeo.grass --root dist/${MACOSX_APP_NAME} --info dist/Info.plist --out "GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.pkg" --resources dist/resources + rm -f "GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.pkg/Contents/Resources/TokenDefinitions.plist" +else + ${PACKAGEMAKER} -build -ds -p "GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.pkg" -f dist/${MACOSX_APP_NAME} -r dist/resources -i dist/Info.plist -d dist/Description.plist +endif + @# remove intermediate files + @# -rm -rf dist 2>/dev/null + +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 - $(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 + -cd ${GISBASE} ; tar cBf - docs | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - driver | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - etc | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - fonts | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - scripts | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - tools | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null ; fi + -cd ${GISBASE} ; tar cBf - include | (cd ${INST_DIR_TARGET} ; tar xBf - ) 2>/dev/null + -sed -e "s#^\(GRASS_HOME.[^=]*\).*#\1= ${INST_DIR}#" \ + -e "s#^\(RUN_GISBASE.[^=]*\).*#\1= ${INST_DIR}#" \ + ${GISBASE}/include/Make/Platform.make > ${INST_DIR_TARGET}/include/Make/Platform.make + -sed -e "s#^\(ARCH_DISTDIR.[^=]*\).*#\1= ${INST_DIR}#" \ + -e "s#^\(ARCH_BINDIR.[^=]*\).*#\1= ${UNIX_BIN}#" \ + ${GISBASE}/include/Make/Grass.make > ${INST_DIR_TARGET}/include/Make/Grass.make + -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 + -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} + +macosx-support-dir: + ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR} + ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR}/Modules/bin + ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR}/Modules/docs/html + ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR}/Modules/etc + ${MAKE_DIR_CMD} ${MACOSX_SUPPDIR}/Modules/lib + +clean: cleansubdirs + -rm -rf ${ARCH_DISTDIR}/${MACOSX_APP_NAME}/ 2>/dev/null + -rm -rf ${ARCH_DISTDIR}/modbuild/ 2>/dev/null diff -uNr grass-6.4.3/macosx/app/build_gui_user_menu.sh grass-6.4.3.fink/macosx/app/build_gui_user_menu.sh --- grass-6.4.3/macosx/app/build_gui_user_menu.sh 2013-06-01 05:52:06.000000000 -0400 +++ grass-6.4.3.fink/macosx/app/build_gui_user_menu.sh 2013-11-22 18:48:37.000000000 -0500 @@ -14,7 +14,7 @@ GRASS_MMVER=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"` BINDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/bin" SCRIPTDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/scripts" -BINDIRG="/Library/GRASS/$GRASS_MMVER/Modules/bin" +BINDIRG="@PREFIX@/lib/GRASS/$GRASS_MMVER/Modules/bin" SCRIPTDIRG="/Library/GRASS/$GRASS_MMVER/Modules/scripts" MENUDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/etc" diff -uNr grass-6.4.3/macosx/app/build_html_user_index.sh grass-6.4.3.fink/macosx/app/build_html_user_index.sh --- grass-6.4.3/macosx/app/build_html_user_index.sh 2011-05-21 05:52:10.000000000 -0400 +++ grass-6.4.3.fink/macosx/app/build_html_user_index.sh 2013-11-22 18:38:57.000000000 -0500 @@ -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() diff -uNr grass-6.4.3/macosx/app/grass.sh.in grass-6.4.3.fink/macosx/app/grass.sh.in --- grass-6.4.3/macosx/app/grass.sh.in 2013-06-01 05:52:06.000000000 -0400 +++ grass-6.4.3.fink/macosx/app/grass.sh.in 2013-11-22 18:38:57.000000000 -0500 @@ -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 @@ -100,47 +100,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 @@ -188,62 +154,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" @@ -256,8 +175,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 -uNr grass-6.4.3/macosx/app/grass.sh.in.orig grass-6.4.3.fink/macosx/app/grass.sh.in.orig --- grass-6.4.3/macosx/app/grass.sh.in.orig 1969-12-31 19:00:00.000000000 -0500 +++ grass-6.4.3.fink/macosx/app/grass.sh.in.orig 2013-06-01 05:52:06.000000000 -0400 @@ -0,0 +1,267 @@ +#! /bin/sh +############################################################################# +# +# MODULE: GRASS Initialization +# AUTHOR(S): Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th +# William Kyngesburye - kyngchaos@kyngchaos.com +# PURPOSE: The source file for this shell script is in +# macosx/app/grass.sh.in and is the grass startup script for +# the Mac OS X application build. +# COPYRIGHT: (C) 2000-2008 by the GRASS Development Team +# +# This program is free software under the GNU General Public +# License (>=v2). Read the file COPYING that comes with GRASS +# for details. +# +############################################################################# + +# Mac app only startup shell - complete rewrite for starting from a GRASS.app +# in Mac OS X. Sets defaults for unset env, adds some Mac-only config. + +trap "echo 'User break!' ; exit" 2 3 9 15 + +# dummy for now - just saying we're starting GRASS.app on OSX +GRASS_OS_STARTUP="Mac.app" +export GRASS_OS_STARTUP + +SYSARCH=`uname -p` +SYSVER=`uname -r | cut -d . -f 1` + +GISBASE=`dirname "$0"` +export GISBASE +grass_ver=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"` + +GISBASE_USER="$HOME/Library/GRASS/$grass_ver" +GISBASE_SYSTEM="/Library/GRASS/$grass_ver" + +# for extra utils +# ideally user should have these in their PATH, but make sure here +PATH="@GDAL_BIN_PATH@@PROJ_BIN_PATH@$PATH" +export PATH + +# add some OS X style app support paths, and create user one if missing. +mkdir -p "$GISBASE_USER/Modules/bin" +mkdir -p "$GISBASE_USER/Modules/scripts" +addpath="$GISBASE_USER/Modules/bin:$GISBASE_USER/Modules/scripts:$GISBASE_SYSTEM/Modules/bin:$GISBASE_SYSTEM/Modules/scripts" +if [ "$GRASS_ADDON_PATH" ] ; then + GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$addpath" +else + GRASS_ADDON_PATH="$addpath" +fi +export GRASS_ADDON_PATH + +mkdir -p "$GISBASE_USER/Modules/etc" +addpath="$GISBASE_USER/Modules/etc:$GISBASE_SYSTEM/Modules/etc" +if [ "$GRASS_ADDON_ETC" ] ; then + GRASS_ADDON_ETC="$GRASS_ADDON_ETC:$addpath" +else + GRASS_ADDON_ETC="$addpath" +fi +export GRASS_ADDON_ETC + +mkdir -p "$GISBASE_USER/Modules/lib" +addpath="$GISBASE_USER/Modules/lib:$GISBASE_SYSTEM/Modules/lib" +if [ "$DYLD_LIBRARY_PATH" ] ; then + DYLD_LIBRARY_PATH="$addpath:$DYLD_LIBRARY_PATH" +else + DYLD_LIBRARY_PATH="$addpath" +fi +export DYLD_LIBRARY_PATH + +mkdir -p "$GISBASE_USER/Modules/docs/html" + +# rebuild addon html index and gui menus +"$GISBASE/etc/build_html_user_index.sh" "$GISBASE" +"$GISBASE/etc/build_gui_user_menu.sh" + +# user fontcap files +if [ ! "$GRASS_FONT_CAP" ] ; then + GRASS_FONT_CAP="$GISBASE_USER/Modules/etc/fontcap" +fi +export GRASS_FONT_CAP + +# default xterm Terminal emulator +# note: only app startup defaults this way, CLI build still defaults to xterm +if [ ! "$GRASS_XTERM" ] ; then + GRASS_XTERM="$GISBASE/etc/grass-xterm-mac" + export GRASS_XTERM +fi + +# determine current term application (when grass.sh is run directly by the user) +# use osascript so we can get name of term app, not shell process +USERTERM=`osascript -e 'tell application "System Events" to item 1 of (get name of processes whose frontmost is true)'` +if [ ! "$USERTERM" ] ; then + USERTERM="Terminal" +fi + +# Some reasonable Wish defaults, to avoid accidental use of the +# system TclTk. Avoid non-working combination Aqua 8.4. +# System tcltk has "wish" & "tclsh" symlinks, Aqua and user builds do not. +# 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 + +### X11 stuff + +x11="" +if [ "@X11@" ] ; then + +# start X11 if not running +# some users may be annoyed by this, but X11 required for some stuff for now +if [ -d "/Applications/Utilities/X11.app" ] ; then + # no need to start Leopard X11.app + if [ ! -d "/usr/X11" ] ; then + # check if running anyways, even though not necessary with "open" + if [ ! "`ps -axc | grep 'X11$'`" ] ; then + open /Applications/Utilities/X11.app + fi + x11="tig" + else + x11="leo" + fi +fi + +# make sure X11 is in PATH +pathX11=`echo "$PATH" | grep '/usr/X11\(R6\)\?/bin'` +if [ ! "$pathX11" ] ; then + if [ -d "/usr/X11" ] ; then + PATH="$PATH:/usr/X11/bin" + export PATH + elif [ -d "/usr/X11R6" ] ; then + PATH="$PATH:/usr/X11R6/bin" + export PATH + fi +fi + +# make sure there is a DISPLAY set +if [ ! "$DISPLAY" ] ; then + DISPLAY=:0.0 + export DISPLAY +fi + +fi # X11 + +### end X11 block + +# for bundling wxpython +# change GRASS_WXBUNDLED and pyver_want here from bundle.make, or manually +GRASS_WXBUNDLED= +export GRASS_WXBUNDLED +pyexe="pythonw" +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 +export GRASS_PYTHONWX +# we will execute python scripts from the python wrapper script +GRASS_PYTHON="python" +export GRASS_PYTHON + +# if grassrc has text startup, switch back to Terminal (gotta duplicate some init.sh stuff) +# only applies to Tiger - Leopard X11 opens automatically as needed +GRASSRC="$HOME/.grassrc6" +if [ ! "$GRASS_GUI" ] ; then + if [ -f "$GRASSRC" ] ; then + GRASS_GUI=`awk '/GRASS_GUI/ {print $2}' "$GRASSRC"` + fi + if [ -z "$GRASS_GUI" ] ; then + unset GRASS_GUI + fi +fi +if [ "$GRASS_GUI" = "text" ] && [ "$x11" = "tig" ] ; then + osascript -e "tell application \"$USERTERM\" to activate" +fi + +exec "$GISBASE/etc/Init.sh" "$@" diff -uNr grass-6.4.3/macosx/app/python_wrapper grass-6.4.3.fink/macosx/app/python_wrapper --- grass-6.4.3/macosx/app/python_wrapper 2010-02-20 05:53:27.000000000 -0500 +++ grass-6.4.3.fink/macosx/app/python_wrapper 2013-11-22 18:38:57.000000000 -0500 @@ -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 -uNr grass-6.4.3/macosx/modbuild/Makefile grass-6.4.3.fink/macosx/modbuild/Makefile --- grass-6.4.3/macosx/modbuild/Makefile 2009-04-25 05:52:32.000000000 -0400 +++ grass-6.4.3.fink/macosx/modbuild/Makefile 2013-11-22 18:38:57.000000000 -0500 @@ -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/ @@ -38,13 +38,13 @@ $(MODULE_TOPDIR)/include/Make/Grass.make.in > $(ARCH_DISTDIR)/modbuild/include/Make/Grass.make @# until I figure out how to get sed to replace with multiple lines in a @# makefile, GRASS_APP required for modbuild, ie no default to /Applications - @#-e 's#^GISBASE.*#ifdef GRASS_APP\ - @#GISBASE = $$(GRASS_APP)/Contents/MacOS\ - @#else\ - @#GISBASE = $(INST_DIR_MACOSX)\ - @#endif#g' +# -e 's#^GISBASE.*#ifdef GRASS_APP\ +# GISBASE = $$(GRASS_APP)/Contents/MacOS\ +# else\ +# 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 --- grass-6.4.3/raster/r.terraflow/nodata.cc.orig 2013-11-22 19:32:02.000000000 -0500 +++ grass-6.4.3/raster/r.terraflow/nodata.cc 2013-11-22 19:32:21.000000000 -0500 @@ -73,7 +73,7 @@ int -is_void(elevation_type el) { +grass_is_void(elevation_type el) { return (el == nodataType::ELEVATION_NODATA); } --- grass-6.4.3/raster/r.terraflow/nodata.h.orig 2013-11-22 19:31:57.000000000 -0500 +++ grass-6.4.3/raster/r.terraflow/nodata.h 2013-11-22 19:32:13.000000000 -0500 @@ -37,7 +37,7 @@ int is_nodata(elevation_type el); int is_nodata(int x); int is_nodata(float x); -int is_void(elevation_type el); +int grass_is_void(elevation_type el); class nodataType : public ijBaseType { --- grass-6.4.3/raster/r.terraflow/direction.cc.orig 2013-11-22 19:09:10.000000000 -0500 +++ grass-6.4.3/raster/r.terraflow/direction.cc 2013-11-22 19:31:07.000000000 -0500 @@ -53,11 +53,11 @@ if(!is_nodata(elevwin.get())) { dir = 0; - if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1; - if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16; + if (elevwin.get(5) < elevwin.get() && !grass_is_void(elevwin.get(5))) dir |= 1; + if (elevwin.get(3) < elevwin.get() && !grass_is_void(elevwin.get(3))) dir |= 16; for(int i=0; i<3; i++) { - if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<>i; + if(elevwin.get(i) < elevwin.get() && !grass_is_void(elevwin.get(i))) dir |= 32<>i; } } --- grass-6.4.3/imagery/i.landsat.toar/landsat_met.c.orig 2013-11-22 19:41:33.000000000 -0500 +++ grass-6.4.3/imagery/i.landsat.toar/landsat_met.c 2013-11-22 19:41:49.000000000 -0500 @@ -17,7 +17,7 @@ #define TM5_MET_SIZE 28700 /* .met file size 28686 bytes */ -inline void chrncpy(char *dest, char src[], int n) +static inline void chrncpy(char *dest, char src[], int n) { int i;