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