Answer is simple, but doing it may not be so... There is PlatformJarTask that writes deployment spec xml file that is inside native jar, and copies the files and this spec to a dir and then creates a jar from that dir.
There is separate sections for each platform that could be use for specifying platform dependent things like this. I’ve used those for MinGW support. Feel free to write whole system from scratch if you want :) On Wednesday 23 February 2011 12:19:19 Michael Douglass wrote: > Okay, I've done some work on finding the right way to fix this... I see what > I need to do, but I just don't know how to fix it the right way, and I think > some of you may know what I should do when I give the information that I've gathered. One thing to note is that the "workaround" provided for in QTBUG-5952 doesn't work fully as it mucks up the default "mac" system menu for your application -- oh, and the menu items that do appear just don't work. > > The problem *is* with the qt_menu.nib data not being copied over. Sure, it's > a Qt bug, but I'm a QtJambi user and I'd like to make it work for QtJambi and > that's all that I care about. > > When I run my QtJambi application, it extracts a bunch of files into > $TMPDIR/QtJambi_username_i386.4.7.1_gcc-20110223-1153/ -- mainly all of the > dylib files the system will need. The fix for this bug is to place the qt_menu.nib directory (from the Qt source code) into the "lib/Resources" subdirectory. QtJambi is perfectly happy once those files exist. (It works when I manually copy the files into place and then run my application.) > > The question is: How do I get QtJambi to include those files in the JAR and > then extract them along side the dylib files? > > Thanks, > Michael > > From: qt-jambi-interest-boun...@trolltech.com > [mailto:qt-jambi-interest-boun...@trolltech.com] On Behalf Of Benoit DECHERF > Sent: Tuesday, September 21, 2010 6:18 AM > To: s...@smar.fi > Cc: qt-jambi-inter...@trolltech.com > Subject: Re: [Qt-jambi-interest] qtjambi compilation for macosx > > Hi, > > So, after some try, It compiles !! > But it doesn't work at runtime: the qt_menu.nib is missing ! > It seems that it is this bug: http://bugreports.qt.nokia.com/browse/QTBUG-5952 > What is the workaround ? I can't understand how it can work without this > file, or how can I provide it ? > > Thanks, > Benoit > > > > 2010/9/16 Samu Voutilainen <s...@smar.fi<mailto:s...@smar.fi>> > On Sunday 12 September 2010 10:10:08 Benoit DECHERF wrote: > > Hi, > > > > I can't compile qtjambi on macosx 10.6. > > The error is: > > library.native.bundle: > > Processing Mac OS X install_name... > > - updating: libQtCore.4.dylib > > install_name_tool: can't open file: /libQtCore.4.dylib (No such file or > > directory) > > Running: 'install_name_tool, -change, libQtCore.4.dylib, > > @loader_path/..//libQtCore.4.dylib, /libQtCore.4.dylib' failed. > > at com.trolltech.tools.ant.Exec.exec(Exec.java:92) > > at > > com.trolltech.tools.ant.PlatformJarTask.processOSXInstallName(PlatformJarTask.java:538) > > > > subdir seems to be never initialized in this LibraryEntry ? Using > > absoluteSourcePath of relativePath make it compile. > > > > But it still fail at runtime (it also fail with 4.6.3, with another error): > > > > With 4.7: > > ------- > > Exception in thread "main" java.lang.ExceptionInInitializerError > > at com.trolltech.qt.QtJambiObject.<clinit>(QtJambiObject.java:60) > > Caused by: java.lang.RuntimeException: Loading library failed, progress so > > far: > > Unpacking .jar file: 'qtjambi-platform-mac32-4.7.0.jar' > > ... > > Caused by: java.lang.RuntimeException: Failed to unpack native libraries, > > progress so far: > > Unpacking .jar file: 'qtjambi-platform-mac32-4.7.0.jar' > > ... > > Caused by: java.io.FileNotFoundException: Library 'lib/./libQtCore.4.dylib' > > specified in qtjambi-deployment.xml in 'qtjambi-platform-mac32-4.7.0.jar' > > does not exist > > at > > com.trolltech.qt.internal.NativeLibraryManager.unpackDeploymentSpec(NativeLibraryManager.java:563) > > ------- > > > > And on 4.6.3: > > ------- > > Caused by: java.lang.UnsatisfiedLinkError: > > /private/var/folders/Uf/UfZqSqB8E8SIKY7m7qyrsk+++TI/-Tmp-/QtJambi_benoitdecherf_x86_64_4.6.3_gcc-20100817-1815/lib/libQtGui.4.dylib: > > Library not loaded: /opt/local/lib/libpng12.0.dylib Referenced from: > > /private/var/folders/Uf/UfZqSqB8E8SIKY7m7qyrsk+++TI/-Tmp-/QtJambi_benoitdecherf_x86_64_4.6.3_gcc-20100817-1815/lib/libQtGui.4.dylib > > Reason: image not found > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > ------- > > > > > > Benoit > > > Hi, > > Sorry that answer is this late, but myself I don't know anything about Mac... > > "I cannot try it right now, but if he's compiling 4.7 with the code we > modified to make the generator be able to use bundles in the system, we > haven't finished yet. Anyway, he can try to edit qtjambi-deployment.xml > file inside qtjambi-platform-mac32-4.7.0.jar and try to correct the > paths in there to the files inside the jar. > > Second error is that he's using my libraries that tries to access libpng > on /opt/local (because I used MacPorts to compile them) Maybe we should > warn / remove those libs..." > > So I think I'll need a bit more information about your problem in order to > get it solve solved. You can just talk to me at our IRC channel too. > -- > Terveisin, > Samu Voutilainen > http://smar.fi > > _______________________________________________ > Qt-jambi-interest mailing list > qt-jambi-inter...@trolltech.com<mailto:qt-jambi-inter...@trolltech.com> > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest > -- Terveisin, Samu Voutilainen http://smar.fi _______________________________________________ Qt-jambi-interest mailing list Qt-jambi-interest@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-jambi-interest