[SCM] gmerlin/master: Add patch to prevent FTBFS with GTK+ >= 2.24 (LP: #770957).
alessio at users.alioth.debian.org
alessio at users.alioth.debian.org
Sat Dec 3 19:22:03 UTC 2011
The following commit has been merged in the master branch:
commit f20ec6d3ebc52e1aeadbe104fab2897749ab54f7
Author: Alessio Treglia <alessio at debian.org>
Date: Sat Dec 3 20:21:46 2011 +0100
Add patch to prevent FTBFS with GTK+ >= 2.24 (LP: #770957).
diff --git a/debian/patches/fix_ftbfs_gtk_2.24.patch b/debian/patches/fix_ftbfs_gtk_2.24.patch
new file mode 100644
index 0000000..e14cb82
--- /dev/null
+++ b/debian/patches/fix_ftbfs_gtk_2.24.patch
@@ -0,0 +1,275 @@
+Description: Fix FTBFS because of deprecated functions in GTK >= 2.24.
+Origin: http://gmerlin.svn.sourceforge.net/viewvc/gmerlin?view=revision&revision=2779
+Bug-Ubuntu: https://launchpad.net/bugs/770957
+---
+ apps/alsamixer/g_control.c | 10 +++-------
+ include/gui_gtk/gtkutils.h | 5 +++++
+ lib/gtk/albumwindow.c | 6 +++++-
+ lib/gtk/cfg_multi_menu.c | 6 +++---
+ lib/gtk/cfg_stringlist.c | 10 +++++-----
+ lib/gtk/driveselect.c | 12 ++++++------
+ lib/gtk/gtkutils.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ lib/gtk/plugin_single.c | 4 ++--
+ lib/gtk/pluginmenu.c | 6 +++---
+ 9 files changed, 72 insertions(+), 27 deletions(-)
+
+--- gmerlin.orig/lib/gtk/cfg_multi_menu.c
++++ gmerlin/lib/gtk/cfg_multi_menu.c
+@@ -226,7 +226,7 @@ void bg_gtk_create_multi_menu(bg_gtk_wid
+ gtk_widget_show(priv->config_button);
+ gtk_widget_show(priv->info_button);
+
+- priv->combo = gtk_combo_box_new_text();
++ priv->combo = bg_gtk_combo_box_new_text();
+
+ if(w->info->help_string)
+ {
+@@ -241,10 +241,10 @@ void bg_gtk_create_multi_menu(bg_gtk_wid
+ while(w->info->multi_names[i])
+ {
+ if(w->info->multi_labels && w->info->multi_labels[i])
+- gtk_combo_box_append_text(GTK_COMBO_BOX(priv->combo),
++ bg_gtk_combo_box_append_text(priv->combo,
+ TR_DOM(w->info->multi_labels[i]));
+ else
+- gtk_combo_box_append_text(GTK_COMBO_BOX(priv->combo),
++ bg_gtk_combo_box_append_text(priv->combo,
+ w->info->multi_names[i]);
+ i++;
+ }
+--- gmerlin.orig/lib/gtk/cfg_stringlist.c
++++ gmerlin/lib/gtk/cfg_stringlist.c
+@@ -144,7 +144,7 @@ void bg_gtk_create_stringlist(bg_gtk_wid
+
+ priv->translation_domain = translation_domain;
+
+- priv->combo = gtk_combo_box_new_text();
++ priv->combo = bg_gtk_combo_box_new_text();
+ i = 0;
+
+ if(w->info->help_string)
+@@ -157,8 +157,8 @@ void bg_gtk_create_stringlist(bg_gtk_wid
+ {
+ while(w->info->multi_labels[i])
+ {
+- gtk_combo_box_append_text(GTK_COMBO_BOX(priv->combo),
+- TR_DOM(w->info->multi_labels[i]));
++ bg_gtk_combo_box_append_text(priv->combo,
++ TR_DOM(w->info->multi_labels[i]));
+ i++;
+ }
+ }
+@@ -166,8 +166,8 @@ void bg_gtk_create_stringlist(bg_gtk_wid
+ {
+ while(w->info->multi_names[i])
+ {
+- gtk_combo_box_append_text(GTK_COMBO_BOX(priv->combo),
+- w->info->multi_names[i]);
++ bg_gtk_combo_box_append_text(priv->combo,
++ w->info->multi_names[i]);
+ i++;
+ }
+ }
+--- gmerlin.orig/lib/gtk/plugin_single.c
++++ gmerlin/lib/gtk/plugin_single.c
+@@ -398,14 +398,14 @@ bg_gtk_plugin_widget_single_create(char
+
+ /* Make combo */
+ default_index = -1;
+- ret->combo = gtk_combo_box_new_text();
++ ret->combo = bg_gtk_combo_box_new_text();
+ g_signal_connect(G_OBJECT(ret->combo),
+ "changed", G_CALLBACK(change_callback),
+ (gpointer)ret);
+ for(i = 0; i < num_plugins; i++)
+ {
+ info = bg_plugin_find_by_index(reg, i, type_mask, flag_mask);
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ret->combo), info->long_name);
++ bg_gtk_combo_box_append_text(ret->combo, info->long_name);
+
+ if(info == default_info)
+ default_index = i;
+--- gmerlin.orig/lib/gtk/pluginmenu.c
++++ gmerlin/lib/gtk/pluginmenu.c
+@@ -69,14 +69,14 @@ bg_gtk_plugin_menu_create(int auto_suppo
+ ret = calloc(1, sizeof(*ret));
+ ret->auto_supported = auto_supported;
+
+- ret->combo = gtk_combo_box_new_text();
++ ret->combo = bg_gtk_combo_box_new_text();
+
+ g_signal_connect(G_OBJECT(ret->combo),
+ "changed", G_CALLBACK(change_callback),
+ (gpointer)ret);
+
+ if(auto_supported)
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ret->combo), TR(auto_string));
++ bg_gtk_combo_box_append_text(ret->combo, TR(auto_string));
+
+ ret->plugin_reg = plugin_reg;
+ ret->type_mask = type_mask;
+@@ -94,7 +94,7 @@ bg_gtk_plugin_menu_create(int auto_suppo
+
+ bg_bindtextdomain(plugin_info->gettext_domain,
+ plugin_info->gettext_directory);
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ret->combo),
++ bg_gtk_combo_box_append_text(ret->combo,
+ TRD(plugin_info->long_name,
+ plugin_info->gettext_domain));
+ }
+--- gmerlin.orig/lib/gtk/albumwindow.c
++++ gmerlin/lib/gtk/albumwindow.c
+@@ -339,9 +339,13 @@ void bg_gtk_album_window_attach(bg_gtk_a
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), bg_gtk_album_widget_get_widget(w->widget),
+ w->tab_widget);
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), page_num);
+-
++
++#if GTK_CHECK_VERSION(2,20,0)
++ g_object_set(notebook, "tab-fill", FALSE, NULL);
++#else
+ gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(notebook), bg_gtk_album_widget_get_widget(w->widget),
+ FALSE, FALSE, GTK_PACK_START);
++#endif
+
+ gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(notebook),
+ bg_gtk_album_widget_get_widget(w->widget),
+--- gmerlin.orig/lib/gtk/gtkutils.c
++++ gmerlin/lib/gtk/gtkutils.c
+@@ -550,3 +550,43 @@ void bg_gtk_widget_set_can_focus(GtkWidg
+ GTK_WIDGET_UNSET_FLAGS(w, GTK_CAN_FOCUS);
+ #endif
+ }
++
++
++GtkWidget * bg_gtk_combo_box_new_text()
++ {
++#if GTK_CHECK_VERSION(2,24,0)
++ return gtk_combo_box_text_new();
++#else
++ return gtk_combo_box_new_text();
++#endif
++ }
++
++void bg_gtk_combo_box_append_text(GtkWidget *combo_box, const gchar *text)
++ {
++#if GTK_CHECK_VERSION(2,24,0)
++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), text);
++#else
++ gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), text);
++#endif
++ }
++
++void bg_gtk_combo_box_remove_text(GtkWidget * b, int index)
++ {
++#if GTK_CHECK_VERSION(2,24,0)
++ int i;
++ GtkTreeIter it;
++ GtkTreeModel * model;
++ model = gtk_combo_box_get_model(GTK_COMBO_BOX(b));
++
++ if(!gtk_tree_model_get_iter_first(model, &it))
++ return;
++ for(i = 0; i < index; i++)
++ {
++ if(!gtk_tree_model_iter_next(model, &it))
++ return;
++ }
++ gtk_list_store_remove(GTK_LIST_STORE(model), &it);
++#else
++ gtk_combo_box_remove_text(GTK_COMBO_BOX(b), index);
++#endif
++ }
+--- gmerlin.orig/lib/gtk/driveselect.c
++++ gmerlin/lib/gtk/driveselect.c
+@@ -67,7 +67,7 @@ static void plugin_change_callback(bg_gt
+ ds = (bg_gtk_drivesel_t*)data;
+
+ for(i = 0; i < ds->num_drives; i++)
+- gtk_combo_box_remove_text(GTK_COMBO_BOX(ds->drive_menu), 0);
++ bg_gtk_combo_box_remove_text(ds->drive_menu, 0);
+
+
+
+@@ -80,11 +80,11 @@ static void plugin_change_callback(bg_gt
+ while(devices[ds->num_drives].device)
+ {
+ if(devices[ds->num_drives].name)
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ds->drive_menu),
+- devices[ds->num_drives].name);
++ bg_gtk_combo_box_append_text(ds->drive_menu,
++ devices[ds->num_drives].name);
+ else
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ds->drive_menu),
+- devices[ds->num_drives].device);
++ bg_gtk_combo_box_append_text(ds->drive_menu,
++ devices[ds->num_drives].device);
+ ds->num_drives++;
+ }
+ /* Select first entry */
+@@ -176,7 +176,7 @@ bg_gtk_drivesel_create(const char * titl
+
+ /* Create device menu */
+
+- ret->drive_menu = gtk_combo_box_new_text();
++ ret->drive_menu = bg_gtk_combo_box_new_text();
+ gtk_widget_show(ret->drive_menu);
+
+ /* Create plugin menu */
+--- gmerlin.orig/include/gui_gtk/gtkutils.h
++++ gmerlin/include/gui_gtk/gtkutils.h
+@@ -61,3 +61,8 @@ GtkWidget * bg_gtk_get_toplevel(GtkWidge
+
+ int bg_gtk_widget_is_realized(GtkWidget * w);
+ int bg_gtk_widget_is_toplevel(GtkWidget * w);
++
++GtkWidget * bg_gtk_combo_box_new_text();
++void bg_gtk_combo_box_append_text(GtkWidget *combo_box, const gchar *text);
++void bg_gtk_combo_box_remove_text(GtkWidget * b, int index);
++
+--- gmerlin.orig/apps/alsamixer/g_control.c
++++ gmerlin/apps/alsamixer/g_control.c
+@@ -29,7 +29,7 @@
+ #define LOG_DOMAIN "g_control"
+
+ #include <gui_gtk/aboutwindow.h>
+-
++#include <gui_gtk/gtkutils.h>
+
+ #if GTK_MINOR_VERSION >= 4
+ #define GTK_2_4
+@@ -457,8 +457,6 @@ static void init_array(widget_array_t *
+ gtk_widget_set_size_request(ret->widgets[i].w, req_width, SLIDER_HEIGHT);
+
+ gtk_range_set_inverted(GTK_RANGE(ret->widgets[i].w), TRUE);
+- gtk_range_set_update_policy(GTK_RANGE(ret->widgets[i].w),
+- GTK_UPDATE_CONTINUOUS);
+
+ ret->widgets[i].id = g_signal_connect(G_OBJECT(ret->widgets[i].w),
+ "value_changed",
+@@ -493,8 +491,6 @@ static void init_array(widget_array_t *
+ gtk_widget_set_size_request(ret->widgets[i].w, req_width, SLIDER_HEIGHT);
+
+ gtk_range_set_inverted(GTK_RANGE(ret->widgets[i].w), TRUE);
+- gtk_range_set_update_policy(GTK_RANGE(ret->widgets[i].w),
+- GTK_UPDATE_CONTINUOUS);
+
+ ret->widgets[i].id = g_signal_connect(G_OBJECT(ret->widgets[i].w),
+ "value_changed",
+@@ -529,14 +525,14 @@ static void init_array(widget_array_t *
+ for(i = 0; i < ret->num; i++)
+ {
+ #ifdef GTK_2_4
+- ret->widgets[i].w = gtk_combo_box_new_text();
++ ret->widgets[i].w = bg_gtk_combo_box_new_text();
+ ret->widgets[i].handler_widget = ret->widgets[i].w;
+
+ for(j = 0; j < num_items; j++)
+ {
+ snd_ctl_elem_info_set_item(info,j);
+ snd_hctl_elem_info(hctl,info);
+- gtk_combo_box_append_text(GTK_COMBO_BOX(ret->widgets[i].w),
++ bg_gtk_combo_box_append_text(ret->widgets[i].w,
+ snd_ctl_elem_info_get_item_name(info));
+ }
+ ret->widgets[i].id =
diff --git a/debian/patches/series b/debian/patches/series
index ecd25c1..01f1667 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ underlinking.patch
gmerlin_visualizer_slave.patch
fix_typos.patch
binutils_gold.patch
+fix_ftbfs_gtk_2.24.patch
--
gmerlin packaging
More information about the pkg-multimedia-commits
mailing list