tags 515288 + patch

thank you

Hi,

Here is a patch that builds with Gtk2. Though I noticed after making it that you actually trimmed down the result of gtk-config for libs, I re-added pkg-config --libs gtk+-2.0 so you might want to trim that back down.

It does work for the minimal amount of testing that I did.  Hope it helps!

Thanks,

Barry deFreese
Debian QA


diff -u gman-0.9.3/debian/control gman-0.9.3/debian/control
--- gman-0.9.3/debian/control
+++ gman-0.9.3/debian/control
@@ -2,7 +2,7 @@
 Section: doc
 Priority: optional
 Maintainer: Josip Rodin <joy-packa...@debian.org>
-Build-Depends: debhelper (>= 5), libglib1.2-dev, libgtk1.2-dev
+Build-Depends: debhelper (>= 5), libglib2.0-dev, libgtk2.0-dev
 Standards-Version: 3.7.2
 
 Package: gman
diff -u gman-0.9.3/debian/changelog gman-0.9.3/debian/changelog
--- gman-0.9.3/debian/changelog
+++ gman-0.9.3/debian/changelog
@@ -1,3 +1,10 @@
+gman (0.9.3-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Build with Gtk2. (Closes: #515288).
+
+ -- Barry deFreese <bdefre...@debian.org>  Tue, 24 Feb 2009 14:58:55 -0500
+
 gman (0.9.3-5) unstable; urgency=medium
 
   * Replaced 'gtk-config --libs' call with a condensed list of library
diff -u gman-0.9.3/menu.c gman-0.9.3/menu.c
--- gman-0.9.3/menu.c
+++ gman-0.9.3/menu.c
@@ -113,7 +113,7 @@
 int man_items_count;
 int clist_selected_row;
 List * man_paths_to_be_load;
-char * keyword;
+const char * keyword;
 
 void updata_menu_buttons(int);
 
@@ -141,7 +141,8 @@
        gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, 
NULL);
 
   /* Attach the new accelerator group to the window. */
-       gtk_accel_group_attach (accel_group, GTK_OBJECT (window));
+/*     gtk_accel_group_attach (accel_group, GTK_OBJECT (window)); */
+       gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
 
        if (menubar)
        /* Finally, return the actual menu bar created by the item factory. */ 
@@ -381,7 +382,8 @@
 
 
 /******************* tools functions ******************/
-int search_array_for_text(char ** array, int count, char * text)
+/*int search_array_for_text(char ** array, int count, char * text) */
+int search_array_for_text(char ** array, int count, const char * text)
 {
        int i;
        for (i=0;i<count && strcmp(text,array[i])>0 ;i++);
@@ -418,8 +420,8 @@
        int i;
        GtkWidget * clist = (GtkWidget *)data;
        i = search_array_for_text(man_items_buffer, 
-                                                         man_items_count, 
-                                                         
gtk_entry_get_text(GTK_ENTRY(w)));
+               man_items_count, 
+               gtk_entry_get_text(GTK_ENTRY(w)));
        if (i == -1) return;
        gtk_clist_moveto(GTK_CLIST(clist),i,0,0.1,0.0);
        GTK_CLIST(clist)->focus_row = i;
@@ -630,7 +632,7 @@
 
 static void entry4_changed_callback(GtkWidget *w,gpointer data)
 {
-       char * tmp;
+       const char * tmp;
        tmp = gtk_entry_get_text(GTK_ENTRY(entry4));
        gtk_widget_set_sensitive(search_button,strlen(tmp) >= 3);
                
diff -u gman-0.9.3/window2.c gman-0.9.3/window2.c
--- gman-0.9.3/window2.c
+++ gman-0.9.3/window2.c
@@ -240,7 +240,7 @@
                break;
        case 3:                                                                 
//Add New
                x = 
(GtkWidget*)gtk_object_get_data(GTK_OBJECT(window2),"entry2");
-               c = gtk_entry_get_text(GTK_ENTRY(x));
+               c = (gchar *)gtk_entry_get_text(GTK_ENTRY(x));
                if(!strcmp(c,"")) {
                        g_print("gman: path name can not be empty\n");
                        break;
diff -u gman-0.9.3/Makefile gman-0.9.3/Makefile
--- gman-0.9.3/Makefile
+++ gman-0.9.3/Makefile
@@ -2,7 +2,7 @@
 # You can adjust the following variables.
 
 CXX = g++
-CXXFLAGS = -DVERSION=\"0.9.3\" $(shell gtk-config --cflags) -O2 -Wall $(DEBUG)
+CXXFLAGS = -DVERSION=\"0.9.3\" $(shell pkg-config --cflags gtk+-2.0) -O2 -Wall 
$(DEBUG)
 CC = $(CXX) $(CXXFLAGS)
 
 prefix = /usr
@@ -14,8 +14,10 @@
 objectfiles = menu.o mandata.o util.o gman.o list.o context.o task.o \
               taskfunc.o window2.o
 
+GTK_LIBS = $(shell pkg-config --libs gtk+-2.0)
+
 gman: $(objectfiles)
-       $(CC) -lpthread -lm -lgtk -lglib -rdynamic $(objectfiles) -o gman
+       $(CC) -lpthread $(GTK_LIBS) -rdynamic $(objectfiles) -o gman
 
 %.o: %.c %.h
 gman.o: gman.c gman.h menu.h

Reply via email to