wok rev 18948

libnotify: patch to print and replace id
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 04 17:37:01 2016 +0200 (2016-03-04)
parents 278af74ed921
children e0a322a2f200
files libnotify/description.txt libnotify/receipt libnotify/stuff/print-and-replace-id-v3.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libnotify/description.txt	Fri Mar 04 17:37:01 2016 +0200
     1.3 @@ -0,0 +1,11 @@
     1.4 +libnotify implements a standard for a desktop notifications service, through
     1.5 +which applications can generate passive popups to notify the user in an
     1.6 +asynchronous manner of events.
     1.7 +
     1.8 +Example use cases include:
     1.9 +
    1.10 +  * Messages from chat programs
    1.11 +  * Scheduled alarm
    1.12 +  * Completed file transfer
    1.13 +  * New mail notification
    1.14 +  * Low disk space/battery warnings
     2.1 --- a/libnotify/receipt	Thu Mar 03 23:30:14 2016 +0200
     2.2 +++ b/libnotify/receipt	Fri Mar 04 17:37:01 2016 +0200
     2.3 @@ -22,7 +22,8 @@
     2.4  # Rules to configure and make the package.
     2.5  compile_rules()
     2.6  {
     2.7 -	cd $src
     2.8 +	patch -p1 -i $stuff/print-and-replace-id-v3.patch
     2.9 +
    2.10  	sed -e 's/REQ_GTK_VERSION=2.90/REQ_GTK_VERSION=2.24/' \
    2.11  	-e 's/tests_modules="gtk+-3.0 >= $REQ_GTK_VERSION"/tests_modules="gtk+-2.0 >= $REQ_GTK_VERSION"/' \
    2.12  	-i configure
    2.13 @@ -35,7 +36,7 @@
    2.14  # Rules to gen a SliTaz package suitable for Tazpkg.
    2.15  genpkg_rules()
    2.16  {
    2.17 -    mkdir -p $fs/usr/lib
    2.18 -    cp -a $install/usr/bin $fs/usr
    2.19 -    cp -a $install/usr/lib/*.so* $fs/usr/lib
    2.20 +	mkdir -p $fs/usr/lib
    2.21 +	cp -a $install/usr/bin $fs/usr
    2.22 +	cp -a $install/usr/lib/*.so* $fs/usr/lib
    2.23  }
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libnotify/stuff/print-and-replace-id-v3.patch	Fri Mar 04 17:37:01 2016 +0200
     3.3 @@ -0,0 +1,50 @@
     3.4 +https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/257135/comments/10
     3.5 +https://launchpadlibrarian.net/105791133/print-and-replace-id-v3.patch
     3.6 +
     3.7 +Index: libnotify-0.7.5/tools/notify-send.c
     3.8 +===================================================================
     3.9 +--- libnotify-0.7.5.orig/tools/notify-send.c	2011-10-14 11:24:15.000000000 +1300
    3.10 ++++ libnotify-0.7.5/tools/notify-send.c	2012-05-22 22:15:43.370979671 +1200
    3.11 +@@ -130,6 +130,8 @@
    3.12 +         static char        *icons = NULL;
    3.13 +         static char       **n_text = NULL;
    3.14 +         static char       **hints = NULL;
    3.15 ++        static gboolean     print_id = FALSE;
    3.16 ++        static gint         replace_id = 0;
    3.17 +         static gboolean     do_version = FALSE;
    3.18 +         static gboolean     hint_error = FALSE;
    3.19 +         static glong        expire_timeout = NOTIFY_EXPIRES_DEFAULT;
    3.20 +@@ -159,6 +161,10 @@
    3.21 +                  N_
    3.22 +                  ("Specifies basic extra data to pass. Valid types are int, double, string and byte."),
    3.23 +                  N_("TYPE:NAME:VALUE")},
    3.24 ++                {"print-id", 'p', 0, G_OPTION_ARG_NONE, &print_id,
    3.25 ++                 N_ ("Print the notification ID."), NULL},
    3.26 ++                {"replace-id", 'r', 0, G_OPTION_ARG_INT, &replace_id,
    3.27 ++                 N_ ("The ID of the notification to replace."), N_("REPLACE_ID")},
    3.28 +                 {"version", 'v', 0, G_OPTION_ARG_NONE, &do_version,
    3.29 +                  N_("Version of the package."),
    3.30 +                  NULL},
    3.31 +@@ -233,6 +239,9 @@
    3.32 + 
    3.33 +         g_free (body);
    3.34 + 
    3.35 ++        if (replace_id)
    3.36 ++                g_object_set (notify, "id", replace_id, NULL);
    3.37 ++
    3.38 +         /* Set hints */
    3.39 +         if (hints != NULL) {
    3.40 +                 gint            i = 0;
    3.41 +@@ -272,6 +281,12 @@
    3.42 +         if (!hint_error)
    3.43 +                 notify_notification_show (notify, NULL);
    3.44 + 
    3.45 ++        if (print_id) {
    3.46 ++                gint id;
    3.47 ++                g_object_get (notify, "id", &id, NULL);
    3.48 ++                g_printf ("%d\n", id);
    3.49 ++        }
    3.50 ++
    3.51 +         g_object_unref (G_OBJECT (notify));
    3.52 + 
    3.53 +         notify_uninit ();