Using macports dylibs without macports

Travis Griggs travisgriggs at gmail.com
Thu Sep 17 15:15:32 PDT 2009


On Sep 17, 2009, at 12:15 PM, Raphael Straub wrote:

> Travis Griggs wrote:
>> I have an application (.app). It makes use of CairoGrahics library  
>> (libcairo.dylib) provided by Macports. I have some users though,  
>> who are not going to install macports on their systems just so they  
>> can use my app. Can I just copy the appropriate dylibs to location  
>> of the executable down in the bowels of the .app and have it work  
>> correctly?
>
> No, you have to adjust the paths to the libraries in your binary and  
> in all dependent libraries, see "man install_name_tool".
>
>> Is there a way to achieve what I want?
>
> There is a script in the python macholib package to achieve what you  
> want. Just install the py25-macholib port and use "macho_standalone  
> your.app". This will copy all dependent libraries into your.app/ 
> Contents/Frameworks (Create this directory before calling  
> macho_standalone.) and adjust the install names with  
> install_name_tool. As Ryan already said, this is only guaranteed to  
> work if all users have the same major Mac OS X version as you.

Static linking isn't an option for us. And your point about it being  
major version specific is not really doable for us. So I'll do some  
more digging in how to get Cairo built for myself to run on multiple  
version and be able to be placed in the our .app (which I don't myself  
build).

Just for PoC type of thing, I did try the tool referenced, and it blew  
up:

ImportError: No module named modulegraph.util

I'm not sure it would even work for this anyway. The .app of interest  
is a Virtual Machine engine for VisualWorks Smalltalk. So the .app  
doesn't itself need the Cairo libraries. But one can write a Smalltalk  
app that wants to load and use Cairo dlls.

Thanks to all for the replies. Appreciate you all helping this naive  
noob a little.

--
Travis Griggs
Objologist
My Other Machine runs OSX. But then... so does this one.





More information about the macports-users mailing list