From ea446390fad344509abe3ed2e740aa7dcc47d296 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Sun, 8 Feb 2015 17:06:13 -0800 Subject: [PATCH] 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 --- lib/maintainers.nix | 1 + pkgs/tools/X11/xbindkeys-config/default.nix | 35 ++++++ .../xbindkeys-config-patch1.patch | 108 ++++++++++++++++++ .../X11/xbindkeys-config/xbindkeys-config.1 | 21 ++++ pkgs/top-level/all-packages.nix | 4 + 5 files changed, 169 insertions(+) create mode 100644 pkgs/tools/X11/xbindkeys-config/default.nix create mode 100644 pkgs/tools/X11/xbindkeys-config/xbindkeys-config-patch1.patch create mode 100644 pkgs/tools/X11/xbindkeys-config/xbindkeys-config.1 diff --git a/lib/maintainers.nix b/lib/maintainers.nix index c63536abd69b..2d18d592e893 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -28,6 +28,7 @@ bbenoist = "Baptist BENOIST "; bdimcheff = "Brandon Dimcheff "; bennofs = "Benno Fünfstück "; + benley = "Benjamin Staffin "; berdario = "Dario Bertini "; bergey = "Daniel Bergey "; bjg = "Brian Gough "; 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 , +for the Debian GNU/Linux system (but may be used by others). diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 48fb148ec19e..2e5057f103dc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11798,6 +11798,10 @@ let xbindkeys = callPackage ../tools/X11/xbindkeys { }; + xbindkeys-config = callPackage ../tools/X11/xbindkeys-config/default.nix { + gtk = gtk2; + }; + xbmcPlain = callPackage ../applications/video/xbmc { ffmpeg = ffmpeg_1; };