Closed bitsgalore closed 7 years ago
How to set up the environment:
TODO:
Perhaps use portable installations?
This works:
Installation works both with 64- and 32 bit versions (though I weeded out some of the other stuff that is installed by WinPython). Pip.exe also fails, but as a workaround we can use this:
wine ~/.wine/drive_c/Python27_32/python.exe -m pip install pyinstaller
Perhaps installation could be automated with a script.
Meanwhile this largely works (but version number extraction fails for some reason!):
The following script does most of what is needed: https://github.com/openpreserve/jpylyzer/blob/fixwinebuild/buildwin.sh
However in some cases the Zip file names contain garbage, e.g.:
jpylyzer_fixme:msvcrt:MSVCRT__wsopen_s.zip
This needs a fix. This might work:
and also:
https://askubuntu.com/questions/9284/how-to-make-wine-be-quiet-about-msvcr-errors
Finally according to below post import errors can occur for imported modules, which is remedied by adding the site-packages dir to pathex:
http://sparkandshine.net/en/build-a-windows-executable-from-python-scripts-on-linux/
ALSO the output of the build script includes this error:
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
Solution: install winbind package (see also here):
sudo apt-get install winbind
Wine garbage now suppressed in:
https://github.com/openpreserve/jpylyzer/commit/82273c360d87f12e7ce334c2197a4049b98fe3f2
According to the PyInstaller FAQ it is possible to cross-compile Windows binaries under Linux using Wine. See:
https://github.com/pyinstaller/pyinstaller/wiki/FAQ
And more specifically:
https://groups.google.com/forum/#!topic/pyinstaller/veq3BlA_Bns
This might be worth investigating, as it could potentially make the Windows binary creation more straightforward (e.g. create dedicated Vagrant boxes with the required environment, including Wine).