From 000efc569b1ed5199126e42bb77abf5676a75a48 Mon Sep 17 00:00:00 2001 From: Patrick Ulbrich Date: Sun, 17 Nov 2013 18:48:41 +0100 Subject: [PATCH] added patch for libnotify and GNOME 3.10 API changes --- PKGBUILD | 12 ++++++--- libnotify-and-gsettings.patch | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 libnotify-and-gsettings.patch diff --git a/PKGBUILD b/PKGBUILD index 147bd1d..e060489 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgname=mailnag pkgver=0.5.2 -pkgrel=3 +pkgrel=4 pkgdesc="A mail notification daemon for GNOME 3." arch=('any') url="https://github.com/pulb/mailnag" @@ -12,13 +12,17 @@ depends=('python2' 'python2-gobject' 'python2-httplib2' 'libgnome-keyring' 'gnome-keyring' 'python2-xdg' 'python2-dbus' 'libnotify' 'gstreamer0.10-base-plugins') makedepends=('gettext') -source=('https://launchpad.net/mailnag/trunk/mailnag-master/+download/mailnag-0.5.2.tar.gz') -md5sums=('10bb4d1618dce791f7ae619f81580a68') +source=('https://launchpad.net/mailnag/trunk/mailnag-master/+download/mailnag-0.5.2.tar.gz' + libnotify-and-gsettings.patch) +md5sums=('10bb4d1618dce791f7ae619f81580a68' + '406aaf038ed4e9b3790e1ec1a21a8f4d') install='mailnag.install' build() { - # python2 fix cd "${srcdir}" + # apply patch for libnotify and GNOME 3.10 API changes + patch -p0 < ${startdir}/libnotify-and-gsettings.patch + # python2 fix sed -i 's/python/python2/g' mailnag sed -i 's/python/python2/g' mailnag_config find -name "*.py" -exec sed -i 's_#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' {} \; diff --git a/libnotify-and-gsettings.patch b/libnotify-and-gsettings.patch new file mode 100644 index 0000000..0ce1a5a --- /dev/null +++ b/libnotify-and-gsettings.patch @@ -0,0 +1,47 @@ +--- Mailnag/daemon/mailchecker.py 2013-11-17 17:51:55.560331777 +0100 ++++ Mailnag/daemon/mailchecker.py.patched 2013-11-17 17:51:44.853665248 +0100 +@@ -22,7 +22,7 @@ + # MA 02110-1301, USA. + # + +-from gi.repository import Notify, Gio ++from gi.repository import Notify + import threading + import sys + import subprocess +@@ -45,7 +45,6 @@ + self._reminder = Reminder() + self._pid = Pid() + self._cfg = cfg +- self._gsettings = Gio.Settings.new('org.gnome.shell') + # dict that tracks all notifications that need to be closed + self._notifications = {} + +@@ -100,8 +99,7 @@ + + # play sound if it is enabled in mailnags settings and + # gnome-shell notifications aren't disabled +- if (self._cfg.get('general', 'playsound') == '1') and \ +- (self._gsettings.get_int('saved-session-presence') != 2): ++ if (self._cfg.get('general', 'playsound') == '1'): + gstplay(get_data_file(self._cfg.get('general', 'soundfile'))) + + self._reminder.save(self._mail_list) +@@ -147,7 +145,7 @@ + for mail in new_mails: + n = self._get_notification(mail.sender, mail.subject, "mail-unread") + notification_id = str(id(n)) +- n.add_action("mark-as-read", _("Mark as read"), self._notification_action_handler, (mail, notification_id), None) ++ n.add_action("mark-as-read", _("Mark as read"), self._notification_action_handler, (mail, notification_id)) + n.show() + self._notifications[notification_id] = n + +@@ -155,7 +153,7 @@ + def _get_notification(self, summary, body, icon): + n = Notify.Notification.new(summary, body, icon) + n.set_category("email") +- n.add_action("default", "default", self._notification_action_handler, None, None) ++ n.add_action("default", "default", self._notification_action_handler, None) + + return n +