Hi Martin,
I am 90% there but it's the last 90% that is getting me ;-)
The part that is causing the trouble is not the python bits. It's
imagemagick's convert program. My python app needs to call convert to
turn pdfs to pngs. Other external programs called by my app are working
successfully but I am guessing that is because it is easy to meet their
dependencies. wkhtmltopdf is a very large file so I assume every
dependency is already baked in. And pdftk only requires a sibling lib
folder containing 5 dylibs to operate. But it is not so simple with
convert ;-)
*QUESTION 1 - is there a simple way of turning a binary such as convert
into a larger binary* which contains all or most of its dependencies? If
so, my problem is probably solved. Apologies if the answer is obvious to
some people in this group - a lot of this is very new to me.
I built convert with (amongst others) the following config settings:
--with-gslib --enable-static --disable-shared--disable-installed
--with-png. The result was about 6MB rather than 25KB (non-static) and
was progress towards minimising its external dependencies. But I am not
sure how you bake in all the dylibs.
What I was hoping was that I'd be able to do something like follows:
a.binaries + [('convert',
'/usr/local/Cellar/imagemagick/6.9.0-9/bin/convert', 'BINARY'), ]
and pyinstaller would work out the dylib dependencies automatically
(like otool -L .../convert), put the required dylibs in the
Contents/MacOS folder, and enable convert to draw on them. Perhaps by
doing something similar to install_name_tool -change etc etc. And handle
the chain of dependencies so if /a/ requires /b/ and /b/ requires /c/
that /a/ and /b/ would be altered so they expected to find their
dependencies in @executable_path or something. (BTW some dependencies
were changed to @loader_path but not others).
Something similar partially happens if I manually work out the immediate
dependencies of convert using otools and add a tuple for each to the
a.binaries + [(eggs.dylib), (spam.dylib), ...]. In the resulting app
bundle I find a handful of extra dylibs added to the MacOS folder than
were specified in the TOC tuples. So pyinstis working out some of the
dependencies it seems.
But the code still doesn't work because convert can't find specific
dylibs - even though they're in the same folder. It looks for them in
the original locations on the packaging machine e.g. /usr/local/...
*QUESTION 2: Am I wrong in expecting pyinstaller to make the changes
described above (automatically adding dependencies and ensuring files
can link to them)?*
If pyinstaller can't help in this regard I guess I have the option of
manually working out dependencies using otool and making changes all the
way through the dependency chains using install_name_tool. But I'm
holding off in case there is a much more elegant way of doing all this.
Sorry for the long email and I hope someone can help me.
All the best,
Grant
On 29/01/15 21:49, Martin Zibricky wrote:
> On Thursday 29 of January 2015 19:55:37 Grant Paton-Simpson wrote:
>> Any words of advice before I start the process? One of the main things
>> I'm lacking is a decent mental model of what the packaging actually
>> does. My background is Sociology not computer science ;-).
> * start with the 'develop' branch
> * homebrew should be fine, I use it sometimes to test PyInstaller
> * bootloader is precompiled on OSX 10.9
> * you might find code signing useful
> * Regarding mental model, is there anything you miss in the manual?
>
> http://htmlpreview.github.io/?https://github.com/pyinstaller/pyinstaller/blob/develop/doc/Manual.html
>
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.