[PyQt] Cross compiling...

Kyle Altendorf sda at fstab.net
Tue Jan 19 22:34:09 GMT 2016


On 2016-01-19 08:48, John M. Hackett wrote:
> Now, the question is do I have to go through this trauma on each 
> platform I want to run the app on? Is it not possible to cross compile 
> on the linux host? If not why do the pyqtdeploy instructions talk about 
> the multi platform directory structure - is this just so that the 
> project file can be moved to different platforms without being changed?

I have tried and gotten a good ways through quite a few issues but no 
actual success or certainty as to whether or not it is feasible.  Just a 
couple days ago I asked a similar question as you.  My big concern is 
either trying to link to the MSVC compiled CPython or dealing with the 
(not recommended) approach of building your own Windows CPython.  Also, 
my last sticking point noted in my post was the section of CPython that 
apparently is MSVC-only with regards to Windows.

https://www.riverbankcomputing.com/pipermail/pyqt/2016-January/036806.html

> Finally - if not then has anyone scripted or written a detailed 
> tutorial on how best to install all the elements required on each 
> platform?

For host:Linux/target:Linux I put together a script to download and 
build the main libraries and another script to call pyqtdeploy.  There 
is some funny business, it's not the tidiest, and I have some nice 
changes but they are in a broken host:Linux/target:Windows version that 
doesn't work.  Also, the nice changes are in the direction that make me 
think I should just have a Make file...

Linux->Linux:
https://canopyner.exana.io/diffusion/C/browse/master/buildlibs;7db6f850d256
https://canopyner.exana.io/diffusion/C/browse/master/deploy;7db6f850d256

Linux->Windows (not working but more 'refined'):
https://github.com/altendky/misc/blob/7291865b0a8703458f9940cc8ab60d33fbb1795c/buildlibs

I also put together a virtualenv setup script though partway through 
that I saw references to virtualenv bootstrap scripts which is probably 
what I should have used.  Ah well, next iteration.  This should work on 
Linux, Windows, and Cygwin (with Windows Python, at least).  I don't 
recall the difference between the two copies *yuck* in detail right now 
beyond the first one being configured for that project and the second 
one being a generic unconfigured version.

https://github.com/altendky/st/blob/95189ee16614021b86eac84abc0a8c5f28781c73/venv.py
https://github.com/altendky/misc/blob/7291865b0a8703458f9940cc8ab60d33fbb1795c/venv.py

In short, I look forward to figuring out a) if we can cross-build for 
Windows from Linux, b) getting building for Windows at all working, and 
c) getting whatever solutions tidied up for easy use in the basic 
situations.

Cheers,
-kyle


More information about the PyQt mailing list