From: Anthony Garcia <lagg@lavabit.com>
Desrciption: BUG(2212): Make glib check sane, require 2.14
 There's no reason to require the same library version as the one
 installed on whatever machine built xmms2.
Origin: upstream, http://git.xmms.se/?p=xmms2-anthonyg.git;a=commitdiff;h=03ca261ad06b7af2eee9090036d308caf35bbdcd
Bug: http://bugs.xmms2.xmms.se/view.php?id=2212
Bug-Debian: http://bugs.debian.org/522280

--- xmms2-0.7DrNo+dfsg.orig/src/include/xmms/wscript
+++ xmms2-0.7DrNo+dfsg/src/include/xmms/wscript
@@ -53,6 +53,10 @@ def configure(conf):
     if Options.platform == 'win32':
         defs['PKGLIBDIR'] = 'Plugins/'
 
+    # Define minimum required glib version
+    defs['XMMS_GLIB_REQUIRED_MAJOR'] = 2
+    defs['XMMS_GLIB_REQUIRED_MINOR'] = 14
+
     for i in defs:
         conf.define(i, defs[i])
 
--- xmms2-0.7DrNo+dfsg.orig/src/xmms/main.c
+++ xmms2-0.7DrNo+dfsg/src/xmms/main.c
@@ -449,12 +449,13 @@ main (int argc, char **argv)
 	};
 
 	/** Check that we are running against the correct glib version */
-	if (glib_major_version != GLIB_MAJOR_VERSION ||
-	    glib_minor_version < GLIB_MINOR_VERSION) {
-		g_print ("xmms2d is build against version %d.%d,\n"
-		         "but is (runtime) linked against %d.%d.\n"
+	if ((glib_major_version == XMMS_GLIB_REQUIRED_MAJOR &&
+	     glib_minor_version < XMMS_GLIB_REQUIRED_MINOR) ||
+	    (glib_major_version < XMMS_GLIB_REQUIRED_MAJOR)) {
+		g_print ("xmms2d requires at least glib %d.%d\n"
+		         "The glib on this system is %d.%d\n"
 		         "Refusing to start.\n",
-		         GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
+		         XMMS_GLIB_REQUIRED_MAJOR, XMMS_GLIB_REQUIRED_MINOR,
 		         glib_major_version, glib_minor_version);
 		exit (EXIT_FAILURE);
 	}
@@ -469,13 +470,13 @@ main (int argc, char **argv)
 		exit (EXIT_FAILURE);
 	}
 	if (showhelp) {
-#if GLIB_CHECK_VERSION(2,14,0)
-		g_print ("%s", g_option_context_get_help (context, TRUE, NULL));
+		gchar *help;
+
+		help = g_option_context_get_help (context, TRUE, NULL);
+		g_print ("%s", help);
+		g_free (help);
+
 		exit (EXIT_SUCCESS);
-#else
-		g_print ("Please use --help or -? for help\n");
-		exit (EXIT_FAILURE);
-#endif
 	}
 	g_option_context_free (context);
 
