.app folders are not that special, they use some rpath trickery to separate the applications, and of course plist files. It can easily be done in Linux too, just use rpath and $ORIGIN properly.
Ubuntu discussing moving to LTS + rolling release model
Posted Mar 1, 2013 23:21 UTC (Fri) by mathstuf (subscriber, #69389)
[Link]
> some rpath trickery
Ha! OS X has the most complicated rpath logic I've ever seen. The library has to declare that it supports rpath for anything to apply, which seems…backwards. Not to mention that libA.dylib having "libB.dylib" as a dependent library is resolved relative to the executable opening libA.dylib, and not at all relative to libA.dylib :( . I can see why no one wants to rely on anyone else setting the paths via otool properly and instead just ships everything they need.
Ubuntu discussing moving to LTS + rolling release model
Posted Mar 2, 2013 0:02 UTC (Sat) by dashesy (subscriber, #74652)
[Link]
Yes, it is backward. Since 10.5 OSX has @rpath that more resembles Linux rpath however. I am not an expert in OSX but had to do some fiddling when porting some library. This is what I figured out, if libA.dylib depends on @rpath/libB.dylib (shown in otool -L) then you can use install_name_tool to add_rpath of @loader_path/. which should make the path relative to libA.dylib.