On gio, 2009-07-02 at 21:56 +0200, Hans-Peter Jansen wrote:
> Am Donnerstag, 2. Juli 2009 schrieb Giovanni Bajo:
> > On 7/2/2009 11:23 AM, Hans-Peter Jansen wrote:
> > > Shouldn't this work out of the box? I would very much like to keep the
> > > original Qt build, I'm using here. Needless to say, running it with
> > > Qt installed, works fine.
> >
> > Yes, it should work out of the box, and I have sucessfully managed to
> > ship PyQt applications on Mac.
> >
> > It might be related to the fact that PyInstaller seems not to set
> > DYLD_LIBRARY_PATH correctly in one-dir mode.
>
> Hmm, given that the libs are missing, how could setting a environment
> variable fix that problem?
Sorry, I had misread your original mail.
> > Does it work in one-file mode? If so, it's should be easy to fix.
>
> No, it doesn't, but since the analyse part is the same, it cannot.
>
> Did you really shipped apps, based on a current Qt framework build, and it
> worked out of the box (without Qt installed on the target systems)?!?
Yes. I'm not 100% sure my deployment Mac has the standard Qt framework
though; I'll have to check.
I still can't see what it is going on. mf.py (which is the dependency
analyzer) should be able to find the Qt libraries from the PyQt4 ones.
What happens if you run "bindepend.py PyQt4.QtCore4.so"? Does it list Qt
dependencies? Under what path?
> Here's what I did (hopefully complete):
>
> cd .app/Contents
> md Framework
> cp -R /Library/Frameworks/Qt{Core,Gui}.framework Framework
> find Framework -depth -name Headers -exec rm -r {} \;
> find Framework -depth -name \*_debug\* -exec rm -r {} \;
>
> # treat QtCore
> install_name_tool -id \
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore \
> QtCore.framework/Versions/4.0/QtCore
>
> install_name_tool -change QtCore.framework/Versions/4/QtCore \
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore \
> QtCore.framework/Versions/4.0/QtCore
>
> # treat QtGui
> install_name_tool -id \
> @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui \
> QtGui.framework/Versions/4.0/QtGui
>
> install_name_tool -change QtCore.framework/Versions/4/QtCore \
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore \
> QtGui.framework/Versions/4.0/QtGui
>
> # treat PyQt4.QtCore
> install_name_tool -change QtCore.framework/Versions/4/QtCore \
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
> ../MacOS/PyQt4.QtCore.so
>
> # treat PyQt4.QtGui
> install_name_tool -change QtCore.framework/Versions/4/QtCore \
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
> ../MacOS/PyQt4.QtGui.so
>
> install_name_tool -change QtGui.framework/Versions/4/QtGui \
> @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
> ../MacOS/PyQt4.QtGui.so
>
> # check, if something is still missing
> otool -L ../MacOS/PyQt4.Qt*.so QtCore.framework/QtCore QtGui.framework/QtGui
>
>
> You see, the whole mess is asking for automatic treatment. What I'm thinking
> about, is getting rid of the Framework junk, and simply throw the lib files
> QtCore, QtGui, etc into "the" dir (renaming them to Qt*.so), and do the
> adjustments as outlined above, but I haven't tried this yet.
Yes it would be better to just put everything inside the output
directory, like we do on other platforms (unless dyld makes this really
impossible -- which I hope it does not).
The install_name_tool trick shouldn't be necessary: I used to do it
automatically in PyInstaller, but it turned out to have compatibility
problems across different Mac OSX versions (I don't recall details) and
setting DYLD_LIBRARY_PATH instead was just as effective.
You don't need to rename Qt libraries to ".so". If I recall correctly,
they can stay as-is. Just try copying them within the output directory
and see what happens (and set DYLD_LIBRARY_PATH to point to that
directory as well).
> I think, this deserves a mac related option (one may don't want to ship
> Qt), but by default the libs should be included. Using qt4_plugins may
> deserve another option, since they need the same treatment as above, and
> on that way pull nearly the full distribution into the bundle.
This is a totally different topic, as PyInstaller treats qt4_plugins
mostly as data files. We'll have to find out why hook-PyQt4.Qt*.py don't
find the Qt4 plugins directory.
> Thus I may
> decide to do without them, and spare a lot of space. BTW, do you know,
> what codecs are shipped in libqtwcodecs.dylib? They can't be essential,
> since my simple app works without them at least (due to missing "the"
> treatment ATM).
I don't know.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---