summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2022-05-18 14:38:13 +0200
committerPeter Liu <peter.liu@se.atlascopco.com>2022-05-29 16:50:24 +0200
commitb54ff2274ac4467550cd47a6ec2206fbdb886eb0 (patch)
tree9ec014ec5fe1206cd6fcf7a0b014b765d34a259f
parent190f3ee1e3005997fe331345c13724ea2d58e1af (diff)
bluez-alsa: uprev to 3.1.0
The changes in include: - Drop a deprecated patch. - Add more package configs. - Drop bluez-alsa.service from meta layer, use the one installed from bluez-alsa source. - Introduce a new variable BLUEZ_ALSA_OPTS, that the end users could choose to start bluez-alsa service with preferred profiles. Related-to: ELB-4463 Signed-off-by: Ming Liu <ming.liu@toradex.com>
-rw-r--r--recipes-connectivity/bluez-alsa/bluez-alsa_git.bb83
-rw-r--r--recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch65
-rw-r--r--recipes-connectivity/bluez-alsa/files/bluez-alsa.service11
3 files changed, 49 insertions, 110 deletions
diff --git a/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb b/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb
index 085792d..62ff3d6 100644
--- a/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb
+++ b/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb
@@ -3,45 +3,60 @@ HOMEPAGE = "https://github.com/Arkq/bluez-alsa"
SECTION = "libs"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bb3e99e80c5d718213f35ae1def4c106"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=72d868d66bdd5bf51fe67734431de057"
-SRC_URI = " \
- git://github.com/Arkq/bluez-alsa.git;protocol=https;branch=master \
- file://0001-Fix-linkage-mark-external-variable-as-extern.patch \
-"
+SRC_URI = "git://github.com/Arkq/bluez-alsa.git;protocol=https;branch=master"
-SRCREV = "9045edb436ea755f395a2e09e4525b5defad286a"
-
-SRC_URI += "file://bluez-alsa.service"
+SRCREV = "c9e122547b2ba65ccc16d972a66d2d56ca2f2fe5"
+PV = "3.1.0+git${SRCPV}"
S = "${WORKDIR}/git"
-DEPENDS += "alsa-lib bluez5 systemd glib-2.0 sbc"
-
-PACKAGECONFIG[aac] = "--enable-aac, --disable-aac, "
-PACKAGECONFIG[aptx] = "--enable-aptx,--disable-aptx,"
-PACKAGECONFIG[hcitop] = "--enable-hcitop, --disable-hcitop, libbsd ncurses"
-
-inherit autotools pkgconfig
-inherit systemd
-
-SYSTEMD_AUTO_ENABLE = "enable"
-SYSTEMD_SERVICE_${PN} = "bluez-alsa.service"
-
-PACKAGECONFIG += "hcitop"
+DEPENDS += "alsa-lib bluez5 glib-2.0 sbc"
+
+PACKAGECONFIG ??= "aplay cli hcitop ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[a2dpconf] = "--enable-a2dpconf,--disable-a2dpconf"
+PACKAGECONFIG[aac] = "--enable-aac,--disable-aac"
+PACKAGECONFIG[aplay] = "--enable-aplay,--disable-aplay"
+PACKAGECONFIG[aptx] = "--enable-aptx,--disable-aptx"
+PACKAGECONFIG[cli] = "--enable-cli,--disable-cli"
+PACKAGECONFIG[coverage] = "--with-coverage,--without-coverage,,lcov"
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[debug-time] = "--enable-debug-time,--disable-debug-time"
+PACKAGECONFIG[faststream] = "--enable-faststream,--disable-faststream"
+PACKAGECONFIG[hcitop] = "--enable-hcitop,--disable-hcitop,libbsd ncurses"
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+PACKAGECONFIG[mp3lame] = "--enable-mp3lame,--disable-mp3lame,lame"
+PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123,mpg123"
+PACKAGECONFIG[ofono] = "--enable-ofono,--disable-ofono,ofono"
+PACKAGECONFIG[payloadcheck] = "--enable-payloadcheck,--disable-payloadcheck"
+PACKAGECONFIG[rfcomm] = "--enable-rfcomm,--disable-rfcomm"
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd,systemd dbus"
+PACKAGECONFIG[upower] = "--enable-upower,--disable-upower,,upower"
+
+inherit autotools pkgconfig systemd
+
+PACKAGE_BEFORE_PN = "${PN}-aplay"
+RRECOMMENDS_${PN} = "${PN}-aplay"
+
+FILES_${PN}-aplay = "${bindir}/bluealsa-aplay"
+FILES_${PN} += "${libdir}/alsa-lib/*"
+
+SYSTEMD_PACKAGES += "${PN}-aplay"
+SYSTEMD_SERVICE_${PN} = "bluealsa.service"
+SYSTEMD_SERVICE_${PN}-aplay = "bluealsa-aplay.service"
+
+SYSTEMD_AUTO_ENABLE_${PN}-aplay = "disable"
+
+# Choose bluez-alsa profiles to be used at runtime
+# Supported profiles: a2dp-source a2dp-sink hfp-hf hfp-ag hsp-hs hsp-ag hfp-ofono
+# Enable output profiles by default
+BLUEZ_ALSA_OPTS ?= "-p a2dp-source -p a2dp-sink -p hfp-ag -p hsp-ag"
do_install_append () {
- install -d ${D}${base_libdir}/systemd/system
- install -m 0644 ${WORKDIR}/bluez-alsa.service ${D}${base_libdir}/systemd/system
-}
+ # OE specific, it's bluetooth.service being used instead of bluez.service
+ sed -i -e 's#After=bluez.service#After=bluetooth.service#' ${D}${systemd_system_unitdir}/bluealsa.service
-FILES_${PN} += "\
- ${datadir}/alsa/alsa.conf.d/20-bluealsa.conf\
- ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.so\
- ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.so\
-"
-
-FILES_${PN}-staticdev += "\
- ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.a\
- ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.a\
-"
+ # Set profiles
+ sed -i -e 's#ExecStart=.*$#ExecStart=${bindir}/bluealsa ${BLUEZ_ALSA_OPTS}#' ${D}${systemd_system_unitdir}/bluealsa.service
+}
diff --git a/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch b/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch
deleted file mode 100644
index d366e18..0000000
--- a/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 3b7b70fbb70131adf0c0451c95b9a5313ddc8e53 Mon Sep 17 00:00:00 2001
-From: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
-Date: Sun, 9 Feb 2020 22:26:16 +0100
-Subject: [PATCH] Fix linkage - mark external variable as extern
-
-(cherry picked from commit 30a23dd7ce9b00c702fa48545f6b03038f9e17c6)
-
-Conflicts:
- src/bluealsa-iface.h
- src/bluez-a2dp.h
- src/bluez-iface.h
- src/ofono-iface.h
- test/server-mock.c
- test/test-ba.c
- test/test-io.c
- test/test-rfcomm.c
-
-Upstream-Status: Backport [master after tag v2.1.0]
-Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
----
- src/bluez-a2dp.h | 8 ++++----
- src/bluez-iface.h | 4 ++--
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/bluez-a2dp.h b/src/bluez-a2dp.h
-index 4826a6f..715fd89 100644
---- a/src/bluez-a2dp.h
-+++ b/src/bluez-a2dp.h
-@@ -17,15 +17,15 @@
-
- #include "a2dp-codecs.h"
-
--const a2dp_sbc_t bluez_a2dp_sbc;
-+extern const a2dp_sbc_t bluez_a2dp_sbc;
- #if ENABLE_MP3
--const a2dp_mpeg_t bluez_a2dp_mpeg;
-+extern const a2dp_mpeg_t bluez_a2dp_mpeg;
- #endif
- #if ENABLE_AAC
--const a2dp_aac_t bluez_a2dp_aac;
-+extern const a2dp_aac_t bluez_a2dp_aac;
- #endif
- #if ENABLE_APTX
--const a2dp_aptx_t bluez_a2dp_aptx;
-+extern const a2dp_aptx_t bluez_a2dp_aptx;
- #endif
-
- #endif
-diff --git a/src/bluez-iface.h b/src/bluez-iface.h
-index 7d61638..a86a1bd 100644
---- a/src/bluez-iface.h
-+++ b/src/bluez-iface.h
-@@ -13,7 +13,7 @@
-
- #include <gio/gio.h>
-
--const GDBusInterfaceInfo bluez_iface_endpoint;
--const GDBusInterfaceInfo bluez_iface_profile;
-+extern const GDBusInterfaceInfo bluez_iface_endpoint;
-+extern const GDBusInterfaceInfo bluez_iface_profile;
-
- #endif
---
-2.20.1
-
diff --git a/recipes-connectivity/bluez-alsa/files/bluez-alsa.service b/recipes-connectivity/bluez-alsa/files/bluez-alsa.service
deleted file mode 100644
index 671815e..0000000
--- a/recipes-connectivity/bluez-alsa/files/bluez-alsa.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Bluetooth Audio ALSA Backend
-After=bluetooth.service
-Requires=bluetooth.service
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/bluealsa
-
-[Install]
-WantedBy=multi-user.target