As GAE and MegaGlest both use CMake and CPack to compile on Mac we can easily work together to get a working bundle packaged. First of all, i have no knowledge about Mac and bundles. Never used a Mac. So all i know is from this page:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29Bruce mentioned in this
thread that all needed libraries should be packaged in the bundle, probably data too. I would just install the libraries in a subfolder lib and set DYLD_LIBRARY_PATH to this folder so the linker finds it, like in the wiki example.
in CMakeLists.txt:
if(APPLE)
install(FILES ${LUA_LIBRARIES} ... DESTINATION lib)
endif()
In MegaGlest it is currently installed in ../Frameworks. I don't know if this is still in the bundle and a better location than lib.
CPACK_BUNDLE_STARTUP_COMMAND would then point to a shell script:
#!/bin/sh
GLEST_BUNDLE="`echo "$0" | sed -e 's|/Contents/MacOS/.*||'`"
GLEST_RESOURCES="$GLEST_BUNDLE/Contents/Resources"
export "DYLD_LIBRARY_PATH=$GLEST_RESOURCES/lib"
export "PATH=$GLEST_RESOURCES/bin:$PATH"
exec "$GLEST_RESOURCES/bin/glestadv" -datadir "$GLEST_RESOURCES/share/glestae"
The exec command is probably quite different in MegaGlest. In GAE we install all binaries in bin and all data in share/glestae.
I don't know if we need to start X11 like in the wiki example. One other problem: How do we package the map editor and g3dviewer? Especially, how do we start these programs? There's only one startup command and no "menu shortcuts" or similar things. Can someone with Mac knowledge please enlighten me?
Maybe using PackageMaker is an easier option than bundles...