supercheetah píše v Čt 14. 04. 2011 v 07:27 -0700:
one guy uses (or used?) pyinstaller and wine for the following service:
https://www.ohloh.net/p/python-packager
One of the benefits is: one can use a shell script to install Python and
everything you need in wine. And after bundling, you can simply delete
the wine directory. So you'll get an test environment quite cheep.
Here are parts of my setup-script:
PYHOME=c:/python25
PYTHON="wine $PYHOME/python.exe"
WINREPO=~/devel/windows-repos # my repository of Windows software
msiexec /q /i $WINREPO/python-2.5.4.msi
cd /tmp
curl http://python-distribute.org/distribute_setup.py | $PYTHON
wine easy_install pip virtualenv
cp -v $WINREPO/mfc71.dll $(winepath -u $PYHOME)/DLLs
wine $WINREPO/pywin32-209.1.win32-py2.5.exe
wine $WINREPO/nsis-*-setup.exe
--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP
Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de
Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de
> WINPWD=`winepath -w \`pwd\``
You may want to use the $(...) syntax here, which is much easier to read
and to nest:
WINPWD=$(winepath -w $(pwd))
> I'm presuming that pywin32 has already been installed under wine
> (which it has on my machine). Now I just went ahead and installed the
> latest stable version of Python into Wine as well (2.7) and so I'm
Well, you need to install everything into wine that you need for
building your package. If your program requires pywin32, you should
install it for Python 2.7 (pyinstaller does not require pywin32).
> However, it seems that when I compile this for Windows, it doesn't
> pull in any of my modules except the script I specify. As soon as my
> executable makes a call into one of the other files, it says "'module'
> object has no attribute 'othermodulefunction'" as though the
> 'othermodulefunction' just doesn't exist. It works just fine when I
> compile it as a Linux binary though.
Please make sure, your example is working in Unix/Linux, then move
forward to cross-bundling in wine. Try the same software version on both
sides, this helps finding bugs. Esp. use the same version of PyInstaller
in both cases.
HTH
Glad to hear you solved the problem.
This is why I set up a fresh wine environment for each build :-) Wine
can easily change the place whare it looks for your setup, so you do not
destroy you working environment. Take a look at the env-var WINEPREFIX
in the man page