From 714c84801ddaff9a0d4843b172841cdd9526bc9b Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Feb 15 2018 20:56:23 +0000 Subject: Add some upstream fixes --- diff --git a/0001-fix-shebangs.patch b/0001-fix-shebangs.patch new file mode 100644 index 0000000..532e875 --- /dev/null +++ b/0001-fix-shebangs.patch @@ -0,0 +1,94 @@ +From 9a886f57d1c5b1adce78b33aac21b71d14e75feb Mon Sep 17 00:00:00 2001 +From: leigh123linux +Date: Thu, 11 Jan 2018 23:30:59 +0000 +Subject: [PATCH] fix shebangs + +--- + usr/bin/blueberry | 2 +- + usr/bin/blueberry-tray | 2 +- + usr/lib/blueberry/BlueberrySettingsWidgets.py | 4 ++-- + usr/lib/blueberry/blueberry-tray.py | 2 +- + usr/lib/blueberry/blueberry.py | 2 +- + usr/lib/blueberry/rfkillMagic.py | 1 + + usr/lib/blueberry/safechild | 2 +- + 7 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/usr/bin/blueberry b/usr/bin/blueberry +index d3d4f5b..813e33a 100755 +--- a/usr/bin/blueberry ++++ b/usr/bin/blueberry +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/bin/python2 + + import os + os.system("/usr/lib/blueberry/blueberry.py") +diff --git a/usr/bin/blueberry-tray b/usr/bin/blueberry-tray +index 874df69..f96a5c6 100755 +--- a/usr/bin/blueberry-tray ++++ b/usr/bin/blueberry-tray +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/bin/python2 + + import os + os.system("/usr/lib/blueberry/blueberry-tray.py") +diff --git a/usr/lib/blueberry/BlueberrySettingsWidgets.py b/usr/lib/blueberry/BlueberrySettingsWidgets.py +index 8d92fbc..e805e87 100644 +--- a/usr/lib/blueberry/BlueberrySettingsWidgets.py ++++ b/usr/lib/blueberry/BlueberrySettingsWidgets.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/python2 + + import gi + gi.require_version('Gtk', '3.0') +@@ -107,4 +107,4 @@ class SettingsRow(Gtk.ListBoxRow): + + def show_alternative_widget(self): + if self.alternative_widget is not None: +- self.stack.set_visible_child(self.alternative_widget) +\ No newline at end of file ++ self.stack.set_visible_child(self.alternative_widget) +diff --git a/usr/lib/blueberry/blueberry-tray.py b/usr/lib/blueberry/blueberry-tray.py +index 6a2a1f1..75ab919 100755 +--- a/usr/lib/blueberry/blueberry-tray.py ++++ b/usr/lib/blueberry/blueberry-tray.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/python2 + + import sys + import gettext +diff --git a/usr/lib/blueberry/blueberry.py b/usr/lib/blueberry/blueberry.py +index 99d7a71..261463c 100755 +--- a/usr/lib/blueberry/blueberry.py ++++ b/usr/lib/blueberry/blueberry.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/python2 + + import sys, os, commands + import gettext +diff --git a/usr/lib/blueberry/rfkillMagic.py b/usr/lib/blueberry/rfkillMagic.py +index 9ef3be3..aabd60c 100644 +--- a/usr/lib/blueberry/rfkillMagic.py ++++ b/usr/lib/blueberry/rfkillMagic.py +@@ -1,3 +1,4 @@ ++#!/usr/bin/python2 + + import thread + import subprocess +diff --git a/usr/lib/blueberry/safechild b/usr/lib/blueberry/safechild +index 9d6918c..acfd8ad 100755 +--- a/usr/lib/blueberry/safechild ++++ b/usr/lib/blueberry/safechild +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/python2 + + import subprocess + import sys +-- +2.15.1 + diff --git a/Fix_PyGIDeprecationWarning_1.patch b/Fix_PyGIDeprecationWarning_1.patch new file mode 100644 index 0000000..323f1da --- /dev/null +++ b/Fix_PyGIDeprecationWarning_1.patch @@ -0,0 +1,84 @@ +From e1b0efa62a097a130a8d5a72c789fb8c1fefa19a Mon Sep 17 00:00:00 2001 +From: FriedrichFroebel +Date: Tue, 30 Jan 2018 11:28:29 +0100 +Subject: [PATCH] Fix PyGIDeprecationWarnings (#51) + +* Fix PyGIDeprecationWarning + +* fix some more warnings +--- + usr/lib/blueberry/blueberry.py | 10 +++++----- + usr/lib/blueberry/rfkillMagic.py | 4 ++-- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/usr/lib/blueberry/blueberry.py b/usr/lib/blueberry/blueberry.py +index 99d7a71..05fd1e8 100755 +--- a/usr/lib/blueberry/blueberry.py ++++ b/usr/lib/blueberry/blueberry.py +@@ -23,7 +23,7 @@ class Blueberry(Gtk.Application): + def __init__(self): + + Gtk.Application.__init__(self, application_id='com.linuxmint.blueberry', flags=Gio.ApplicationFlags.FLAGS_NONE) +- self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL) ++ self.window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL) + self.detect_desktop_environment() + self.connect("activate", self.on_activate) + +@@ -103,7 +103,7 @@ def create_window(self): + stack_switcher.set_halign(Gtk.Align.CENTER) + toolbar.show_all() + +- self.settings = Gio.Settings("org.blueberry") ++ self.settings = Gio.Settings(schema="org.blueberry") + + debug = False + if len(sys.argv) > 1 and sys.argv[1] == "debug": +@@ -162,7 +162,7 @@ def create_window(self): + self.obex_switch.set_active(self.settings.get_boolean("obex-enabled")) + self.obex_switch.connect("notify::active", self.on_obex_switch_toggled) + self.settings.connect("changed", self.on_settings_changed) +- row = SettingsRow(Gtk.Label(_("Receive files from remote devices")), self.obex_switch) ++ row = SettingsRow(Gtk.Label(label=_("Receive files from remote devices")), self.obex_switch) + row.set_tooltip_text(_("This option allows your computer to receive files transferred over Bluetooth (OBEX)")) + section.add_row(row) + +@@ -170,7 +170,7 @@ def create_window(self): + self.tray_switch.set_active(self.settings.get_boolean("tray-enabled")) + self.tray_switch.connect("notify::active", self.on_tray_switch_toggled) + self.settings.connect("changed", self.on_settings_changed) +- section.add_row(SettingsRow(Gtk.Label(_("Show a tray icon")), self.tray_switch)) ++ section.add_row(SettingsRow(Gtk.Label(label=_("Show a tray icon")), self.tray_switch)) + + self.window.add(self.main_box) + +@@ -221,7 +221,7 @@ def on_settings_changed(self, settings, key): + self.obex_switch.set_active(self.settings.get_boolean("obex-enabled")) + + def add_stack_page(self, message, name): +- label = Gtk.Label(message) ++ label = Gtk.Label(label=message) + self.stack.add_named(label, name) + label.show() + +diff --git a/usr/lib/blueberry/rfkillMagic.py b/usr/lib/blueberry/rfkillMagic.py +index 9ef3be3..03aaed5 100644 +--- a/usr/lib/blueberry/rfkillMagic.py ++++ b/usr/lib/blueberry/rfkillMagic.py +@@ -3,7 +3,7 @@ + import subprocess + import os + import re +-from gi.repository import GObject ++from gi.repository import GLib + + RFKILL_CHK = ["/usr/sbin/rfkill", "list", "bluetooth"] + RFKILL_BLOCK = ["/usr/sbin/rfkill", "block", "bluetooth"] +@@ -108,7 +108,7 @@ def update_state(self, line): + self.update_ui() + + def update_ui(self): +- GObject.idle_add(self.output_callback) ++ GLib.idle_add(self.output_callback) + + def try_set_blocked(self, blocked): + thread.start_new_thread(self.set_block_thread, (blocked,)) diff --git a/Fix_PyGIDeprecationWarning_2.patch b/Fix_PyGIDeprecationWarning_2.patch new file mode 100644 index 0000000..4f21eb0 --- /dev/null +++ b/Fix_PyGIDeprecationWarning_2.patch @@ -0,0 +1,27 @@ +From ee6acb86a42f81025704a3e5e53a68decf03640a Mon Sep 17 00:00:00 2001 +From: Leigh Scott +Date: Tue, 30 Jan 2018 10:28:43 +0000 +Subject: [PATCH] fix some depreciation warnings (#49) + +--- + usr/lib/blueberry/blueberry-obex-agent.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/usr/lib/blueberry/blueberry-obex-agent.py b/usr/lib/blueberry/blueberry-obex-agent.py +index b63d46d..899475c 100755 +--- a/usr/lib/blueberry/blueberry-obex-agent.py ++++ b/usr/lib/blueberry/blueberry-obex-agent.py +@@ -723,11 +723,11 @@ def on_unregister_failed(error): + self._interface.UnregisterAgent(agent_path, reply_handler=on_unregistered, error_handler=on_unregister_failed) + + if __name__ == '__main__': +- settings = Gio.Settings("org.blueberry") ++ settings = Gio.Settings(schema="org.blueberry") + if settings.get_boolean("obex-enabled"): + try: + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) +- mainloop = GObject.MainLoop() ++ mainloop = GLib.MainLoop() + service = TransferService() + service.load() + cont = True diff --git a/Remove_unused_applet_label.patch b/Remove_unused_applet_label.patch new file mode 100644 index 0000000..7a978b1 --- /dev/null +++ b/Remove_unused_applet_label.patch @@ -0,0 +1,66 @@ +From 87b1f2c2b24439c236c2ded873dedb4bdf33be8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Germ=C3=A1n=20Franco?= +Date: Thu, 1 Feb 2018 12:13:38 +0100 +Subject: [PATCH] Remove unused applet label (#53) + +Inherit from IconApplet instead of TextIconApplet because the label +wasn't being used. It caused an issue where the label was taking up +space even when it was empty when using padding or margins on it. +--- + usr/share/cinnamon/applets/blueberry@cinnamon.org/applet.js | 13 ++----------- + .../cinnamon/applets/blueberry@cinnamon.org/metadata.json | 4 ++-- + 2 files changed, 4 insertions(+), 13 deletions(-) + +diff --git a/usr/share/cinnamon/applets/blueberry@cinnamon.org/applet.js b/usr/share/cinnamon/applets/blueberry@cinnamon.org/applet.js +index f4297be..62dc749 100644 +--- a/usr/share/cinnamon/applets/blueberry@cinnamon.org/applet.js ++++ b/usr/share/cinnamon/applets/blueberry@cinnamon.org/applet.js +@@ -22,10 +22,10 @@ function MyApplet(metadata, orientation, panel_height, instance_id) { + } + + MyApplet.prototype = { +- __proto__: Applet.TextIconApplet.prototype, ++ __proto__: Applet.IconApplet.prototype, + + _init: function(metadata, orientation, panel_height, instance_id) { +- Applet.TextIconApplet.prototype._init.call(this, orientation, panel_height, instance_id); ++ Applet.IconApplet.prototype._init.call(this, orientation, panel_height, instance_id); + + this.setAllowedLayout(Applet.AllowedLayout.BOTH); + +@@ -51,8 +51,6 @@ MyApplet.prototype = { + })); + this.menu.addMenuItem(item); + +- this.on_orientation_changed(orientation); +- + this._client = new GnomeBluetooth.Client(); + this._model = this._client.get_model(); + this._model.connect('row-changed', Lang.bind(this, this._sync)); +@@ -73,13 +71,6 @@ MyApplet.prototype = { + Main.systrayManager.unregisterId(this.metadata.uuid); + }, + +- on_orientation_changed: function(orientation) { +- if (orientation == St.Side.LEFT || orientation == St.Side.RIGHT) +- this.hide_applet_label(true); +- else +- this.hide_applet_label(false); +- }, +- + _getDefaultAdapter: function() { + let [ret, iter] = this._model.get_iter_first(); + while (ret) { +diff --git a/usr/share/cinnamon/applets/blueberry@cinnamon.org/metadata.json b/usr/share/cinnamon/applets/blueberry@cinnamon.org/metadata.json +index fd88334..8131d54 100644 +--- a/usr/share/cinnamon/applets/blueberry@cinnamon.org/metadata.json ++++ b/usr/share/cinnamon/applets/blueberry@cinnamon.org/metadata.json +@@ -3,5 +3,5 @@ + "description": "Blueberry applet", + "uuid": "blueberry@cinnamon.org", + "name": "Bluetooth", +- "last-edited": "1355436562" +-} +\ No newline at end of file ++ "last-edited": "1517395944" ++} diff --git a/blueberry.spec b/blueberry.spec index e03c767..669bc3b 100644 --- a/blueberry.spec +++ b/blueberry.spec @@ -1,11 +1,16 @@ Name: blueberry Version: 1.1.20 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Bluetooth configuration tool License: GPLv3+ URL: https://github.com/linuxmint/%{name} -Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Remove the python3 dep +Patch0: 0001-fix-shebangs.patch +Patch1: %{url}/commit/e1b0efa62a097a130a8d5a72c789fb8c1fefa19a.patch#/Fix_PyGIDeprecationWarning_1.patch +Patch2: %{url}/commit/ee6acb86a42f81025704a3e5e53a68decf03640a.patch#/Fix_PyGIDeprecationWarning_2.patch +Patch3: %{url}/commit/87b1f2c2b24439c236c2ded873dedb4bdf33be8c.patch#/Remove_unused_applet_label.patch BuildArch: noarch @@ -86,7 +91,7 @@ done %find_lang %{name} -%if 0%{?rhel} && 0%{?rhel} <= 7 +%if (0%{?rhel} && 0%{?rhel} >= 7) %post /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : @@ -106,7 +111,7 @@ fi &>/dev/null || : %{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas \ &> /dev/null || : -%endif +%endif # (0%%{?rhel} && 0%%{?rhel} >= 7) %files -f %{name}.lang @@ -127,6 +132,10 @@ fi %changelog +* Thu Feb 15 2018 Leigh Scott - 1.1.20-5 +- Add some upstream fixes +- Remove the python3 dep + * Wed Feb 07 2018 Iryna Shcherbina - 1.1.20-4 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)