gperiodic (2.0.10-7) remove_DEPRECATED_flags_for_GTK_2_4.patch

Summary

 Makefile    |    9 ++++++---
 gperiodic.c |    4 ++++
 gperiodic.h |    2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)

    
download this patch

Patch contents

Author: Sebastien Bacher <seb128@debian.org>
Description: Makefile (CFLAGS): Remove the DEPRECATED flags
 Build fine with GTK+2.4. Add the LDFLAGS variable to give some linker flags.
 Added possibility to set some CFLAGS and LDFLAGS.
Forwarded: yes

diff -urNad gperiodic~/Makefile gperiodic/Makefile
--- gperiodic~/Makefile	2007-07-11 14:58:05.000000000 +0200
+++ gperiodic/Makefile	2008-06-30 14:45:51.000000000 +0200
@@ -1,6 +1,9 @@
 CC := gcc
-CFLAGS := `pkg-config --cflags gtk+-2.0` -I. -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
-LIBS :=`pkg-config --libs gtk+-2.0`
+CFLAGS :=
+LIBS :=
+LDFLAGS :=
+override CFLAGS += `pkg-config --cflags gtk+-2.0` -I. -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
+override LIBS += `pkg-config --libs gtk+-2.0`
 bindir ?= /usr/bin
 datadir ?= /usr/share
 enable_nls ?= 1
@@ -13,7 +16,7 @@
 	make -C po/ all enable_nls=$(enable_nls)
 
 gperiodic: gperiodic.o
-	$(CC) $(CFLAGS) -o gperiodic gperiodic.o $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o gperiodic gperiodic.o $(LIBS)
 ifeq ($(strip),1)
 	strip gperiodic
 endif
diff -urNad gperiodic~/gperiodic.c gperiodic/gperiodic.c
--- gperiodic~/gperiodic.c	2007-07-11 15:01:34.000000000 +0200
+++ gperiodic/gperiodic.c	2008-06-30 14:47:16.000000000 +0200
@@ -386,9 +386,13 @@
 			       table[i].info[NUMBER], table[i].info[WEIGHT]);
 
 /* create a new tooltips object... */
+#if !GTK_CHECK_VERSION(2,12,0)
 	table[i].tooltip = gtk_tooltips_new();
 	gtk_tooltips_set_delay(table[i].tooltip,100);
 	gtk_tooltips_set_tip(table[i].tooltip,table[i].button,buff,NULL);
+#else
+	gtk_widget_set_tooltip_text(table[i].button,buff);
+#endif /* GTK_CHECK_VERSION */
 
 /* attach the button to the table */
 	gtk_table_attach(GTK_TABLE(periodic_table), table[i].button,
diff -urNad gperiodic~/gperiodic.h gperiodic/gperiodic.h
--- gperiodic~/gperiodic.h	2007-07-11 14:59:30.000000000 +0200
+++ gperiodic/gperiodic.h	2008-06-30 14:47:50.000000000 +0200
@@ -70,7 +70,9 @@
   GdkColor    color;
   GtkStyle    *style;
   GtkWidget   *button;    /* associated gtk button */
+#if !GTK_CHECK_VERSION(2,12,0)
   GtkTooltips *tooltip;    /* associated gtk tooltip */
+#endif /* GTK_CHECK_VERSION */
 };
 
 struct colorscale {       /* table of maxcolor GkdColors */