Difference between revisions of "Packaging on MacOSX"

From GRASS-Wiki
Jump to: navigation, search
(MoveToTrac)
(wxPython: 6.4/6.5 differences)
 
(One intermediate revision by the same user not shown)
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.
+
This applies to GRASS 6.5 and 7.  For GRASS 6.4, change all <tt>INST_DIR_TARGET</tt> to <tt>MACOSX_BUNDLE_PREFIX</tt> above.
 +
 
 +
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.

Latest revision as of 07:00, 22 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

This applies to GRASS 6.5 and 7. For GRASS 6.4, change all INST_DIR_TARGET to MACOSX_BUNDLE_PREFIX above.

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.