[pygtk] Working version of PyGTK for win64

Miroslav Sabljic miroslav.sabljic at avl.com
Thu Jul 16 20:13:31 WST 2009


Hello all,

I've built and run PyGTK for 64-bit Windows. I'm working for AVL 
(http://www.avl.com), we are developing simulation software and 
intensively using GTK+ in our applications. We need to support 64-bit 
Windows platforms and when GTK+ for win64 appeared all it was missing 
for us was PyGTK win64 version, so we started working on compiling PyGTK 
for win64 and it seems we succeeded.

PyGTK was built using mingw-w64 compiler. Requirements for this build 
are gtk+-bundle available from 
http://www.gtk.org/download-windows-64bit.html, MSYS, mingw-w64 compiler 
available from 
http://garr.dl.sourceforge.net/sourceforge/mingw-w64/mingw-w64_x86-64_mingw32_4.4.0-1.zip, 
and Python installation for 64-bit Windows. Source versions used are 
PyGTK v2.12.1, PyGObject v2.14.2 and PyCairo v1.8.0.

I've created small installers for this release, they are available from:
http://www.civija.net/pygtk/pycairo-1.8.0.win64-py2.5.exe
http://www.civija.net/pygtk/pygobject-2.14.2.win64-py2.5.exe
http://www.civija.net/pygtk/pygtk-2.12.1.win64-py2.5.exe

We tested it and it seems that everything is working, at least for our 
applications. There was a minor patch on atk module in PyGTK, we had to 
disable the following function definitions from atk.defs and 
atk-types.defs because of undefined reference errors. Disabled functions 
are:
atk_streamable_content_get_uri
atk_hyperlink_impl_get_type
atk_hyperlink_impl_get_hyperlink

Other then that we didn't do any other patches to source files.

Here are setup instructions we did:
Download all requirements and sources mentioned above and extract them 
in one folder i.e. D:\users\sabljicm\work so that each package is in 
it's own separate subfolder inside D:\users\sabljicm\work. Then export 
following env. variables:
LDFLAGS=-no-undefined
CPPFLAGS=-I/d/users/sabljicm/work/pygtk/Python25_64/include 
-I/d/users/sabljicm/work/pygtk/pygobject-2.14.2/gobject
PATH=/d/users/sabljicm/work/pygtk/gtk+-bundle/bin/:/d/users/sabljicm/work/pygtk/mingw-w64/bin:/d/users/sabljicm/work/pygtk/Python25_64
CFLAGS=-DPLATFORM_WIN32 -DMS_WIN64
PKG_CONFIG_PATH=/d/users/sabljicm/install/pygobject/lib/pkgconfig:/d/users/sabljicm/install/pycairo/lib/pkgconfig
CC=/d/users/sabljicm/work/pygtk/mingw-w64/bin/x86_64-w64-mingw32-gcc-4.4.1.exe

Adjust the folder names and paths to match your setup. The 
"-no-undefined" in LDFLAGS is needed in order for libtool to produce 
.dll, also "-DMS_WIN64" in CFLAGS is needed for some Python functions 
which have different names in win32 and in win64 versions, so without 
this you will get undefined references errors.

Then run ./configure --prefix="/some/path". For PyGObject we added 
"--without-ffi" as a configure option and for other packages we just 
used the defaults without any additional options. After that the process 
is pretty much straight forward (make, make install), you will have to 
convert backslashes to slashes on couple of places in Makefiles.

I believe it would be very useful to a number of people if someone would 
take over and continue this process, and provide official win64 builds 
like those win32 versions.

Please note that this is just our give back to open source community and 
we WILL NOT be able to support this.

Thanks!


-- 
Best regards,
   Miroslav


More information about the pygtk mailing list