Packaging on MacOSX: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(MoveToTrac)
(→‎wxPython: correct install variable, clarify steps)
Line 16: Line 16:
  /usr/local/lib/wxPython-unicode-2.8.10.1/lib
  /usr/local/lib/wxPython-unicode-2.8.10.1/lib


There a couple different parts to copy, plus the GRASS startup script needs one change.  In bundle.make, first, add this before the <tt>bundle-macosx:</tt> line (change the wx version to match what you have installed):
There are a couple different parts to copy. Plus, the GRASS startup script needs one change (this is done by the additions to bundle.make).  In bundle.make, first, add this before the <tt>bundle-macosx:</tt> line (change the wx version to match what you have installed):


  WXPREFIX=/usr/local/lib/wxPython-unicode-2.8.10.1
  WXPREFIX=/usr/local/lib/wxPython-unicode-2.8.10.1
Line 23: Line 23:


<pre>
<pre>
${INSTALL} ${WXPREFIX}/lib/libwx_macud-2.8.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud-2.8.0.dylib ${INST_DIR_TARGET}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gl-2.8.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gl-2.8.0.dylib ${INST_DIR_TARGET}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_stc-2.8.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_stc-2.8.0.dylib ${INST_DIR_TARGET}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos-2.8.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos-2.8.0.dylib ${INST_DIR_TARGET}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos_xrc-2.8.0.dylib ${MACOSX_BUNDLE_PREFIX}/lib
${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos_xrc-2.8.0.dylib ${INST_DIR_TARGET}/lib
cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx ${MACOSX_BUNDLE_PREFIX}/etc/wxpython
cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx ${INST_DIR_TARGET}/etc/python
cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wxPython ${MACOSX_BUNDLE_PREFIX}/etc/wxpython
cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wxPython ${INST_DIR_TARGET}/etc/python
${INSTALL_DATA} ${WXPREFIX}/lib/python2.5/site-packages/wxversion.py ${MACOSX_BUNDLE_PREFIX}/etc/wxpython
cp -fp ${WXPREFIX}/lib/python2.5/site-packages/wxversion.py ${INST_DIR_TARGET}/etc/python
sed -i '' -e 's/^GRASS_WXBUNDLED=.*/GRASS_WXBUNDLED=1/' ${MACOSX_BUNDLE_PREFIX}/grass.sh
sed -i '' -e 's/^GRASS_WXBUNDLED=.*/GRASS_WXBUNDLED=1/' ${INST_DIR_TARGET}/grass.sh
</pre>
</pre>


wxPython's version checking doesn't work in a bundled environment, so the <tt>GRASS_WXBUNDLED</tt> flag is set in the startup script to tell the GUI startup to skip the wx version check.
Note: wxPython's version checking doesn't work in a bundled environment, so the <tt>GRASS_WXBUNDLED</tt> flag is set in the startup script (that's what the sed line above does) to tell the GUI startup to skip the wx version check.

Revision as of 03:50, 21 September 2009

Notes on packaging GRASS for distribution on Mac OS X. This applies to the Mac OS X application build (--enable-macosx-app) only.

The OSX app build includes its own bindist make target, which creates an OSX installer package (instead of the tarball + script that the unix build bindist creates).

bundling

There is also a bundle.make makefile fragment that is included in the main OSX makefile that is customizable to bundle dependencies and helpers into the application package, to make the app more portable to other OSX systems (so the user doesn't have to install them themselves). See bundle.make comments for details on install commands and destination paths.

A couple examples are included in bundle.make. Here are more.

wxPython

wxPython is a good one to bundle, because a python module may directly link a wx library, and the binary distribution of wxPython uses a different path for each version, and the installer will destroy previous versions. ie:

/usr/local/lib/wxPython-unicode-2.8.10.1/lib

There are a couple different parts to copy. Plus, the GRASS startup script needs one change (this is done by the additions to bundle.make). In bundle.make, first, add this before the bundle-macosx: line (change the wx version to match what you have installed):

WXPREFIX=/usr/local/lib/wxPython-unicode-2.8.10.1

Then in the bundle-macosx: section (make sure to indent all lines with <tabs>), you may need to change the library versions to match what you have installed:

	${INSTALL} ${WXPREFIX}/lib/libwx_macud-2.8.0.dylib ${INST_DIR_TARGET}/lib
	${INSTALL} ${WXPREFIX}/lib/libwx_macud_gl-2.8.0.dylib ${INST_DIR_TARGET}/lib
	${INSTALL} ${WXPREFIX}/lib/libwx_macud_stc-2.8.0.dylib ${INST_DIR_TARGET}/lib
	${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos-2.8.0.dylib ${INST_DIR_TARGET}/lib
	${INSTALL} ${WXPREFIX}/lib/libwx_macud_gizmos_xrc-2.8.0.dylib ${INST_DIR_TARGET}/lib
	cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx ${INST_DIR_TARGET}/etc/python
	cp -Rfp ${WXPREFIX}/lib/python2.5/site-packages/wx-2.8-mac-unicode/wxPython ${INST_DIR_TARGET}/etc/python
	cp -fp ${WXPREFIX}/lib/python2.5/site-packages/wxversion.py ${INST_DIR_TARGET}/etc/python
	sed -i '' -e 's/^GRASS_WXBUNDLED=.*/GRASS_WXBUNDLED=1/' ${INST_DIR_TARGET}/grass.sh

Note: wxPython's version checking doesn't work in a bundled environment, so the GRASS_WXBUNDLED flag is set in the startup script (that's what the sed line above does) to tell the GUI startup to skip the wx version check.