diff --git a/wxGTK-2.8.10-gsocket.patch b/wxGTK-2.8.10-gsocket.patch
new file mode 100644
index 0000000..32fb6c7
--- /dev/null
+++ b/wxGTK-2.8.10-gsocket.patch
@@ -0,0 +1,19 @@
+Index: 2.8/src/gtk/gsockgtk.cpp
+===================================================================
+--- 2.8/src/gtk/gsockgtk.cpp (revision 60599)
++++ 2.8/src/gtk/gsockgtk.cpp (working copy)
+@@ -15,8 +15,13 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+
++// newer versions of glib define its own GSocket but we unfortunately use this
++// name in our own (semi-)public header and so can't change it -- rename glib
++// one instead
++#define GSocket GlibGSocket
+ #include <gdk/gdk.h>
+ #include <glib.h>
++#undef GSocket
+
+ #include "wx/gsocket.h"
+ #include "wx/unix/gsockunx.h"
+
diff --git a/wxGTK.spec b/wxGTK.spec
index 86691b0..f1b4f87 100644
--- a/wxGTK.spec
+++ b/wxGTK.spec
@@ -4,7 +4,7 @@
 
 Name:           wxGTK
 Version:        2.8.10
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        GTK2 port of the wxWidgets GUI library
 # The wxWindows licence is the LGPL with a specific exemption allowing
 # distribution of derived binaries under any terms. (This will eventually
@@ -14,6 +14,9 @@ Group:          System Environment/Libraries
 URL:            http://www.wxwidgets.org/
 Source0:        http://dl.sf.net/wxwindows/%{name}-%{version}.tar.bz2
 
+# http://trac.wxwidgets.org/ticket/10883
+Patch0:         %{name}-2.8.10-gsocket.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gtk2-devel, zlib-devel >= 1.1.4
@@ -94,6 +97,7 @@ libraries or the X Window System.
 
 %prep
 %setup -q -n %{name}-%{version}
+%patch0 -p1 -b .gsocket
 
 sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure
 
@@ -245,6 +249,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jun 11 2009 Dan Horák <dan[at]danny.cz> - 2.8.10-2
+- fix build with glib >= 2.21
+
 * Sat Mar 21 2009 Dan Horák <dan[at]danny.cz> - 2.8.10-1
 - update to 2.8.10
 - fix default plugin path for 64 bit arches