Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | DESCRIPTION = "Blueman is a GTK+ Bluetooth Manager" |
| 2 | LICENSE = "GPL-3.0-only" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 4 | |
| 5 | DEPENDS = "gtk+3 glib-2.0 bluez5 python3-pygobject python3-cython-native" |
| 6 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 7 | inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon-cache useradd |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 8 | |
| 9 | SRC_URI = " \ |
| 10 | git://github.com/blueman-project/blueman.git;protocol=https;branch=2-3-stable \ |
| 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 | " |
| 15 | S = "${WORKDIR}/git" |
| 16 | SRCREV = "c85e7afb8d6547d4c35b7b639124de8e999c3650" |
| 17 | |
| 18 | EXTRA_OEMESON = "-Druntime_deps_check=false -Dpythoninstalldir=${@noprefix('PYTHON_SITEPACKAGES_DIR', d)}" |
| 19 | |
| 20 | SYSTEMD_SERVICE:${PN} = "${BPN}-mechanism.service" |
| 21 | SYSTEMD_AUTO_ENABLE:${PN} = "disable" |
| 22 | |
| 23 | RRECOMMENDS:${PN} += "adwaita-icon-theme" |
| 24 | RDEPENDS:${PN} += " \ |
| 25 | python3-core \ |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 26 | python3-ctypes \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 27 | python3-dbus \ |
| 28 | python3-pygobject \ |
| 29 | python3-terminal \ |
| 30 | python3-fcntl \ |
| 31 | packagegroup-tools-bluetooth \ |
| 32 | " |
| 33 | |
| 34 | PACKAGECONFIG ??= " \ |
| 35 | ${@bb.utils.filter('DISTRO_FEATURES', 'polkit pulseaudio ', d)} \ |
| 36 | thunar \ |
| 37 | " |
| 38 | PACKAGECONFIG[thunar] = "-Dthunar-sendto=true,-Dthunar-sendto=false" |
| 39 | PACKAGECONFIG[pulseaudio] = "-Dpulseaudio=true,-Dpulseaudio=false" |
| 40 | PACKAGECONFIG[polkit] = "-Dpolicykit=true,-Dpolicykit=false" |
| 41 | |
| 42 | FILES:${PN} += " \ |
| 43 | ${datadir} \ |
| 44 | ${systemd_user_unitdir} \ |
| 45 | ${PYTHON_SITEPACKAGES_DIR} \ |
| 46 | " |
| 47 | |
| 48 | # In code, path to python is a variable that is replaced with path to native version of it |
| 49 | # during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3. |
| 50 | # Replace it with #!/usr/bin/env python3 |
| 51 | do_install:append() { |
| 52 | sed -i "1s/.*/#!\/usr\/bin\/env python3/" ${D}${prefix}/libexec/blueman-rfcomm-watcher \ |
| 53 | ${D}${prefix}/libexec/blueman-mechanism \ |
| 54 | ${D}${bindir}/blueman-adapters \ |
| 55 | ${D}${bindir}/blueman-applet \ |
| 56 | ${D}${bindir}/blueman-manager \ |
| 57 | ${D}${bindir}/blueman-sendto \ |
| 58 | ${D}${bindir}/blueman-services \ |
| 59 | ${D}${bindir}/blueman-tray |
| 60 | } |
| 61 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 62 | do_install:append() { |
| 63 | install -d ${D}${datadir}/polkit-1/rules.d |
| 64 | cat >${D}${datadir}/polkit-1/rules.d/51-blueman.rules <<EOF |
| 65 | /* Allow users in wheel group to use blueman feature requiring root without authentication */ |
| 66 | polkit.addRule(function(action, subject) { |
| 67 | if ((action.id == "org.blueman.network.setup" || |
| 68 | action.id == "org.blueman.dhcp.client" || |
| 69 | action.id == "org.blueman.rfkill.setstate" || |
| 70 | action.id == "org.blueman.pppd.pppconnect") && |
| 71 | subject.isInGroup("wheel")) { |
| 72 | |
| 73 | return polkit.Result.YES; |
| 74 | } |
| 75 | }); |
| 76 | EOF |
| 77 | } |
| 78 | |
| 79 | USERADD_PACKAGES = "${PN}" |
| 80 | USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 --shell /bin/nologin polkitd" |
| 81 | |
| 82 | do_install:append() { |
| 83 | # Fix up permissions on polkit rules.d to work with rpm4 constraints |
| 84 | chmod 700 ${D}/${datadir}/polkit-1/rules.d |
| 85 | chown polkitd:root ${D}/${datadir}/polkit-1/rules.d |
| 86 | } |