[KDE/Mac] relocatable application bundles

Jonas Bähr jonas.baehr at web.de
Sun Feb 3 23:58:27 CET 2008


Is there (yet) a proper way to create relocatable application bundles  
for KDE applications?
I'm working on Krusader [1] and since I've got only a mac here to  
work with I'm currently doing all my KDE stuff under Mac OS X. Trying  
to make a binary package I stumbled over this problem.
I solved it with a little wrapper script [2] which places the  
"Contents" directory of the bundle in KDEDIRS and copy the the  
relevant data (the entire share and lib folders of my app) there.
This kind of works, but is quite long winded... Is there maybe a  
better way to do this job? Or could the whole procedure be automated  
by cmake (which is also quite new to me)?

[1] www.krusader.org
[2] ----------8<-----------8<------------
# 2008, Jonas Bähr, jonas at fs.ei.tum.de
# Wrapper to make the app find the bundled resources
# share and lib (and maybe others) have to be in the
# Contents-dir of the app-bundle
# => build with a custom-location as prefix, install, and then
#    move the interesting dirs from prefix inside the app-bundle
#    the real binary in MacOS is renamed to *.bin
#    this script has to replace the actual binary
# How it works:
# $0 may be /Applications/Krusader.app/Contents/MacOS/krusader
# ${0%/*/*} removes the last two elements from the path
# => /Applications/Krusader.app/Contents is added to KDEDIRS
#   => the app find its resorces
KDEDIRS="${0%/*/*}:$KDEDIRS" $0.bin


PS: two months ago I wrote about this to k-c-d [3], but perhaps it  
was the wrong mailing list, I hope this one is better suited ;-)
[3] http://lists.kde.org/?l=kde-core-devel&m=119548054826773&w=2

More information about the kde-mac mailing list