After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 123014 - PyGtk build problem on Win32 using the 'distutils' approach.
PyGtk build problem on Win32 using the 'distutils' approach.
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: general
2.1.x/2.2.x
Other Windows
: Normal major
: ---
Assigned To: Cedric Gustin
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-23 09:01 UTC by Alif Wahid
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the current CVS head build problems on Win32. (2.73 KB, patch)
2003-09-23 09:02 UTC, Alif Wahid
none Details | Review
The new patch as requested (made with the -u argument to diff). (5.32 KB, patch)
2003-12-20 00:42 UTC, Alif Wahid
none Details | Review
New patch without the IM functions in gtk-fake-win32.c file. (4.89 KB, patch)
2003-12-22 09:57 UTC, Alif Wahid
none Details | Review
Adds some fake *_get_type functions to gtk-fake-win32.c (1.35 KB, patch)
2004-03-09 10:25 UTC, Cedric Gustin
none Details | Review
Add a copy of some missing *_get_type functions to gtk-fake-win32.c (1.88 KB, patch)
2004-03-10 08:49 UTC, Cedric Gustin
none Details | Review

Description Alif Wahid 2003-09-23 09:01:26 UTC
The current CVS head of PyGtk-2.1.x doesn't build on Win32 using the 
setup.py script. This is a patch to fix that. 

The major problem is undefined symbols in the official Gtk+-2.2.4 
binaries for Win32. So I've added those symbols to the gtk-fake-win32.c 
file in the form of empty function stubs.

Also since support for the GtkGLArea library has now been dropped on the 
CVS head, I modified the setup.py script to reflect that. The version 
numbers and the dependency version numbers have also been upgraded.
Comment 1 Alif Wahid 2003-09-23 09:02:33 UTC
Created attachment 20207 [details] [review]
Patch to fix the current CVS head build problems on Win32.
Comment 2 Johan (not receiving bugmail) Dahlin 2003-12-18 23:12:46 UTC
Could you please resubmit a patch created with -u to diff. It makes it
easier to actually read the patch. 

Thanks (reopen as NEW when you attached the new patch)
Comment 3 Alif Wahid 2003-12-20 00:42:07 UTC
Created attachment 22581 [details] [review]
The new patch as requested (made with the -u argument to diff).
Comment 4 James Henstridge 2003-12-22 07:28:03 UTC
Aren't those IM related functions you added to gtk-fake-win32.c
included in the win32 build?  I seem to remember that a particular
win32 GTK build missed them due to a bug in the export list for the
DLL, rather than them only working on X11.  If this is the case, I'd
prefer to require a working GTK DLL on Windows.

The other changes look sane though (updates to the distutils code for
HEAD pygtk).
Comment 5 Alif Wahid 2003-12-22 09:53:44 UTC
Yap, you're right. The IM functions now do appear on the CVS HEAD of 
Gtk+-2.3.1 and I've managed to compile PyGTK CVS HEAD with a 
modified gtk-fake-win32.c file. Please do take notice that the 
functions related to GtkPlug/GtkSocket and GdkFont aren't available 
so I've left those in the gtk-fake-win32.c file still. Following is 
a new patch (minus the two IM functions from the gtk-fake-win32.c 
file). 
Comment 6 Alif Wahid 2003-12-22 09:57:42 UTC
Created attachment 22635 [details] [review]
New patch without the IM functions in gtk-fake-win32.c file.
Comment 7 James Henstridge 2003-12-22 15:53:07 UTC
I just applied your setup.py changes in CVS (should make things less
broken than they were).

I didn't include the gtk-fake-win32.c changes, instead adding the
appropriate functions to the ignore-win32 section of the appropriate
.overrides file.

I also added the gtk_plug_construct_* functions to the ignore list for
all platforms, since they shouldn't be needed.

Could you check to see whether things look like they are working?  In
particular, the "if '--enable-threading' in sys.argv:" block looks
like it might be slightly broken since you turned threading on by
default (it looks like a bit of a hack, but I don't know how it is
supposed to be done ...).

Thanks for the patches.
Comment 8 Alif Wahid 2003-12-23 02:40:39 UTC
The changes are fine. The "if '--enable-threading' in sys.argv" 
block isn't broken yet since the relevant code in the PyGtkBuild 
class (the line setting the 'enable_threading' variable to 1) is 
ineffective. A bit more code is needed to enable threading by 
default using the proper distutils way. I'll try to submit a patch 
sometime soon about that on a new bug. Let me know if you want 
something otherwise about that. Cheers.
Comment 9 Cedric Gustin 2004-03-09 10:24:28 UTC
Actually, there is still a problem when building the current pygtk 
CVS against gtk+-2.2.4 on win32. Two IM related functions 
(im_preedit_style and im_status_style) are still not dll exported in 
the (official) binary distributions of gtk+-2.2 on win32, namely 
Tor's binaries (20040124) and the installer from dropline. This is 
fixed in gtk+ HEAD but because the majority of the pygtk developers 
on win32 use one of these two sets of binaries, I think we should 
have a gtk-fake-win32.c that provides the missing *_get_type 
functions for gtk+-2.2.4 or below. The following patch fixes this 
issue. It has been tested with both gtk+-2.2.4 (dropline 
distribution) and gtk-2.3.x (CVS as of 20040308). 

However, when compiled against gtk+-2.2.4 with the fake *_get_type 
for im_preedit and im_status, I get those warnings

** (hello.py:3768): WARNING **: `(nil)' is not an enum type

** (hello.py:3768): WARNING **: `(nil)' is not an enum type

Removing the corresponding pyg_enum_add_constants functions manually 
in the generated gtk/gtk.c fixes this issue, but is there a cleaner 
way of doing this (by adding an appropriate entry in gtk.override for 
example) ? 
Comment 10 Cedric Gustin 2004-03-09 10:25:49 UTC
Created attachment 25375 [details] [review]
Adds some fake *_get_type functions to gtk-fake-win32.c
Comment 11 Cedric Gustin 2004-03-10 08:47:28 UTC
Forget about the previous patch. This new one fixes the warning
** (hello.py:3768): WARNING **: `(nil)' is not an enum type

The solution is of course to provide a copy (from gtktypebuiltins.c) 
of the *_get_type functions that are not dll exported. This is of 
course a temporary, win32-specific, messy hack that will be removed 
as soon as gtk+-2.4 binaries are made available for the win32 
platform. In the meantime, we have to make sure that the upcoming 
pygtk-2.2 compiles against the binaries that are available today (the 
installer from dropline or Tor zip distribution) 

Comment 12 Cedric Gustin 2004-03-10 08:49:09 UTC
Created attachment 25438 [details] [review]
Add a copy of some missing  *_get_type functions to gtk-fake-win32.c
Comment 13 Johan (not receiving bugmail) Dahlin 2004-07-29 17:55:05 UTC
Is this still an issue?

Or can we just live on and move to 2.4 ?
Comment 14 Cedric Gustin 2004-07-29 18:45:27 UTC
This problem is fixed in GTK+-2.4. pygtk-2.2 works nicely on win32 against the
GTK+-2.4 runtime (as provided for example by the gladewin32 installer).

Let's move on and close this bug if nobody complains.
Comment 15 Johan (not receiving bugmail) Dahlin 2004-07-29 19:27:01 UTC
Great.

Closing.