[PyQt] Deploying PyQt5 application for Windows from Linux/MinGW
Kyle Altendorf
sda at fstab.net
Thu Jan 14 01:40:03 GMT 2016
Hi All,
Is it possible to pyqtdeploy from a Linux host to a Windows target? I
successfully wrote a Linux->Linux script and after awhile moved on to
Linux->Windows. I got through both the host and target builds, did
pyqtdeploy on Windows to nab the files out of an official python.org
install, and then on to actually deploying. While deploying I end up
with:
i686-w64-mingw32.static-gcc -c -pipe -fno-keep-inline-dllexport -O2 -w
-DPYQTDEPLOY_OPTIMIZED -DXML_STATIC -DCOMPILED_FROM_DSP -DMS_WINDOWS
-D_WIN32_WINNT=Py_WINVER -DNTDDI_VERSION=Py_NTDDI -DWINVER=Py_WINVER
-D_WIN32_WINNT=0x0400 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB
-DQT_CORE_LIB -DQT_NEEDS_QMAIN -I.
-I../sysroot-win-32/src/Python-3.4.4/Modules/expat
-I../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes
-I../sysroot-win-32/include/python3.4
-I../sysroot-win-32/src/Python-3.4.4/Modules
-I../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc
-I../sysroot-win-32/src/Python-3.4.4/PC
-I/epc/t/134/st/../misc-build/sysroot/include
-I../sysroot-win-32/native/src/mxe/usr/i686-w64-mingw32.static/qt5/include
-I../sysroot-win-32/native/src/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets
-I../sysroot-win-32/native/src/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui
-I../sysroot-win-32/native/src/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore
-Irelease
-I../sysroot-win-32/native/src/mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++
-o release/win32.o
../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc/win32.c
../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc/win32.c:
In function 'ffi_call_x86':
../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc/win32.c:48:2:
error: '_asm' undeclared (first use in this function)
_asm {
^
../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc/win32.c:48:2:
note: each undeclared identifier is reported only once for each function
it appears in
../sysroot-win-32/src/Python-3.4.4/Modules/_ctypes/libffi_msvc/win32.c:48:7:
error: expected ';' before '{' token
_asm {
^
A little searching later and it's clear that MinGW isn't going to be
able to compile libffi_msvc/win32.c due to the two compilers having
significantly different assembly formats. My epyq.pro and
Makefile.release are pasted (I hope that doesn't break etiquette here).
http://paste.ubuntu.com/14492530/
http://paste.ubuntu.com/14492531/
I will note that I ran across the following post to this list and was
able to get past Jack's issue with SOLE_AUTHENTICATION_SERVICE by adding
DEFINES += "_WIN32_WINNT=0x0400" to the qmake tab in my project. I kind
of assume that's a hacky solution, but it did get rid of the error.
https://www.riverbankcomputing.com/pipermail/pyqt/2015-August/036235.html
So, if cross-deploying from Linux->Windows should be possible, I am all
ears and would be happy to put in more time. My buildlibs script is
perusable on GitHub if you are interested. It is followed by deploy
from the second repository. I run both in there virtualenv's setup by
venv.py from each repository (though that may be an unnecessary remnant,
I don't recall at the moment).
https://github.com/altendky/misc/tree/7291865b0a8703458f9940cc8ab60d33fbb1795c
https://github.com/altendky/st/tree/34e730ef0ca1baeefba44293c4d045417c868717
Thanks for any feedback, and certainly also for all of PyQt.
Cheers,
-kyle
More information about the PyQt
mailing list