Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Linux Bluetooth Stack Userland V5" |
| 2 | DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries." |
| 3 | HOMEPAGE = "http://www.bluez.org" |
| 4 | SECTION = "libs" |
| 5 | LICENSE = "GPLv2+ & LGPLv2.1+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ |
| 7 | file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \ |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 8 | file://src/main.c;beginline=1;endline=24;md5=0ad83ca0dc37ab08af448777c581e7ac" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 9 | DEPENDS = "dbus glib-2.0" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | PROVIDES += "bluez-hcidump" |
| 11 | RPROVIDES_${PN} += "bluez-hcidump" |
| 12 | |
| 13 | RCONFLICTS_${PN} = "bluez4" |
| 14 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | PACKAGECONFIG ??= "obex-profiles \ |
| 16 | readline \ |
| 17 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ |
| 18 | a2dp-profiles \ |
| 19 | avrcp-profiles \ |
| 20 | network-profiles \ |
| 21 | hid-profiles \ |
| 22 | hog-profiles \ |
| 23 | tools \ |
| 24 | deprecated \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 25 | udev \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 26 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline," |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 29 | PACKAGECONFIG[testing] = "--enable-testing,--disable-testing" |
| 30 | PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib" |
| 31 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd" |
| 32 | PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups" |
| 33 | PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc" |
| 34 | PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap" |
| 35 | PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp" |
| 36 | PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp" |
| 37 | PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network" |
| 38 | PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid" |
| 39 | PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog" |
| 40 | PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health" |
| 41 | PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis" |
| 42 | PACKAGECONFIG[tools] = "--enable-tools,--disable-tools" |
| 43 | PACKAGECONFIG[threads] = "--enable-threads,--disable-threads" |
| 44 | PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 45 | PACKAGECONFIG[mesh] = "--enable-mesh --enable-external-ell,--disable-mesh, json-c ell" |
| 46 | PACKAGECONFIG[btpclient] = "--enable-btpclient --enable-external-ell,--disable-btpclient, ell" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 47 | PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 49 | SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ |
| 50 | file://init \ |
| 51 | file://run-ptest \ |
| 52 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \ |
| 53 | file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \ |
| 54 | file://0001-test-gatt-Fix-hung-issue.patch \ |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 55 | file://0001-audio-Rename-pause-funciton-to-avoid-shadowing-glibc.patch \ |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 56 | file://0001-Makefile.am-add-missing-mkdir-for-ell-shared.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 57 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | S = "${WORKDIR}/bluez-${PV}" |
| 59 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 60 | CVE_PRODUCT = "bluez" |
| 61 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 62 | inherit autotools pkgconfig systemd update-rc.d ptest gobject-introspection-data |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | |
| 64 | EXTRA_OECONF = "\ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | --enable-test \ |
| 66 | --enable-datafiles \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | --enable-library \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 68 | --without-zsh-completion-dir \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | " |
| 70 | |
| 71 | # bluez5 builds a large number of useful utilities but does not |
| 72 | # install them. Specify which ones we want put into ${PN}-noinst-tools. |
| 73 | NOINST_TOOLS_READLINE ??= "" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 74 | NOINST_TOOLS_TESTING ??= "" |
| 75 | NOINST_TOOLS_BT ??= "" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 76 | NOINST_TOOLS = " \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 77 | ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 78 | ${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \ |
| 79 | ${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | " |
| 81 | |
| 82 | do_install_append() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 83 | install -d ${D}${INIT_D_DIR} |
| 84 | install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth |
| 85 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | install -d ${D}${sysconfdir}/bluetooth/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | if [ -f ${S}/profiles/network/network.conf ]; then |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 88 | install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 89 | fi |
| 90 | if [ -f ${S}/profiles/input/input.conf ]; then |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 91 | install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | fi |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 93 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 94 | if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then |
| 95 | sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth |
| 96 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 97 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 98 | # Install desired tools that upstream leaves in build area |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 99 | for f in ${NOINST_TOOLS} ; do |
| 100 | install -m 755 ${B}/$f ${D}/${bindir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | done |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 102 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 103 | # Patch python tools to use Python 3; they should be source compatible, but |
| 104 | # still refer to Python 2 in the shebang |
| 105 | sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/* |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 106 | } |
| 107 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 108 | PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 110 | FILES_${PN} += " \ |
| 111 | ${libdir}/bluetooth/plugins/*.so \ |
| 112 | ${systemd_unitdir}/ ${datadir}/dbus-1 \ |
| 113 | ${libdir}/cups \ |
| 114 | " |
| 115 | FILES_${PN}-dev += " \ |
| 116 | ${libdir}/bluetooth/plugins/*.la \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 117 | " |
| 118 | |
| 119 | FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \ |
| 120 | ${exec_prefix}/lib/systemd/user/obex.service \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 121 | ${systemd_system_unitdir}/obex.service \ |
| 122 | ${sysconfdir}/systemd/system/multi-user.target.wants/obex.service \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 123 | ${datadir}/dbus-1/services/org.bluez.obex.service \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 124 | ${sysconfdir}/dbus-1/system.d/obexd.conf \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 125 | " |
| 126 | SYSTEMD_SERVICE_${PN}-obex = "obex.service" |
| 127 | |
| 128 | FILES_${PN}-testtools = "${libdir}/bluez/test/*" |
| 129 | |
| 130 | def get_noinst_tools_paths (d, bb, tools): |
| 131 | s = list() |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 132 | bindir = d.getVar("bindir") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 133 | for bdp in tools.split(): |
| 134 | f = os.path.basename(bdp) |
| 135 | s.append("%s/%s" % (bindir, f)) |
| 136 | return "\n".join(s) |
| 137 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 138 | FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 139 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 140 | RDEPENDS_${PN}-testtools += "python3-core python3-dbus" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 141 | RDEPENDS_${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 142 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 143 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 144 | INITSCRIPT_PACKAGES = "${PN}" |
| 145 | INITSCRIPT_NAME_${PN} = "bluetooth" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 146 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 147 | do_compile_ptest() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 148 | oe_runmake buildtests |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | do_install_ptest() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 152 | cp -r ${B}/unit/ ${D}${PTEST_PATH} |
| 153 | rm -f ${D}${PTEST_PATH}/unit/*.o |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 154 | } |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 155 | |
| 156 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-utf-16" |