From: Daniel Harple Date: 2006-03-10T05:30:05+09:00 Subject: Re: Packaging RubyCocoa apps (was: RubyCocoa and libxml-ruby-0.3.6) On Mar 9, 2006, at 7:43 PM, Une b�vue wrote: > i have to say something about my previous libxml2 install (i've > installed it because i didn't know it's standard on Tiger). > > i had used the combo bersion (1 or 2 monthes ago) : > GnomeLibXmlCombo-2005-11-06 > > giving : > libexslt.framework > libxml.framework > libxslt.framework > xmllint > xsltproc > > the frameworks are installed in /Library/Frameworks > > i've repackaged this afternoon a RubyCocoa app making use of > ruby-libxml. > > that works on my computer however a tester had a crash with this > message > : > > dyld: Library not loaded: @executable_path/../Frameworks/ > libxml.framework/Versions/2.6.22/libxml > > > this that means, the version of libxml2 i had, before reinstalling > everything using dp, was linked to this libxml2-combo version ? > > and now, with the newest libxml2 installed by dp, would one of my > testers have the same kind of prob ? libxml-ruby installed from DP will depend and install: * libxml2 * zlib * libiconv To verify this, use the otool command. $ otool -L /opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/ xml/libxml.bundle /opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/xml/ libxml.bundle: /opt/local/lib/libruby.dylib (compatibility version 1.8.0, current version 1.8.4) /opt/local/lib/libxml2.2.dylib (compatibility version 9.0.0, current version 9.22.0) /opt/local/lib/libiconv.2.dylib (compatibility version 6.0.0, current version 6.0.0) /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.5) /opt/local/lib/libdl.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 92.0.0) You can change these using the install_name_tool. So when you package your app, you would do: $ install_name_tool -change /opt/local/lib/libxml2.2.dylib /usr/lib/ libxml2.2.dylib MyRubyApp.app/Contents/Frameworks/libxml.bundle And now the packaged ruby-libxml depends on the Apple supplied libxml2 (change the other ones, too). If for some reason you wanted to package DP libxml2 (I don't recommend it): $ install_name_tool -change /opt/local/lib/libxml2.2.dylib @executable_path/../Frameworks/libxml2.2.dylib MyRubyApp.app/Contents/ Frameworks/libxml.bundle where you copy the DP libxml2 to your application bundle. I haven't really used ruby cocoa much, you may want to check what RubyApp.app/Contents/MacOS/whatever depends on (using otool -L again) just to be sure you aren't depending on anything in /opt/local, because base Mac OS X install will not have those. -- Daniel