aboutsummaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/cross.patch14
-rw-r--r--debian/patches/debian-changes-0.6-1.1.patch163
-rw-r--r--debian/patches/dont-forcibly-strip.patch15
-rw-r--r--debian/patches/drop-extra-deps.patch13
-rw-r--r--debian/patches/fix-for-dh.patch20
-rw-r--r--debian/patches/replace-deprecated-gtk.patch63
-rw-r--r--debian/patches/respect-dpkg-buildflags.patch26
-rw-r--r--debian/patches/series10
-rw-r--r--debian/patches/show-us-flag.patch14
-rw-r--r--debian/patches/spelling.patch37
-rw-r--r--debian/patches/use-g_strdup.patch25
11 files changed, 400 insertions, 0 deletions
diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 0000000..15575ea
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,14 @@
+--- fbxkb-0.6.orig/Makefile.common
++++ fbxkb-0.6/Makefile.common
+@@ -20,8 +20,9 @@
+ endif
+
+ CC = gcc
+-LIBS = -lX11 $(shell pkg-config --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -L/usr/X11R6/lib -lXmu
+-INCS = $(shell pkg-config --cflags gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0)
++PKG_CONFIG ?= pkg-config
++LIBS = -lX11 $(shell $(PKG_CONFIG) --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -L/usr/X11R6/lib -lXmu
++INCS = $(shell $(PKG_CONFIG) --cflags gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0)
+ CFLAGS ?= -O2 # overwriten by command line or env. variable
+ CFLAGS += -Wall # always nice to have
+ ifneq (,$(DEVEL))
diff --git a/debian/patches/debian-changes-0.6-1.1.patch b/debian/patches/debian-changes-0.6-1.1.patch
new file mode 100644
index 0000000..44046ed
--- /dev/null
+++ b/debian/patches/debian-changes-0.6-1.1.patch
@@ -0,0 +1,163 @@
+Description: changes in version 0.6-1.1
+ * Non-maintainer upload. (Patch by Mònica Ramírez Arceda <monica@probeta.net>)
+ * eggtrayicon.c, fbxkb.c: Replace deprecated gdk_display and GDK_DISPLAY()
+ with gdk_x11_get_default_xdisplay().
+ * Link to X11 to build with binutils-gold. (Closes: #554280)
+Author: Konstantinos Margaritis <markos@debian.org>
+Bug-Debian: https://bugs.debian.org/554280
+--- fbxkb-0.6.orig/fbxkb.c
++++ fbxkb-0.6/fbxkb.c
+@@ -456,7 +456,7 @@ init()
+
+ ENTER;
+ sym2pix = g_hash_table_new(g_str_hash, (GEqualFunc) my_str_equal);
+- dpy = GDK_DISPLAY();
++ dpy = gdk_x11_get_default_xdisplay();
+ a_XKB_RULES_NAMES = XInternAtom(dpy, "_XKB_RULES_NAMES", False);
+ if (a_XKB_RULES_NAMES == None)
+ ERR("_XKB_RULES_NAMES - can't get this atom\n");
+@@ -536,7 +536,7 @@ Xerror_handler(Display * d, XErrorEvent
+ char buf[256];
+
+ ENTER;
+- XGetErrorText(GDK_DISPLAY(), ev->error_code, buf, 256);
++ XGetErrorText(gdk_x11_get_default_xdisplay(), ev->error_code, buf, 256);
+ ERR( "fbxkb : X error: %s\n", buf);
+ RET();
+ }
+--- fbxkb-0.6.orig/eggtrayicon.c
++++ fbxkb-0.6/eggtrayicon.c
+@@ -153,7 +153,7 @@ egg_tray_icon_send_manager_message (EggT
+ #if HAVE_GTK_MULTIHEAD
+ display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
+ #else
+- display = gdk_display;
++ display = gdk_x11_get_default_xdisplay();
+ #endif
+
+ gdk_error_trap_push ();
+@@ -181,7 +181,7 @@ egg_tray_icon_update_manager_window (Egg
+ #if HAVE_GTK_MULTIHEAD
+ xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
+ #else
+- xdisplay = gdk_display;
++ xdisplay = gdk_x11_get_default_xdisplay();
+ #endif
+
+ if (icon->manager_window != None)
+@@ -300,7 +300,7 @@ egg_tray_icon_new_for_screen (GdkScreen
+ EggTrayIcon*
+ egg_tray_icon_new (const gchar *name)
+ {
+- return egg_tray_icon_new_for_xscreen (DefaultScreenOfDisplay (gdk_display), name);
++ return egg_tray_icon_new_for_xscreen (DefaultScreenOfDisplay (gdk_x11_get_default_xdisplay()), name);
+ }
+
+ guint
+@@ -338,7 +338,7 @@ egg_tray_icon_send_message (EggTrayIcon
+ #if HAVE_GTK_MULTIHEAD
+ xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
+ #else
+- xdisplay = gdk_display;
++ xdisplay = gdk_x11_get_default_xdisplay();
+ #endif
+
+ ev.type = ClientMessage;
+--- fbxkb-0.6.orig/man/Makefile
++++ fbxkb-0.6/man/Makefile
+@@ -20,9 +20,8 @@ clean:
+
+
+ install: all
+-# install -d $(PREFIX)/share/man/man1
+-# install -m 644 $(TARGET) $(PREFIX)/share/man/man1
++ install -d $(PREFIX)/share/man/man1
++ install -m 644 $(TARGET) $(PREFIX)/share/man/man1
+
+ uninstall:
+-# rm -f $(PREFIX)/share/man/man1/$(TARGET)
+-
++ rm -f $(PREFIX)/share/man/man1/$(TARGET)
+--- fbxkb-0.6.orig/man/fbxkb.1
++++ fbxkb-0.6/man/fbxkb.1
+@@ -1,70 +1,25 @@
+ .\" man page originally for the Debian/GNU Linux system
+-.TH FBPANEL "1" "February 2004" "fbxkb 2.2" "User Commands"
++.TH FBXKB "1" "January 2007" "fbxkb 0.6" "User Commands"
+ .SH NAME
+-fbxkb \- a lightweight GTK2-based panel for UNIX desktop.
++fbxkb \- a lightweight X11 keyboard switcher.
+ .SH SYNOPSIS
+ .B fbxkb
+-[\fIOPTION\fR]
+ .br
+ .SH DESCRIPTION
+ .PP
+-fbxkb is desktop panel which provides graphical information and feedback about
+-desktop activity and allows interaction with the window manager.
+-It features:
+-.HP
+-\(bu taskbar \- shows a list of the managed windows (tasks)
+-.HP
+-\(bu pager \- thumbnailed view of the desktop.
+-.HP
+-\(bu launchbar \- buttons to quickly launch applications
+-.HP
+-\(bu show desktop \- button to iconify or shade all windows
+-.HP
+-\(bu image \- display an image
+-.HP
+-\(bu clock \- show the current time and/or date
+-.HP
+-\(bu system tray \- tray for XEMBED icons (aka docklets)
+-.PP
+-fbxkb requires NETWM (www.freedesktop.org) compliant window manager.
+-You can run many instances of fbxkb each with its own configuration
+-(see \fBOPTIONS\fR below).
++fbxkb is X11 keyboard switcher, which provides visual information
++about current keyboard. It shows a flag of current keyboard in a
++systray area and allows you to switch to another one.
++
++fbxkb requires NETWM (www.freedesktop.org) compliant window manager.
++It's written in C and uses the GTK+-2.4 library only (no GNOME is needed).
+
+ Most updated info about fbxkb can be found on its home page:
+ http://fbxkb.sf.net/
+-
+ .SH OPTIONS
+ .TP
+-\fB\-h\fR
+-\- print help message and exit.
+-.TP
+-\fB\-v\fR
+-\- print version and exit.
+-.TP
+-\fB\-p <name>\fR
+-\- use the profile <name>. The profile is loaded from the file ~/.fbxkb/<name>.
+-If that fails, fbxkb will load PREFIX/share/fbxkb/<name>. No \fB\-p\fR option is equivalent
+-to \fB\-p default\fR
+-.SH CUSTOMIZATION
+-To change default settings, copy profile file to your home directory
+-.br
+- mkdir -p ~/.fbxkb
+- cp PREFIX/share/fbxkb/default ~/.fbxkb
+-.br
+-and edit it. Default profile file contains comments and explanation inside,
+-so it should be easy. For full list of options please visit fbxkb's home page.
+-
+-.SH FILES
+-.TP
+-PREFIX/share/fbxkb
+-Directory with system-wide resources and default settings
+-.TP
+-~/.fbxkb/
+-Directory with the user's private profiles
+-.TP
+-~/.fbxkb/default
+-The user's default profile.
++fbxkb hasn't options. It just works.
+ .SH AUTHOR
+ fbxkb was written by Anatoly Asviyan <aanatoly@users.sf.net>.
+ This manual page was originally written for the
+-Debian GNU/Linux system by Shyamal Prasad <shyamal@member.fsf.org>.
++Debian GNU/Linux system by Vadim Vatlin <vatlin@sthbel.ru>.
diff --git a/debian/patches/dont-forcibly-strip.patch b/debian/patches/dont-forcibly-strip.patch
new file mode 100644
index 0000000..c8b509b
--- /dev/null
+++ b/debian/patches/dont-forcibly-strip.patch
@@ -0,0 +1,15 @@
+Descrpition: Don't strip fbxkb binary in Makefile, let dh_strip do this
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+Bug-Debian: https://bugs.debian.org/436824
+--- a/Makefile
++++ b/Makefile
+@@ -31,9 +31,6 @@
+ TARGET = fbxkb
+ $(TARGET): $(OBJ)
+ $(CC) $(LDFLAGS) $(LIBS) $(OBJ) -o $@
+-ifeq (,$(DEVEL))
+- strip $@
+-endif
+
+ all: $(TARGET)
+
diff --git a/debian/patches/drop-extra-deps.patch b/debian/patches/drop-extra-deps.patch
new file mode 100644
index 0000000..4c3957e
--- /dev/null
+++ b/debian/patches/drop-extra-deps.patch
@@ -0,0 +1,13 @@
+Description: use --as-needed linker flag to avoid unnecessary dependencies
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/Makefile
++++ b/Makefile
+@@ -30,7 +30,7 @@
+
+ TARGET = fbxkb
+ $(TARGET): $(OBJ)
+- $(CC) $(LDFLAGS) $(LIBS) $(OBJ) -o $@
++ $(CC) $(LDFLAGS) $(OBJ) -Wl,--as-needed $(LIBS) -o $@
+
+ all: $(TARGET)
+
diff --git a/debian/patches/fix-for-dh.patch b/debian/patches/fix-for-dh.patch
new file mode 100644
index 0000000..7bafad2
--- /dev/null
+++ b/debian/patches/fix-for-dh.patch
@@ -0,0 +1,20 @@
+Description: some fixes to make it work with default debian/rules
+ Adjust PREFIX if DESTDIR is defined - for dh_install* to work correctly
+ Linker option -lX11 moved here from debian/rules
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/Makefile.common
++++ b/Makefile.common
+@@ -15,8 +15,12 @@
+ endif
+ endif
+
++ifdef DESTDIR
++PREFIX := $(DESTDIR)/$(PREFIX)
++endif
++
+ CC = gcc
+-LIBS = $(shell pkg-config --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -L/usr/X11R6/lib -lXmu
++LIBS = -lX11 $(shell pkg-config --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -L/usr/X11R6/lib -lXmu
+ INCS = $(shell pkg-config --cflags gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0)
+ CFLAGS ?= -O2 # overwriten by command line or env. variable
+ CFLAGS += -Wall # always nice to have
diff --git a/debian/patches/replace-deprecated-gtk.patch b/debian/patches/replace-deprecated-gtk.patch
new file mode 100644
index 0000000..e4a2f15
--- /dev/null
+++ b/debian/patches/replace-deprecated-gtk.patch
@@ -0,0 +1,63 @@
+Description: Remove deprecated GTK functions
+ Remove gtk_set_locale() and change gdk_window_lookup() to gdk_x11_window_lookup_for_display().
+ Fixes "pointer-trouble-at-implicit" and "pointer-from-integer" warnings.
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/eggtrayicon.c
++++ b/eggtrayicon.c
+@@ -111,7 +111,7 @@
+ gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (widget),
+ icon->manager_window);
+ #else
+- gdkwin = gdk_window_lookup (icon->manager_window);
++ gdkwin = gdk_x11_window_lookup_for_display (gdk_display_get_default(), icon->manager_window);
+ #endif
+
+ gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
+@@ -120,7 +120,7 @@
+ #if HAVE_GTK_MULTIHEAD
+ root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
+ #else
+- root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
++ root_window = gdk_x11_window_lookup_for_display (gdk_display_get_default(), gdk_x11_get_default_root_xwindow ());
+ #endif
+
+ gdk_window_remove_filter (root_window, egg_tray_icon_manager_filter, icon);
+@@ -192,7 +192,7 @@
+ gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
+ icon->manager_window);
+ #else
+- gdkwin = gdk_window_lookup (icon->manager_window);
++ gdkwin = gdk_x11_window_lookup_for_display (gdk_display_get_default(), icon->manager_window);
+ #endif
+
+ gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
+@@ -218,7 +218,7 @@
+ gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
+ icon->manager_window);
+ #else
+- gdkwin = gdk_window_lookup (icon->manager_window);
++ gdkwin = gdk_x11_window_lookup_for_display (gdk_display_get_default(), icon->manager_window);
+ #endif
+
+ gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
+@@ -274,7 +274,7 @@
+ #if HAVE_GTK_MULTIHEAD
+ root_window = gdk_screen_get_root_window (gtk_widget_get_screen (screen));
+ #else
+- root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
++ root_window = gdk_x11_window_lookup_for_display (gdk_display_get_default(), gdk_x11_get_default_root_xwindow ());
+ #endif
+
+ /* Add a root window filter so that we get changes on MANAGER */
+--- a/fbxkb.c
++++ b/fbxkb.c
+@@ -510,8 +510,7 @@
+ main(int argc, char *argv[], char *env[])
+ {
+ ENTER;
+- setlocale(LC_CTYPE, "");
+- gtk_set_locale();
++ setlocale(LC_ALL, "");
+ gtk_init(&argc, &argv);
+ XSetLocaleModifiers("");
+ XSetErrorHandler((XErrorHandler) Xerror_handler);
diff --git a/debian/patches/respect-dpkg-buildflags.patch b/debian/patches/respect-dpkg-buildflags.patch
new file mode 100644
index 0000000..f972fbd
--- /dev/null
+++ b/debian/patches/respect-dpkg-buildflags.patch
@@ -0,0 +1,26 @@
+Description: Respect default {C,CPP}FLAGS from dpkg-buildflags
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/Makefile.common
++++ b/Makefile.common
+@@ -18,7 +18,7 @@
+ CC = gcc
+ LIBS = $(shell pkg-config --libs gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0) -L/usr/X11R6/lib -lXmu
+ INCS = $(shell pkg-config --cflags gtk+-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0)
+-CFLAGS = -O2 # overwriten by command line or env. variable
++CFLAGS ?= -O2 # overwriten by command line or env. variable
+ CFLAGS += -Wall # always nice to have
+ ifneq (,$(DEVEL))
+ CFLAGS := -g -Wall
+@@ -28,10 +28,10 @@
+ CFLAGS += -g -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
+
+ %.o: %.c
+- $(CC) $(CFLAGS) $(INCS) -c $<
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -c $<
+
+ %.dep: %.c
+- $(CC) $(CFLAGS) $(INCS) -MM $< -o $@
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCS) -MM $< -o $@
+
+ .PHONY: all clean distclean install uninstall
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..57e85e0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,10 @@
+debian-changes-0.6-1.1.patch
+show-us-flag.patch
+use-g_strdup.patch
+replace-deprecated-gtk.patch
+spelling.patch
+dont-forcibly-strip.patch
+respect-dpkg-buildflags.patch
+drop-extra-deps.patch
+fix-for-dh.patch
+cross.patch
diff --git a/debian/patches/show-us-flag.patch b/debian/patches/show-us-flag.patch
new file mode 100644
index 0000000..5c86190
--- /dev/null
+++ b/debian/patches/show-us-flag.patch
@@ -0,0 +1,14 @@
+Description: Fix parsing of keyboard info, to show proper "us" flag
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+Bug-Debian: https://bugs.debian.org/412254
+--- a/fbxkb.c
++++ b/fbxkb.c
+@@ -372,7 +372,7 @@
+ *tmp = 0;
+
+ DBG("map=%s no=%d\n", tok, no);
+- if (!strcmp(tok, "pc") || !strcmp(tok, "group"))
++ if (!strcmp(tok, "pc") || (strlen(tok) != 2))
+ continue;
+
+ g_assert((no >= 0) && (no < ngroups));
diff --git a/debian/patches/spelling.patch b/debian/patches/spelling.patch
new file mode 100644
index 0000000..343cba3
--- /dev/null
+++ b/debian/patches/spelling.patch
@@ -0,0 +1,37 @@
+Description: Correct spelling
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/fbxkb.c
++++ b/fbxkb.c
+@@ -40,7 +40,7 @@
+
+ #define IMGPREFIX PREFIX "/share/fbxkb/images/"
+ /******************************************************************
+- * GLOBAL VARSIABLES *
++ * GLOBAL VARIABLES *
+ ******************************************************************/
+
+ /* X11 common stuff */
+@@ -48,7 +48,7 @@
+ static Display *dpy;
+ static int xkb_event_type;
+
+-/* internal state mashine */
++/* internal state machine */
+ static int cur_group;
+ static int ngroups;
+ static GHashTable *sym2pix;
+@@ -383,11 +383,11 @@
+ }
+ out:
+ XkbFreeKeyboard(kbd_desc_ptr, 0, True);
+- // sanity check: group numbering must be continous
++ // sanity check: group numbering must be continuous
+ for (i = 0; (i < XkbNumKbdGroups) && (group2info[i].sym != NULL); i++);
+ if (i != ngroups) {
+- ERR("kbd group numbering is not continous\n");
+- ERR("run 'xlsatoms | grep pc' to know what hapends\n");
++ ERR("kbd group numbering is not continuous\n");
++ ERR("run 'xlsatoms | grep pc' to know what happens\n");
+ exit(1);
+ }
+ out_us:
diff --git a/debian/patches/use-g_strdup.patch b/debian/patches/use-g_strdup.patch
new file mode 100644
index 0000000..9651da2
--- /dev/null
+++ b/debian/patches/use-g_strdup.patch
@@ -0,0 +1,25 @@
+Description: Use g_strdup() to pass strings to g_hash_table_insert()
+ Otherwise use-after-free happens soon.
+Author: Dmitry Borisyuk <q1werty@i.com.ua>
+--- a/fbxkb.c
++++ b/fbxkb.c
+@@ -266,7 +266,6 @@
+ {
+ GdkPixbuf *flag;
+ static GString *s = NULL;
+- char tmp[3];
+
+ ENTER;
+ g_assert(sym != NULL && strlen(sym) > 1);
+@@ -281,10 +280,7 @@
+ flag = gdk_pixbuf_new_from_file_at_size(s->str, 24, 24, NULL);
+ if (!flag)
+ RET(zzflag);
+- tmp[0] = sym[0];
+- tmp[1] = sym[1];
+- tmp[2] = 0;
+- g_hash_table_insert(sym2pix, tmp, flag);
++ g_hash_table_insert(sym2pix, g_strdup(sym), flag);
+ RET(flag);
+ }
+
bgstack15