Xpra: Ticket #300: setup a proper build infrastructure for win32 builds

Developing on win32 is a nightmare and we rely on far too many sources for all the DLLs we need. We should setup a cross compile environment based on mingw so that anyone can just follow some simple (?) steps and obtain all the components, built from source, with or without debugging symbols, etc Including:

etc.. Then we can also automate the build and include that from the buildbot.

This should make the code more reliable/maintainable and may well help in solving a number of ugly win32 tickets:

Tue, 16 Jul 2013 06:21:33 GMT - Antoine Martin: status, milestone changed; owner set

Tue, 16 Jul 2013 06:26:19 GMT - Antoine Martin: description changed

Thu, 17 Oct 2013 07:45:40 GMT - Antoine Martin: milestone changed

no time - re-scheduling

Tue, 08 Apr 2014 10:41:11 GMT - Antoine Martin: milestone changed

This is becoming more important so we can ensure that we don't ship vulnerable media libraries (see #544)

Mon, 21 Apr 2014 04:37:29 GMT - Antoine Martin:

Here are some of the mingw packages we will need, available on Fedora 20:

Things we should be able to compile from the mingw shell:

Potential problems:

Maybe we can mix cross-compilation and native versions? Or maybe we should start considering moving to Python 3 + native clients?, as this may well be easier to build with a cross compiler (see python-mingw)

Mon, 21 Apr 2014 08:51:28 GMT - Antoine Martin:

OK, here are a few things that do build. Loosely based on the list of dependencies found here for OSX builds. Unless otherwise stated, just run mingw32-configure && make && make install in the source:

Things that do not build (yet?):

Mon, 21 Apr 2014 09:14:21 GMT - Antoine Martin: attachment set

patch for cross compiling Python 2.7.6 with mingw

Mon, 21 Apr 2014 11:09:01 GMT - Antoine Martin:

With the patch above (found cross compiling python for windows with mingw32), I can compile Python 2.7.6! (only it didn't find windres so I edited the Makefile to point it to /usr/bin/i686-w64-mingw32-windres) Then we Configure wine to be able to run the new Python.exe. We can then install setuptools:

sudo /usr/i686-w64-mingw32/sys-root/mingw/bin/python.exe ./setup.py install

Find out that Python has been built without SSL support ("unknown url type: https") and install mingw32-openssl to rebuild it with https support...

Then we can proceed with the python dependencies using the newly installed /opt/i686-w64-mingw32/sys-root/mingw/bin/easy_install.exe and add: pyasn1, lz4. (the others need more work..)

Mon, 21 Apr 2014 15:30:33 GMT - Antoine Martin:

Trying (and failing) to build a simple extension (netifaces):

Then I can try to run the build:

/opt/i686-w64-mingw32/sys-root/mingw/bin/python.exe ./setup.py build --compiler=mingw32

Which fails to find Python.h... and adding it by hand for now only fails a little bit later... Copying all the headers to the source directory is easier than fighting wine / unix paths, but it eventually still fails.

Sun, 27 Apr 2014 12:56:14 GMT - Antoine Martin:

This is such a pain that maybe #90 is a better way forward?

One problem with this solution is that GTK3 binaries for MS Windows are almost as out of date as the GTK2 version (over 2 years without update..), see GTK Download for Windows:

So even with this one, we will have to try to rebuild a fair amount of stuff. There are some newer builds here: http://win32builder.gnome.org/, but no idea how well they work and how official they are... what a mess.

Thu, 01 May 2014 17:04:23 GMT - Antoine Martin: status changed; resolution set

I think building pygtk2 from source will just be too hard (cross compiling is a no go because of all the extensions that need to be compiled - already hard enough even without the cross compiling part), especially if we need to update some of the libraries for security reasons (ie: libpng.

So I am closing this as WONTFIX for now, hoping that we can move win32 clients to GTK3 (#90).

Mon, 25 Apr 2016 10:30:06 GMT - Antoine Martin: status, milestone changed; resolution deleted

Re-opening, GTK3 is going nowhere fast.

Mon, 25 Apr 2016 10:30:25 GMT - Antoine Martin: owner, status changed

@smo: hexchat build?

Thu, 28 Apr 2016 06:02:01 GMT - Antoine Martin:

Should probably be merged / closed as duplicate of #678

Sat, 14 May 2016 07:05:16 GMT - Antoine Martin:

There are 3 tickets that should be consolidated into one: #917, #678 and #300

Tue, 12 Jul 2016 16:52:22 GMT - Antoine Martin: milestone changed

Milestone renamed

Wed, 07 Sep 2016 10:04:47 GMT - Antoine Martin: milestone changed

Fri, 30 Dec 2016 11:09:06 GMT - Antoine Martin: status changed; resolution set

Will follow up in #678.

Sat, 23 Jan 2021 04:51:02 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/300