[Marble-devel] Improve OSX build process: build a marble framework

Kathrin Geilmann geilmann at cs.uni-kl.de
Tue Jun 19 12:49:05 UTC 2012


Hello,

I managed to get the marble library build as an OSX Framework. I attached a patch against the current master branch. 
 
What does it do?
0) Nothing if not build as QTONLY on OSX.
1) Build libmarblewidget as osx framework. The framework gets installed with make install at FRAMEWORK_INSTALL_DIR (/Library/Frameworks by default)
2) Include plugins, data and header files in the framework. The search path for the directories changed to framework-bundle, then app-bundle, then the standard locations (this removes the ugly path magick from MarbleDirs)
3) Build marble.app bundle linked against the framework. The resulting app can be freely moved on disk (the old app bundle could be run in /Applications/ only.)
4) Fix an annoying cmake warning about the bundle destination.
5) Fixes Bug 299029

What could be better?
1) the framework could be include the app bundle, such that marble.app runs on all machines with qt installed (or even include qt, then it could run everywhere). I suggest to modify the scripts which build the disk image to do it (there are some scripts, doing similar things, but they look unused, so I didn't touch them.)
2) In order to make the designer plugins work, you have to install the framework in one of the standard framework locations, but this is not checked.
3) I would like to see the framework using the RESOURCE property, this would allow to get the complete framework during make. Currently data and plugins get copied into the framework during make install.

I tested the patch on 
a) OSX 10.6.8, cmake 2.8.7, Qt 4.7.4, 64bit machine, QTONLY build
b) Ubuntu 04.12, cmake 2.8.7, Qt 4.8.1, KDE 4.8.3, (All installed from ubuntu packages), QTOnly and KDE builds. -> No changes found as expected.

Feel free to use, change or ignore the patch,
Kathrin 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: kg_framework.patch.diff
Type: application/octet-stream
Size: 9037 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20120619/f5c2d3e8/attachment.obj>
-------------- next part --------------



Am 15.06.2012 um 12:41 schrieb Kathrin Geilmann:

> Hello,
> 
> first of all: congratulations to everybody who works and worked on 
> marble. It's a very nice piece of software.
> 
> I wanted to use the marblewidget in a project of my own and 
> encountered a few problems during build. I'm working on OSX (10.6.8) 
> and building QTONLY (Qt 4.7) Versions of Marble. So everything may 
> be valid on other configurations also, but I didn't check.
> 
> The problem triggering all my activity was, the one described 
> in Bug 299029:
> Building the app.bundle works fine, but all plugins are build in
> the wrong format (.so instead of .dylib), so they cannot be loaded.  
> 
> When I tried to fix this bug, I came accross a number of other problems all
> related to the build process, or more precise to the targets created by the 
> build. As far as I figured out, all of them could be solved quite 
> easily if the marble library is not just build as a shared library but 
> bundled as a framework. 
> 
> So I have two proposals to make and I need your opinion about it. 
> 			
> Proposal:	Build universal 32/64bit binaries by default
> Reason:		- Qt is build that way and this would prevent 
> 			problems when loading plugins on 64bit machines 
> 			- This is mainly a prerequisit for the second
> 			proposal, otherwise the plugins may fail there.
> Status:		- I have done it (patch attached).
> 			It compiles fine and I did not encounter any problems
> 			with it during tests.   
> 
> 
> Proposal: 	Build the library Marble as a Framework-Bundle.
> 			The Framework should contain the library, the plugins, headers and the data files.
> Reason:		- Frameworks are the usual way to distribute shared 
> 			libraries on OSX. Providing a framework would allow 
> 			developers to include the library  very easily in 
> 			their own programs. 
> 			- A Framework can be installed at the usual 
> 			paths (/Library/Frameworks), (~/Library/Frameworks) 
> 			and is available for all programs then, especially 
> 			the qt designer plugins could be linked to them with ease
> 			- The users know about frameworks (at least advanced users)
> 			and they can easily update and/or remove them.
> 			- Frameworks can be included into Application Bundles,
> 			and shipped with the App. The procedure to do
> 			this is the same for all frameworks and every Mac Programmer 
> 			should already know it.		 
> Work to do:	- Change Build Files to build the Framework
> 			- Change creation of App-Bundle: link against the Framework
> 			instead against the libraries
> 			- Fix the magick in MarbleDirs, in order to find the plugins
> 			and the data file inside the framework bundle. 
> 			- Change the Scripts that create the binary releases, in order
> 			to include not only the Qt Frameworks but also the Marble Framework
> Status:		- I partly implemented this using dirty hacks (patching 
> 			automatically generated files by hand, calling manually 
> 			calling shell scripts at the right point during 
> 			the build process,...). I managed to get a 
> 			Framework put together and I was able to use it to get the designer
> 			plugins working, as well as linking my own application against it.
> 			- I didn't investigate any other plugins, nor did I try to get the
> 			data and plugin path right
> 
> 
> Kind regards, 
> 
> 	Kathrin Geilmann			
> 			
> 
> <32_64BitUniversal.patch>



More information about the Marble-devel mailing list