1DESCRIPTION = "Blueman is a GTK+ Bluetooth Manager"
2LICENSE = "GPL-3.0-only"
3LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
4
5DEPENDS = "gtk+3 glib-2.0 bluez5 python3-pygobject python3-cython-native"
6
7inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon-cache
8
9SRC_URI = " \
10    https://github.com/blueman-project/blueman/releases/download/${PV}/blueman-${PV}.tar.xz \
11    file://0001-Search-for-cython3.patch \
12    file://0002-fix-fail-to-enable-bluetooth.patch \
13    file://0001-meson-add-pythoninstalldir-option.patch \
14"
15SRC_URI[sha256sum] = "55d639feeda0b43b18a659e65985213a54b47dcb1348f3b4effb5238db242602"
16
17EXTRA_OEMESON = "-Druntime_deps_check=false -Dappindicator=false -Dpythoninstalldir=${@noprefix('PYTHON_SITEPACKAGES_DIR', d)}"
18
19SYSTEMD_SERVICE:${PN} = "${BPN}-mechanism.service"
20SYSTEMD_AUTO_ENABLE:${PN} = "disable"
21
22RRECOMENDS_${PN} += "adwaita-icon-theme"
23RDEPENDS:${PN} += " \
24    python3-core \
25    python3-dbus \
26    python3-pygobject \
27    python3-terminal \
28    packagegroup-tools-bluetooth \
29"
30
31PACKAGECONFIG ??= " \
32    ${@bb.utils.filter('DISTRO_FEATURES', 'polkit pulseaudio ', d)} \
33    thunar \
34"
35PACKAGECONFIG[thunar] = "-Dthunar-sendto=true,-Dthunar-sendto=false"
36PACKAGECONFIG[pulseaudio] = "-Dpulseaudio=true,-Dpulseaudio=false"
37PACKAGECONFIG[polkit] = "-Dpolicykit=true,-Dpolicykit=false"
38
39FILES:${PN} += " \
40    ${datadir} \
41    ${systemd_user_unitdir} \
42    ${PYTHON_SITEPACKAGES_DIR} \
43"
44
45# In code, path to python is a variable that is replaced with path to native version of it
46# during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3.
47# Replace it with #!/usr/bin/env python3
48do_install:append() {
49    sed -i "1s/.*/#!\/usr\/bin\/env python3/" ${D}${prefix}/libexec/blueman-rfcomm-watcher \
50                                              ${D}${prefix}/libexec/blueman-mechanism \
51                                              ${D}${bindir}/blueman-adapters \
52                                              ${D}${bindir}/blueman-applet \
53                                              ${D}${bindir}/blueman-manager \
54                                              ${D}${bindir}/blueman-sendto \
55                                              ${D}${bindir}/blueman-services \
56                                              ${D}${bindir}/blueman-tray
57}
58
59