summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-networking/recipes-connectivity/blueman
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-networking/recipes-connectivity/blueman')
-rw-r--r--external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman/0002-fix-fail-to-enable-bluetooth.patch81
-rw-r--r--external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_2.1.1.bb60
-rw-r--r--external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_git.bb41
3 files changed, 141 insertions, 41 deletions
diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman/0002-fix-fail-to-enable-bluetooth.patch b/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman/0002-fix-fail-to-enable-bluetooth.patch
new file mode 100644
index 00000000..00115cfc
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman/0002-fix-fail-to-enable-bluetooth.patch
@@ -0,0 +1,81 @@
+Fix fail to enable bluetooth issue
+
+When launch blueman-manager while bluetooth is disable, it may fails
+with error:
+
+ Failed to enable bluetooth
+
+Because when get bluetooth status right after change its status, the
+status may not be updated that plugin applet/KillSwitch.py sets the
+bluetooth status via method of another dbus service which doesn't return
+immediately.
+
+Provides a new dbus method for PowerManager which checks whether dbus
+method SetBluetoothStatus() has finished. Then it makes sure to get
+right bluetooth status.
+
+Upstream-Status: Inappropriate
+Send to upstream but not accepted:
+https://github.com/blueman-project/blueman/pull/1121
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ blueman/Functions.py | 12 +++++++++++-
+ blueman/plugins/applet/PowerManager.py | 4 ++++
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/blueman/Functions.py b/blueman/Functions.py
+index 3b76271..c5eeb27 100644
+--- a/blueman/Functions.py
++++ b/blueman/Functions.py
+@@ -17,7 +17,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #
+-from time import sleep
++from time import sleep, time
+ import re
+ import os
+ import signal
+@@ -86,6 +86,16 @@ def check_bluetooth_status(message, exitfunc):
+ return
+
+ applet.SetBluetoothStatus('(b)', True)
++
++ timeout = time() + 10
++ while applet.GetRequestStatus():
++ sleep(0.1)
++ if time() > timeout:
++ # timeout 5s has been set in applet/PowerManager.py
++ # so it should NOT reach timeout here
++ logging.warning('Should NOT reach timeout.')
++ break
++
+ if not applet.GetBluetoothStatus():
+ print('Failed to enable bluetooth')
+ exitfunc()
+diff --git a/blueman/plugins/applet/PowerManager.py b/blueman/plugins/applet/PowerManager.py
+index 8ec9fc4..29a0fb0 100644
+--- a/blueman/plugins/applet/PowerManager.py
++++ b/blueman/plugins/applet/PowerManager.py
+@@ -48,6 +48,7 @@ class PowerManager(AppletPlugin):
+ self._add_dbus_signal("BluetoothStatusChanged", "b")
+ self._add_dbus_method("SetBluetoothStatus", ("b",), "", self.request_power_state)
+ self._add_dbus_method("GetBluetoothStatus", (), "b", self.get_bluetooth_status)
++ self._add_dbus_method("GetRequestStatus", (), "b", self.get_request_status)
+
+ def on_unload(self):
+ self.parent.Plugins.Menu.unregister(self)
+@@ -182,6 +183,9 @@ class PowerManager(AppletPlugin):
+ def get_bluetooth_status(self):
+ return self.current_state
+
++ def get_request_status(self):
++ return self.request_in_progress
++
+ def on_adapter_property_changed(self, _path, key, value):
+ if key == "Powered":
+ if value and not self.current_state:
+--
+2.20.1
+
diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_2.1.1.bb b/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_2.1.1.bb
new file mode 100644
index 00000000..0ea7f6de
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_2.1.1.bb
@@ -0,0 +1,60 @@
+DESCRIPTION = "Blueman is a GTK+ Bluetooth Manager"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "bluez5 python3-pygobject python3-cython-native python3-setuptools-native intltool-native"
+
+inherit autotools systemd gsettings python3native gtk-icon-cache
+
+SRC_URI = " \
+ https://github.com/blueman-project/blueman/releases/download/${PV}/blueman-${PV}.tar.xz \
+ file://0001-Search-for-cython3.patch \
+ file://0002-fix-fail-to-enable-bluetooth.patch \
+"
+SRC_URI[md5sum] = "9de89abb31be45bdbf11f7884764a2dc"
+SRC_URI[sha256sum] = "f1eab2334e5a1587defa80900901048d14c2e8ffa8c0cff7240bc9937a61dbc3"
+
+EXTRA_OECONF = " \
+ --disable-appindicator \
+ --disable-runtime-deps-check \
+ --disable-schemas-compile \
+"
+
+SYSTEMD_SERVICE_${PN} = "${BPN}-mechanism.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+
+RRECOMENDS_${PN} += "adwaita-icon-theme"
+RDEPENDS_${PN} += " \
+ python3-core \
+ python3-dbus \
+ packagegroup-tools-bluetooth \
+"
+
+PACKAGECONFIG ??= "thunar"
+PACKAGECONFIG[thunar] = "--enable-thunar-sendto,--disable-thunar-sendto"
+
+FILES_${PN} += " \
+ ${datadir}/dbus-1 \
+ ${datadir}/Thunar \
+ ${systemd_user_unitdir} \
+ ${exec_prefix}${systemd_system_unitdir} \
+ ${PYTHON_SITEPACKAGES_DIR} \
+"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/_blueman.a"
+
+# In code, path to python is a variable that is replaced with path to native version of it
+# during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3.
+# Replace it with #!/usr/bin/env python3
+do_install_append() {
+ sed -i "1s/.*/#!\/usr\/bin\/env python3/" ${D}${prefix}/libexec/blueman-rfcomm-watcher \
+ ${D}${prefix}/libexec/blueman-mechanism \
+ ${D}${bindir}/blueman-tray \
+ ${D}${bindir}/blueman-services \
+ ${D}${bindir}/blueman-sendto \
+ ${D}${bindir}/blueman-report \
+ ${D}${bindir}/blueman-manager \
+ ${D}${bindir}/blueman-assistant \
+ ${D}${bindir}/blueman-applet \
+ ${D}${bindir}/blueman-adapters
+}
diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_git.bb b/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_git.bb
deleted file mode 100644
index 947db783..00000000
--- a/external/meta-openembedded/meta-networking/recipes-connectivity/blueman/blueman_git.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-DESCRIPTION = "Blueman is a GTK+ Bluetooth Manager"
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
-
-DEPENDS = "bluez5 python3-pygobject python3-cython-native python3-setuptools-native intltool-native"
-
-inherit autotools systemd gsettings python3native gtk-icon-cache
-
-SRC_URI = " \
- git://github.com/blueman-project/blueman.git \
- file://0001-Search-for-cython3.patch \
-"
-SRCREV = "c4a03417e81e21543d4568e8e7f7de307582eb50"
-PV = "2.0.5+git${SRCPV}"
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF = " \
- --disable-runtime-deps-check \
- --disable-schemas-compile \
-"
-
-SYSTEMD_SERVICE_${PN} = "${BPN}-mechanism.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "disable"
-
-RRECOMENDS_${PN} += "adwaita-icon-theme"
-RDEPENDS_${PN} += " \
- python3-dbus \
- packagegroup-tools-bluetooth \
-"
-
-PACKAGECONFIG[thunar] = "--enable-thunar-sendto,--disable-thunar-sendto,,thunar"
-
-FILES_${PN} += " \
- ${datadir}/dbus-1 \
- ${datadir}/Thunar \
- ${systemd_user_unitdir} \
- ${exec_prefix}${systemd_system_unitdir} \
- ${PYTHON_SITEPACKAGES_DIR} \
-"
-
-FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/_blueman.a"