From b54ff2274ac4467550cd47a6ec2206fbdb886eb0 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Wed, 18 May 2022 14:38:13 +0200 Subject: 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 --- recipes-connectivity/bluez-alsa/bluez-alsa_git.bb | 83 +++++++++++++--------- ...-linkage-mark-external-variable-as-extern.patch | 65 ----------------- .../bluez-alsa/files/bluez-alsa.service | 11 --- 3 files changed, 49 insertions(+), 110 deletions(-) delete mode 100644 recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch delete mode 100644 recipes-connectivity/bluez-alsa/files/bluez-alsa.service 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 -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 ---- - 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 - --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 -- cgit v1.2.3