bluez5.inc 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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 \
  8. file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
  9. DEPENDS = "dbus glib-2.0"
  10. PROVIDES += "bluez-hcidump"
  11. RPROVIDES_${PN} += "bluez-hcidump"
  12. RCONFLICTS_${PN} = "bluez4"
  13. PACKAGECONFIG ??= "obex-profiles \
  14. readline \
  15. ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
  16. a2dp-profiles \
  17. avrcp-profiles \
  18. network-profiles \
  19. hid-profiles \
  20. hog-profiles \
  21. tools \
  22. deprecated \
  23. udev \
  24. "
  25. PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
  26. PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
  27. PACKAGECONFIG[testing] = "--enable-testing,--disable-testing"
  28. PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib"
  29. PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd"
  30. PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups"
  31. PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc"
  32. PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap"
  33. PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp"
  34. PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp"
  35. PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network"
  36. PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid"
  37. PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog"
  38. PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health"
  39. PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis"
  40. PACKAGECONFIG[tools] = "--enable-tools,--disable-tools"
  41. PACKAGECONFIG[threads] = "--enable-threads,--disable-threads"
  42. PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated"
  43. PACKAGECONFIG[mesh] = "--enable-mesh,--disable-mesh, json-c ell"
  44. PACKAGECONFIG[btpclient] = "--enable-btpclient,--disable-btpclient, ell"
  45. PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
  46. SRC_URI = "\
  47. ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
  48. file://out-of-tree.patch \
  49. file://init \
  50. file://run-ptest \
  51. ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
  52. file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
  53. file://0001-test-gatt-Fix-hung-issue.patch \
  54. file://0001-Makefile.am-Fix-a-race-issue-for-tools.patch \
  55. file://CVE-2018-10910.patch \
  56. file://gcc9-fixes.patch \
  57. file://0001-tools-Fix-build-after-y2038-changes-in-glibc.patch \
  58. file://0001-tools-btpclient.c-include-signal.h.patch \
  59. "
  60. S = "${WORKDIR}/bluez-${PV}"
  61. CVE_PRODUCT = "bluez"
  62. inherit autotools pkgconfig systemd update-rc.d features_check ptest gobject-introspection-data
  63. EXTRA_OECONF = "\
  64. --enable-test \
  65. --enable-datafiles \
  66. --enable-library \
  67. "
  68. # bluez5 builds a large number of useful utilities but does not
  69. # install them. Specify which ones we want put into ${PN}-noinst-tools.
  70. NOINST_TOOLS_READLINE ??= ""
  71. NOINST_TOOLS_TESTING ??= ""
  72. NOINST_TOOLS_BT ??= ""
  73. NOINST_TOOLS = " \
  74. ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
  75. ${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \
  76. ${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \
  77. "
  78. do_install_append() {
  79. install -d ${D}${INIT_D_DIR}
  80. install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
  81. install -d ${D}${sysconfdir}/bluetooth/
  82. if [ -f ${S}/profiles/network/network.conf ]; then
  83. install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
  84. fi
  85. if [ -f ${S}/profiles/input/input.conf ]; then
  86. install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
  87. fi
  88. if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
  89. sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
  90. fi
  91. # Install desired tools that upstream leaves in build area
  92. for f in ${NOINST_TOOLS} ; do
  93. install -m 755 ${B}/$f ${D}/${bindir}
  94. done
  95. # Patch python tools to use Python 3; they should be source compatible, but
  96. # still refer to Python 2 in the shebang
  97. sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
  98. }
  99. PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
  100. FILES_${PN} += " \
  101. ${libdir}/bluetooth/plugins/*.so \
  102. ${systemd_unitdir}/ ${datadir}/dbus-1 \
  103. ${libdir}/cups \
  104. "
  105. FILES_${PN}-dev += " \
  106. ${libdir}/bluetooth/plugins/*.la \
  107. "
  108. FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
  109. ${exec_prefix}/lib/systemd/user/obex.service \
  110. ${systemd_system_unitdir}/obex.service \
  111. ${sysconfdir}/systemd/system/multi-user.target.wants/obex.service \
  112. ${datadir}/dbus-1/services/org.bluez.obex.service \
  113. ${sysconfdir}/dbus-1/system.d/obexd.conf \
  114. "
  115. SYSTEMD_SERVICE_${PN}-obex = "obex.service"
  116. FILES_${PN}-testtools = "${libdir}/bluez/test/*"
  117. def get_noinst_tools_paths (d, bb, tools):
  118. s = list()
  119. bindir = d.getVar("bindir")
  120. for bdp in tools.split():
  121. f = os.path.basename(bdp)
  122. s.append("%s/%s" % (bindir, f))
  123. return "\n".join(s)
  124. FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
  125. RDEPENDS_${PN}-testtools += "python3-core python3-dbus"
  126. RDEPENDS_${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"
  127. SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}"
  128. INITSCRIPT_PACKAGES = "${PN}"
  129. INITSCRIPT_NAME_${PN} = "bluetooth"
  130. do_compile_ptest() {
  131. oe_runmake buildtests
  132. }
  133. do_install_ptest() {
  134. cp -r ${B}/unit/ ${D}${PTEST_PATH}
  135. rm -f ${D}${PTEST_PATH}/unit/*.o
  136. }
  137. RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-utf-16"