diff options
author | Benjamin Staffin <ben@folsomlabs.com> | 2015-02-08 17:06:13 -0800 |
---|---|---|
committer | Benjamin Staffin <ben@folsomlabs.com> | 2015-02-09 01:36:01 -0800 |
commit | ea446390fad344509abe3ed2e740aa7dcc47d296 (patch) | |
tree | 2c53e83da68cd045fb5230f6e7d7fd1cf2de15fd /pkgs/tools/X11 | |
parent | da8ab2d9474bc01ac79743887c5041bfbc5452d1 (diff) | |
download | nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar.gz nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar.bz2 nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar.lz nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar.xz nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.tar.zst nixlib-ea446390fad344509abe3ed2e740aa7dcc47d296.zip |
New package: xbindkeys-config
The patch is borrowed verbatim from Debian. It is under the same license as the rest of the package, and is necessary for the app to work. There does not seem to be a canonical upstream homepage for this app other than Debian itself. Change-Id: I4f0bec32a95778fb12a48bfb280386b65a0d0f9a
Diffstat (limited to 'pkgs/tools/X11')
-rw-r--r-- | pkgs/tools/X11/xbindkeys-config/default.nix | 35 | ||||
-rw-r--r-- | pkgs/tools/X11/xbindkeys-config/xbindkeys-config-patch1.patch | 108 | ||||
-rw-r--r-- | pkgs/tools/X11/xbindkeys-config/xbindkeys-config.1 | 21 |
3 files changed, 164 insertions, 0 deletions
diff --git a/pkgs/tools/X11/xbindkeys-config/default.nix b/pkgs/tools/X11/xbindkeys-config/default.nix new file mode 100644 index 000000000000..57d8d82759ce --- /dev/null +++ b/pkgs/tools/X11/xbindkeys-config/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchurl, libX11, gtk, pkgconfig, procps, makeWrapper, ... }: + +stdenv.mkDerivation rec { + name = "xbindkeys-config-${version}"; + version = "0.1.3"; + + buildInputs = [ gtk pkgconfig makeWrapper ]; + + src = fetchurl { + url = "mirror://debian/pool/main/x/xbindkeys-config/xbindkeys-config_${version}.orig.tar.gz"; + sha256 = "1rs3li2hyig6cdzvgqlbz0vw6x7rmgr59qd6m0cvrai8xhqqykda"; + }; + + meta = { + homepage = https://packages.debian.org/source/xbindkeys-config; + description = "Graphical interface for configuring xbindkeys"; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = with stdenv.lib.maintainers; [benley]; + platforms = with stdenv.lib.platforms; linux; + }; + + patches = [ ./xbindkeys-config-patch1.patch ]; + + # killall is dangerous on non-gnu platforms. Use pkill instead. + postPatch = '' + substituteInPlace middle.c --replace "killall" "pkill -x" + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/man/man1 + gzip -c ${./xbindkeys-config.1} > $out/share/man/man1/xbindkeys-config.1.gz + cp xbindkeys_config $out/bin/xbindkeys-config + wrapProgram $out/bin/xbindkeys-config --prefix PATH ":" "${procps}/bin" + ''; +} diff --git a/pkgs/tools/X11/xbindkeys-config/xbindkeys-config-patch1.patch b/pkgs/tools/X11/xbindkeys-config/xbindkeys-config-patch1.patch new file mode 100644 index 000000000000..d4620b5d9071 --- /dev/null +++ b/pkgs/tools/X11/xbindkeys-config/xbindkeys-config-patch1.patch @@ -0,0 +1,108 @@ +--- + Makefile | 6 +++--- + menu.c | 11 ++++++++--- + middle.c | 9 +++++++-- + xbindkeys_config.c | 3 ++- + 4 files changed, 20 insertions(+), 9 deletions(-) + +diff --git a/Makefile b/Makefile +index 602875c..28e46cd 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,9 +1,9 @@ + # makefile crée par Laurent VUIBERT + +-CC= gcc -O3 -Wall ++CC= gcc $(CFLAGS) + STD= _GNU_SOURCE +-GTK= `gtk-config --cflags --libs` +-GTK2= `gtk-config --cflags` ++GTK= `pkg-config --cflags --libs gtk+-2.0` ++GTK2= `pkg-config --cflags gtk+-2.0` + OBJS= xbindkeys_config.o menu.o middle.o speedc.o + NOM= xbindkeys_config + +diff --git a/menu.c b/menu.c +index ed3e7ec..f11526d 100644 +--- a/menu.c ++++ b/menu.c +@@ -283,6 +283,8 @@ void menu_manual (GtkMenuItem *menuitem, gpointer user_data) + GtkWidget *window; + GtkWidget *text; + GtkWidget *vbox; ++ GtkTextBuffer *textbuffer; ++ GtkTextIter iter; + + window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + gtk_window_set_title(GTK_WINDOW(window), +@@ -293,10 +295,13 @@ void menu_manual (GtkMenuItem *menuitem, gpointer user_data) + text = gtk_label_new("\nManual\n"); + gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, FALSE, 0); + +- text = gtk_text_new(NULL,NULL); ++/* BDD - FIXME */ ++/* text = gtk_text_new(NULL,NULL); */ ++ text = gtk_text_view_new(); ++ textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); ++ gtk_text_buffer_get_iter_at_offset (textbuffer, &iter, 0); + +- +- gtk_text_insert (GTK_TEXT(text), NULL, NULL, NULL, ++ gtk_text_buffer_insert (textbuffer, &iter, + MANUAL_TEXT, sizeof(MANUAL_TEXT)-1); + gtk_box_pack_start(GTK_BOX(vbox), text, TRUE, TRUE, 0); + gtk_widget_set_usize(text,300,250); +diff --git a/middle.c b/middle.c +index daa61aa..605ab10 100644 +--- a/middle.c ++++ b/middle.c +@@ -551,6 +551,8 @@ void view_generated_file() + GtkWidget *window; + GtkWidget *text; + GtkWidget *src; ++ GtkTextBuffer *textbuffer; ++ GtkTextIter iter; + char line [1024]; + + unlink(TEMP_FILE); +@@ -561,11 +563,13 @@ void view_generated_file() + gtk_window_set_title(GTK_WINDOW(window), "Generated File"); + src = gtk_scrolled_window_new ( NULL, NULL ); + gtk_widget_set_usize(src,500,400); +- text = gtk_text_new (NULL, NULL); ++ text = gtk_text_view_new (); ++ textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); ++ gtk_text_buffer_get_iter_at_offset (textbuffer, &iter, 0); + gtk_container_add (GTK_CONTAINER(src), text); + + while (fgets (line, sizeof(line), f)) +- gtk_text_insert (GTK_TEXT(text), NULL, NULL, NULL, ++ gtk_text_buffer_insert (textbuffer, &iter, + line, strlen(line)); + + gtk_container_add(GTK_CONTAINER(window),src); +@@ -610,6 +614,7 @@ void save_file(char file_out[]) + fprintf(f, "# m:xxx + c:xxx \n"); + fprintf(f, "# Shift+... \n\n\n\n\n"); + ++ + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Flag_NumLock))) + fprintf(f,"keystate_numlock = enable\n"); + else +diff --git a/xbindkeys_config.c b/xbindkeys_config.c +index 75bad30..3c02a2b 100644 +--- a/xbindkeys_config.c ++++ b/xbindkeys_config.c +@@ -95,7 +95,8 @@ int main (int argc, char *argv[]) + accel_group = gtk_accel_group_new(); + menu=xbindkeys_config_menu(accel_group); + gtk_box_pack_start(GTK_BOX(vbox),menu,FALSE,FALSE,0); +- gtk_accel_group_attach(accel_group, GTK_OBJECT(window)); ++/* BDD - FIXME - Don't need this? */ ++/* gtk_accel_group_attach(accel_group, GTK_OBJECT(window)); */ + + middle= xbindkeys_config_middle(); + gtk_box_pack_start(GTK_BOX(vbox),middle,TRUE,TRUE,0); +-- +2.1.3 + diff --git a/pkgs/tools/X11/xbindkeys-config/xbindkeys-config.1 b/pkgs/tools/X11/xbindkeys-config/xbindkeys-config.1 new file mode 100644 index 000000000000..e3f8de1a8046 --- /dev/null +++ b/pkgs/tools/X11/xbindkeys-config/xbindkeys-config.1 @@ -0,0 +1,21 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27. +.TH XBINDKEYS_CONFIG "1" "April 2002" "xbindkeys-config" "User Commands" +.SH NAME +xbindkeys-config \- GTK+ configuration tool for xbindkeys +.SH "SYNOPSIS" +xbindkeys-config +[\-\-file|\-f file] +[\-\-help|\-h] +[\-\-show|\-s] +.TP +\fB\-h\fR, \fB\-\-help\fR +This Help +.TP +\fB\-f\fR, \fB\-\-file\fR +Use an alternative rc file +.TP +\fB\-s\fR, \fB\-\-show\fR +show only the rc file +.SH AUTHOR +This manual page was written by Joerg Jaspert <joerg@debian.org>, +for the Debian GNU/Linux system (but may be used by others). |