On Fri, 2009-07-03 at 22:59 +0200, Hans-Peter Jansen wrote:
> Am Freitag, 3. Juli 2009 schrieb Giovanni Bajo:
> > On 7/3/2009 3:42 PM, Hans-Peter Jansen wrote:
> Given that info, and leaving DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH 
> and DYLD_ROOT_PATH alone, it boils down to this patch:
> 
> Index: bindepend.py
> ===================================================================
> --- bindepend.py      (Revision 59)
> +++ bindepend.py      (Arbeitskopie)
> @@ -354,6 +354,12 @@
>      """Find the binary dependencies of PTH.
>  
>          This implementation is for otool platforms"""
> +    # dyld searches these paths for framework libs
> +    # we ignore DYLD_FALLBACK_LIBRARY_PATH for now (man dyld)
> +    fwpaths = ['/Library/Frameworks', '/Network/Library/Frameworks', 
> '/System/Library/Frameworks']
> +    for p in reversed(os.environ.get('DYLD_FRAMEWORK_PATH', '').split(':')):
> +        if p:
> +            fwpaths.insert(0, p)
>      rslt = []
>      for line in os.popen('otool -L "%s"' % pth).readlines():
>          m = re.search(r"\s+(.*?)\s+\(.*\)", line)
> @@ -363,6 +369,13 @@
>                  rel_path = lib.replace("@executable_path",".")
>                  rel_path = os.path.join(os.path.dirname(pth), rel_path)
>                  lib = os.path.abspath(rel_path)
> +            elif not os.path.isabs(lib):
> +                # lookup matching framework path, if relative pathname
> +                for p in fwpaths:
> +                    fwlib = os.path.join(p, lib)
> +                    if os.path.exists(fwlib):
> +                        lib = fwlib
> +                        break
>              if os.path.exists(lib):
>                  rslt.append(lib)
>              else:
> 
> 
> For your convenience, it's also attached.

Thanks. I have committed this patch since it seems correct, given the
manpage.

I have also fixed the {DY}LD_LIBRARY_PATH issue in one-dir mode. Now
one-dir mode builds correctly set the environment variable and fork+exec
to make sure it is honored (exactly what one-file builds do).

This should fix all your problems. Does it?

> > >> We'll have to find out why hook-PyQt4.Qt*.py 
> > >> don't find the Qt4 plugins directory.
> > >
> > > It looks like QT_PLUGIN_PATH is set correctly, and they also appear
> > > altogether, but those plugins bind with nearly all Qt libs in
> > > existence, and this dependancy is not handled correctly, yet.
> >
> > This should be fixed wherever we fix the PyQt <-> Qt dependency, that is
> > with DYLD_LIBRARY_PATH (hopefully).
> 
> Of course it won't, since you _still_ cannot fix a _missing_ library with
> playing environmental games ;-) The PyQt <-> Qt dependency is resolved with 
> the attached patch.
> You will notice, when this starts to work, because the size of your app
> will grow considerably (as long as your app doesn't use QtNetwork, QtSql, 
> QtXml, QtSvg, or Qt3Support, yet). They all get pulled with the full 
> qt4_plugins support (see my list), but as you said before, they're handled 
> as data files ATM, which is the root of the problem. 

Ah, so you're basically saying that the plugins *themselves* bring in
additional dependencies, so, if we don't make them go through
bindepend.py, we might miss some library. Interesting, I had not thought
of that :)

BTW, I would like the plugin support to be exposed somehow to the suer.
For instance, I would like PyInstaller users to be able to specify in
their spec files which plugins they do really need. I'm not sure how it
could work though. I'll think of something.
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to