[GRASS-SVN] r41094 - in grass/branches/releasebranch_6_4/macosx: . app pkg

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 18 10:11:24 EST 2010


Author: kyngchaos
Date: 2010-02-18 10:11:22 -0500 (Thu, 18 Feb 2010)
New Revision: 41094

Added:
   grass/branches/releasebranch_6_4/macosx/app/python_wrapper
   grass/branches/releasebranch_6_4/macosx/bundle.make
Removed:
   grass/branches/releasebranch_6_4/macosx/pkg/bundle.make
Modified:
   grass/branches/releasebranch_6_4/macosx/Makefile
   grass/branches/releasebranch_6_4/macosx/ReadMe.rtf
   grass/branches/releasebranch_6_4/macosx/app/Makefile
   grass/branches/releasebranch_6_4/macosx/app/grass.sh.in
Log:
sync dev6 changes (r38368, r40103, r40104)

Modified: grass/branches/releasebranch_6_4/macosx/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/macosx/Makefile	2010-02-18 13:34:00 UTC (rev 41093)
+++ grass/branches/releasebranch_6_4/macosx/Makefile	2010-02-18 15:11:22 UTC (rev 41094)
@@ -37,6 +37,8 @@
 
 default: subdirs
 
+include bundle.make
+
 install-macosx:
 	echo ${ARCH_DISTDIR}/${MACOSX_APP_NAME}
 	@ if [ ! -d ${ARCH_DISTDIR}/${MACOSX_APP_NAME} ] ; then \
@@ -46,61 +48,23 @@
 	fi; \
 	${MAKE} real-install-macosx
 
-# Duplicated, mostly, from the top-level makefile.  There are enough
-# differences that make it simpler to have a separate install target.
+# Duplicated, mostly, from the top-level makefile.
 
-real-install-macosx:
-	${MAKE_DIR_CMD} ${INST_DIR}
-	${MAKE} macosx-support-dir
-	-cd ${GISBASE} ; tar cBf - ${MACOSX_APP_NAME} | (cd ${prefix} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - $(FILES) | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - bin | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - bwidget | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - docs | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - driver | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - etc | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - fonts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - scripts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null ; fi
-	-cd ${GISBASE} ; tar cBf - include | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - lib | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-	-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/monitorcap > ${INST_DIR}/etc/monitorcap
-	-chmod -R a+rX ${prefix}/${MACOSX_APP_NAME} 2>/dev/null
-	-touch ${prefix}/${MACOSX_APP_NAME}
-	-cd ${GRASS_HOME} ; tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
-	-${INSTALL} ${GRASS_HOME}/gem/gem6 ${prefix}/${MACOSX_APP_NAME}/Contents/MacOS 2>/dev/null
+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 - in the future files will go in /Library/Documentation/Help
-	${LN_DIR} "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}
+	@# 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.
 
-include pkg/bundle.make
-
-bindist-macosx:
-	${MAKE_DIR_CMD} ${GRASS_HOME}/macosx/dist
-	-cd ${GISBASE} ; tar cBf - ${MACOSX_APP_NAME} | (cd ${GRASS_HOME}/macosx/dist ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - bin | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - bwidget | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - docs | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - driver | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - etc | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - fonts | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - man | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - scripts | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null ; fi
-	-cd ${GISBASE} ; tar cBf - include | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-cd ${GISBASE} ; tar cBf - lib | (cd ${MACOSX_BUNDLE_PREFIX} ; tar xBf - ) 2>/dev/null
-	-sed 's#'${GISBASE}'#'${INST_DIR_MACOSX}'#g' ${GISBASE}/etc/monitorcap > dist/${MACOSX_APPDIR}/etc/monitorcap
-	-chmod -R a+rX dist/${MACOSX_APPDIR} 2>/dev/null
-	-cd ${GRASS_HOME} ; tar cBf - gem/skeleton | (cd ${MACOSX_BUNDLE_PREFIX}/etc ; tar xBf - ) 2>/dev/null
-	-${INSTALL} ${GRASS_HOME}/gem/gem6 dist/${MACOSX_APP_NAME}/Contents/MacOS 2>/dev/null
-	@# extras to bundle
-	${MAKE} bundle-macosx
-	@# pkg resources
+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
@@ -119,6 +83,27 @@
 	@# 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
+	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
+	-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

Modified: grass/branches/releasebranch_6_4/macosx/ReadMe.rtf
===================================================================
(Binary files differ)

Modified: grass/branches/releasebranch_6_4/macosx/app/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/macosx/app/Makefile	2010-02-18 13:34:00 UTC (rev 41093)
+++ grass/branches/releasebranch_6_4/macosx/app/Makefile	2010-02-18 15:11:22 UTC (rev 41094)
@@ -37,9 +37,9 @@
 
 default: macosxapp
 
-macosxapp: PkgInfo app.icns English.lproj/MainMenu.nib build_html_user_index.sh build_gui_user_menu.sh $(ARCH_OBJS) $(APPDIR)/MacOS/GRASS
+macosxapp: PkgInfo app.icns English.lproj/MainMenu.nib build_html_user_index.sh build_gui_user_menu.sh python_wrapper $(ARCH_OBJS) $(APPDIR)/MacOS/GRASS
 	-${MAKE_DIR_CMD} ${APPDIR}/Resources/Scripts
-	-${MAKE_DIR_CMD} ${APPDIR}/MacOS/scripts
+	-${MAKE_DIR_CMD} ${APPDIR}/MacOS/bin
 	-${MAKE_DIR_CMD} ${APPDIR}/MacOS/etc
 	-${INSTALL_DATA} app.icns ${APPDIR}/Resources
 	-tar cBf - English.lproj --exclude CVS | (cd ${APPDIR}/Resources ; tar xBf - ) 2>/dev/null
@@ -49,6 +49,7 @@
 	-${INSTALL_DATA} $(OBJDIR)/GRASS.scpt ${APPDIR}/Resources/Scripts
 	-${INSTALL} build_html_user_index.sh ${APPDIR}/MacOS/etc
 	-${INSTALL} build_gui_user_menu.sh ${APPDIR}/MacOS/etc
+	-${INSTALL} python_wrapper ${APPDIR}/MacOS/bin/python
 
 $(OBJDIR)/main.o: main.m
 	$(MAKE_DIR_CMD) $(OBJDIR)

Modified: grass/branches/releasebranch_6_4/macosx/app/grass.sh.in
===================================================================
--- grass/branches/releasebranch_6_4/macosx/app/grass.sh.in	2010-02-18 13:34:00 UTC (rev 41093)
+++ grass/branches/releasebranch_6_4/macosx/app/grass.sh.in	2010-02-18 15:11:22 UTC (rev 41094)
@@ -185,8 +185,10 @@
 GRASS_WXBUNDLED=
 export GRASS_WXBUNDLED
 pyexe="pythonw"
+GRASS_PYTHONWX="$pyexe"
 pyver_want="@PYVER@"
-wx64bit="@WX64BIT@"
+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)
@@ -233,23 +235,15 @@
 
 if [ "$py" ] ; then
 	echo "$pyver found."
-	GRASS_PYTHON="$py"
-	# can't run python 64bit if wx not 64bit, assume OSX 10.6+ 64bit
-	if [ $(($SYSVER)) -gt 9 ] && [ "$wx64bit" = "0" ] ; then
-		case $SYSARCH$wx64bit in
-			powerpc0) pyarch="ppc" ;;
-			i3860) pyarch="i386" ;;
-			*) pyarch="" ;;
-		esac
-		# make copy of pythonw 32bit because g.gui can't spawn multi-arg prog
-		ditto -arch $pyarch "$py" "$GISBASE_USER/Modules/bin/pythonw"
-		GRASS_PYTHON="pythonw"
-	fi
-	export GRASS_PYTHON
+	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

Added: grass/branches/releasebranch_6_4/macosx/app/python_wrapper
===================================================================
--- grass/branches/releasebranch_6_4/macosx/app/python_wrapper	                        (rev 0)
+++ grass/branches/releasebranch_6_4/macosx/app/python_wrapper	2010-02-18 15:11:22 UTC (rev 41094)
@@ -0,0 +1,45 @@
+#! /bin/sh
+#############################################################################
+#
+# MODULE:   	python wrapper
+# AUTHOR(S):	William Kyngesburye - kyngchaos at kyngchaos.com
+# PURPOSE:  	handle arch options on OSX for running python.
+# 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.
+#
+#############################################################################
+
+# wxpython-based scripts must be started from pythonw.  And depending on the
+# installed wxpython, it may only be available in 32bits, while python may
+# at the same time run 64bit by default.  Newer systems may also reexec python
+# as pythonw automatically as needed, except they don't respond to the arch
+# command (and that's an Apple-only thing, and only when /usr/bin/python is
+# used, yet /usr/bin/pythonw2.6 DOES respond to arch).  The most universal
+# and reliable method is probably to not depend on Apple's customizations and
+# execute pythonw directly, 32bit if necessary.
+
+if [ -z "$GISBASE" ] ; then
+    echo "You must be in GRASS GIS to run this program." >&2
+    exit 1
+fi
+
+SYSARCH=`uname -p`
+SYSVER=`uname -r | cut -d . -f 1`
+
+if [ ! "$GRASS_PYTHONWX" ] ; then
+	GRASS_PYTHONWX="pythonw"
+fi
+# 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
+		powerpc) pyarch="-ppc" ;;
+		i386) pyarch="-i386" ;;
+		*) pyarch="" ;;
+	esac
+	exec /usr/bin/arch $pyarch "$GRASS_PYTHONWX" "$@"
+else
+	exec "$GRASS_PYTHONWX" "$@"
+fi


Property changes on: grass/branches/releasebranch_6_4/macosx/app/python_wrapper
___________________________________________________________________
Added: svn:executable
   + *

Copied: grass/branches/releasebranch_6_4/macosx/bundle.make (from rev 41053, grass/branches/releasebranch_6_4/macosx/pkg/bundle.make)
===================================================================
--- grass/branches/releasebranch_6_4/macosx/bundle.make	                        (rev 0)
+++ grass/branches/releasebranch_6_4/macosx/bundle.make	2010-02-18 15:11:22 UTC (rev 41094)
@@ -0,0 +1,24 @@
+# extra binaries and data to bundle into the GRASS.app package
+# 
+# use ${INSTALL} to copy binaries.
+# use ${INSTALL_DATA} for headers and other non-executables.
+# use ${MAKE_DIR_CMD} to create a subfolder if needed.
+# use ${LN} and ${LN_DIR} to symlink files and folders respectively.
+# 
+# Destinations include: bin and lib and should be prefixed by
+# ${MACOSX_BUNDLE_PREFIX}/
+# Includes should not normally be needed.
+# 
+# For libraries, make sure to make symlinks if the symlink is the linked name.
+# ie, libfoo.1.0.dylib is the library file, but libfoo.1.dylib is the link name:
+#   ${LN} libfoo.1.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib/libfoo.1.dylib
+# If you're not sure, make all symlinks for a library.
+# 
+# use one line per file after the "bundle-macosx:" line, indented with a tab.
+# ie:
+#	${INSTALL} /usr/local/bin/gpsbabel ${MACOSX_BUNDLE_PREFIX}/bin
+#	${INSTALL} /usr/local/pgsql/lib/libpq.5.1.dylib ${MACOSX_BUNDLE_PREFIX}/lib
+#	${LN} libpq.5.1.dylib ${MACOSX_BUNDLE_PREFIX}/lib/libpq.5.dylib
+
+bundle-macosx:
+	@# add custom bundle commands here:

Deleted: grass/branches/releasebranch_6_4/macosx/pkg/bundle.make
===================================================================
--- grass/branches/releasebranch_6_4/macosx/pkg/bundle.make	2010-02-18 13:34:00 UTC (rev 41093)
+++ grass/branches/releasebranch_6_4/macosx/pkg/bundle.make	2010-02-18 15:11:22 UTC (rev 41094)
@@ -1,24 +0,0 @@
-# extra binaries and data to bundle into the GRASS.app package
-# 
-# use ${INSTALL} to copy binaries.
-# use ${INSTALL_DATA} for headers and other non-executables.
-# use ${MAKE_DIR_CMD} to create a subfolder if needed.
-# use ${LN} and ${LN_DIR} to symlink files and folders respectively.
-# 
-# Destinations include: bin and lib and should be prefixed by
-# ${MACOSX_BUNDLE_PREFIX}/
-# Includes should not normally be needed.
-# 
-# For libraries, make sure to make symlinks if the symlink is the linked name.
-# ie, libfoo.1.0.dylib is the library file, but libfoo.1.dylib is the link name:
-#   ${LN} libfoo.1.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib/libfoo.1.dylib
-# If you're not sure, make all symlinks for a library.
-# 
-# use one line per file after the "bundle-macosx:" line, indented with a tab.
-# ie:
-#	${INSTALL} /usr/local/bin/gpsbabel ${MACOSX_BUNDLE_PREFIX}/bin
-#	${INSTALL} /usr/local/pgsql/lib/libpq.5.1.dylib ${MACOSX_BUNDLE_PREFIX}/lib
-#	${LN} libpq.5.1.dylib ${MACOSX_BUNDLE_PREFIX}/lib/libpq.5.dylib
-
-bundle-macosx:
-	@# add custom bundle commands here:



More information about the grass-commit mailing list