Patchwork [meta-oe] omgps: Fix build with glib-2.0 > 2.35

login
register
mail settings
Submitter Khem Raj
Date June 13, 2013, 9:37 a.m.
Message ID <1371116236-25088-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/51671/
State Accepted, archived
Commit eccb3d022a063d74727690c8e4f384b8406b13a6
Headers show

Comments

Khem Raj - June 13, 2013, 9:37 a.m.
Fix errors like

| src/main.c: In function 'main':
| src/main.c:490:2: error: 'g_type_init' is deprecated (declared at
/builds1/angstrom/build/tmp-angstrom_next-eglibc/sysroots/qemuarm/usr/include/glib-2.0/gobject/gtype.h:669)
[-Werror=deprecated-declarations]
|   g_type_init();
|   ^
| cc1: all warnings being treated as errors
| make[1]: *** [omgps-main.o] Error 1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...g_type_init-is-deprecated-for-glib-2.35.0.patch |   33 ++++++++++++++++++++
 meta-oe/recipes-navigation/omgps/omgps_svn.bb      |    1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-oe/recipes-navigation/omgps/omgps/0001-g_type_init-is-deprecated-for-glib-2.35.0.patch

Patch

diff --git a/meta-oe/recipes-navigation/omgps/omgps/0001-g_type_init-is-deprecated-for-glib-2.35.0.patch b/meta-oe/recipes-navigation/omgps/omgps/0001-g_type_init-is-deprecated-for-glib-2.35.0.patch
new file mode 100644
index 0000000..6b9f465
--- /dev/null
+++ b/meta-oe/recipes-navigation/omgps/omgps/0001-g_type_init-is-deprecated-for-glib-2.35.0.patch
@@ -0,0 +1,33 @@ 
+From 22bcf06637d64e40af6c152e28b31eef41e3f583 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jun 2013 02:35:22 -0700
+Subject: [PATCH] g_type_init() is deprecated for glib >= 2.35.0
+
+Call it for old versions.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ src/main.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index e984da4..a63ddf3 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -486,9 +486,9 @@ int main(int argc, char **argv)
+ 		if (strcmp(argv[1], "-log2file") == 0)
+ 			log2console = FALSE;
+ 	}
+-
++#if !GLIB_CHECK_VERSION(2,35,0)
+ 	g_type_init();
+-
++#endif
+ 	gdk_threads_init();
+ 
+ 	gdk_threads_enter();
+-- 
+1.7.9.5
+
diff --git a/meta-oe/recipes-navigation/omgps/omgps_svn.bb b/meta-oe/recipes-navigation/omgps/omgps_svn.bb
index e1c1a71..1a79df4 100644
--- a/meta-oe/recipes-navigation/omgps/omgps_svn.bb
+++ b/meta-oe/recipes-navigation/omgps/omgps_svn.bb
@@ -21,6 +21,7 @@  SRC_URI = "svn://omgps.googlecode.com/svn/trunk;module=omgps;protocol=http \
            file://use.unused.variable.patch \
            file://fix.build.with.glib.2.34.patch \
            file://gdk-pixbuf-2.26.5.patch \
+           file://0001-g_type_init-is-deprecated-for-glib-2.35.0.patch \
 "
 
 inherit autotools