From patchwork Tue Feb 8 16:34:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Rafael Giani X-Patchwork-Id: 3430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DB42C433FE for ; Tue, 8 Feb 2022 16:35:01 +0000 (UTC) Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by mx.groups.io with SMTP id smtpd.web08.13576.1644338100184192262 for ; Tue, 08 Feb 2022 08:35:00 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@mailbox.org header.s=mail20150812 header.b=J+FbRtGD; spf=pass (domain: mailbox.org, ip: 80.241.56.172, mailfrom: crg7475@mailbox.org) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4JtTBV0JhHz9skX; Tue, 8 Feb 2022 17:34:58 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1644338097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7/ahBK23BNmFrD+Dr8/lP2k1K+nYSy7ITyytBfq0aCs=; b=J+FbRtGDHnGnECRCSaFEKWK8pG1gwuAbnqISG3HbM69DVBvrqFKxR+8HvzskKCpNHuvEVk EZKc5wK1Gt7hkIxL4mOCA4Zht3sMZ9SpPAlkzSlfaYhUekac4JWV6xVL/FmR+s0ieyTcJf kbubYOpWPsU85mipsRI1Z98C9QGAPM6cOm1bCpO/4og/3dkOBw7TR14v1+IEfsjxIdj+8t NQermXwtcqyqhD2EjKda4YqpWY4re3NR+9EpXwiKerP2+U9AfzwNDUkznWw6I97hrxAhqZ GKGkUSBUvUw1RIdEq0SdOzJXDHwvVmRyWOs1+eT1t2o5fJOYtJ6xuL5easO4Rg== From: Carlos Rafael Giani To: openembedded-devel@lists.openembedded.org Cc: =george.kiagiadakis@collabora.com Subject: [meta-multimedia][RFC PATCH 1/2] pipewire: Upgrade to 0.3.45 Date: Tue, 8 Feb 2022 17:34:39 +0100 Message-Id: <20220208163440.428471-2-crg7475@mailbox.org> In-Reply-To: <20220208163440.428471-1-crg7475@mailbox.org> References: <20220208163440.428471-1-crg7475@mailbox.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Feb 2022 16:35:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/95269 Recipe changes: * media-session is no longer built, since it is now a separate subproject, and it is considered obsolete; WirePlumber is the alternative that is recommended by upstream; see: https://gitlab.freedesktop.org/pipewire/media-session/-/blob/d2880ed23aa6e3df7038b311145f390e4f3428ef/README.md#pipewire-media-session * new pipewire-v4l2 package that provides a virtual V4L2; contains a new "pw-v4l2" script to LD_PRELOAD libpw-v4l2.so device which transmits media data from/to a PipeWire graph * pw-top needs ncurses, which is why this is added to DEPENDS * pw-tools contains individual binary names to be able to separate the pw-v4l2 script from pw-tools * libcamera and ffmpeg features are usable now * remove unnecessary EXTRA_OEMESON switches for enabling plugins that are already on by default * add avahi, libcanberra, webrtc-echo-cancelling, bluez-aac, libusb packageconfigs * fix systemd-system-dir path and explicitly set systemd-user-dir path Signed-off-by: Carlos Rafael Giani --- ...{pipewire_0.3.34.bb => pipewire_0.3.45.bb} | 117 ++++++++++++------ 1 file changed, 79 insertions(+), 38 deletions(-) rename meta-multimedia/recipes-multimedia/pipewire/{pipewire_0.3.34.bb => pipewire_0.3.45.bb} (74%) diff --git a/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.34.bb b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.45.bb similarity index 74% rename from meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.34.bb rename to meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.45.bb index 2abc64efb..31798e47c 100644 --- a/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.34.bb +++ b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.45.bb @@ -1,17 +1,19 @@ -SUMMARY = "Multimedia processing server for Linux" +SUMMARY = "Multimedia processing server for Linux" DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" -HOMEPAGE = "https://pipewire.org/" +HOMEPAGE = "https://pipewire.org/" BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" +AUTHOR = "Wim Taymans " +SECTION = "multimedia" + LICENSE = "MIT & LGPL-2.1-or-later & GPL-2.0-only" LIC_FILES_CHKSUM = " \ file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ " -SECTION = "multimedia" -DEPENDS = "dbus" +DEPENDS = "dbus ncurses" -SRCREV = "1924c2c29824955b5e763f1def6967f68e403c7c" +SRCREV = "bdd407fe66cc9e46d4bc4dcc989d50679000482b" SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https" S = "${WORKDIR}/git" @@ -27,36 +29,47 @@ USERADD_PARAM:${PN} = "--system --home / --no-create-home \ --gid pipewire --groups audio,video \ pipewire" -SYSTEMD_PACKAGES = "${PN} ${PN}-media-session" +SYSTEMD_PACKAGES = "${PN}" # For "EVL", look up https://evlproject.org/ . It involves # a specially prepared kernel, and is currently unavailable # in Yocto. # -# FFmpeg and Vulkan aren't really supported - at the current -# stage (version 0.3.22), these are just experiments, not -# actual features. -# -# libcamera support currently does not build successfully. +# Vulkan support is currently (as of version 0.3.44) not functional. # # manpage generation requires xmltoman, which is not available. +# +# The session-managers list specifies which session managers Meson +# shall download (via git clone) and build as subprojects. In OE, +# this is not how a session manager should be built. Instead, they +# should be integrated as separate OE recipes. To prevent PipeWire +# from using this Meson feature, set an empty list. +# This does not disable support or the need for session managers, +# it just prevents this subproject feature. +# +# AptX and LDAC are not available in OE. Currently, neither +# are lv2 and ROC. EXTRA_OEMESON += " \ - -Daudiotestsrc=enabled \ -Devl=disabled \ -Dtests=disabled \ -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \ - -Dvideotestsrc=enabled \ - -Dffmpeg=disabled \ + -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ + -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ -Dvulkan=disabled \ - -Dlibcamera=disabled \ -Dman=disabled \ + -Dsession-managers='[]' \ + -Dlv2=disabled \ + -Droc=disabled \ + -Dbluez5-codec-aptx=disabled \ + -Dbluez5-codec-ldac=disabled \ " PACKAGECONFIG ??= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service', '', d)} \ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)} \ - gstreamer jack sndfile pw-cat v4l2 \ + gstreamer jack libusb pw-cat raop sndfile v4l2 \ " # "jack" and "pipewire-jack" packageconfigs cannot be both enabled, @@ -65,23 +78,31 @@ PACKAGECONFIG ??= "\ # is why these two are marked in their respective packageconfigs # as being in conflict. PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev" +PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi" PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" -PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native" +PACKAGECONFIG[bluez-aac] = "-Dbluez5-codec-aac=enabled,-Dbluez5-codec-aac=disabled,fdk-aac" +PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native graphviz-native" +PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg" PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base" PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" +PACKAGECONFIG[libcamera] = "-Dlibcamera=enabled,-Dlibcamera=disabled,libcamera" +PACKAGECONFIG[libcanberra] = "-Dlibcanberra=enabled,-Dlibcanberra=disabled,libcanberra" +PACKAGECONFIG[libusb] = "-Dlibusb=enabled,-Dlibusb=disabled,libusb" +PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" +PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" +PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled" +PACKAGECONFIG[raop] = "-Draop=enabled,-Draop=disabled,openssl" PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2" PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=enabled,-Dsystemd-system-service=disabled,systemd" -# "systemd-user-service" packageconfig will only install service +# "systemd-user-service" packageconfig will only install service # files to rootfs but not enable them as systemd.bbclass # currently lacks the feature of enabling user services. PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=enabled,-Dsystemd-user-service=disabled,systemd" # pw-cat needs sndfile packageconfig to be enabled -PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled" PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" -PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" -PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" +PACKAGECONFIG[webrtc-echo-cancelling] = "-Decho-cancel-webrtc=enabled,-Decho-cancel-webrtc=disabled,webrtc-audio-processing" PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " @@ -93,8 +114,11 @@ remove_unused_installed_files() { # jack.conf is used by pipewire-jack (not the JACK SPA plugin). # Remove it if pipewire-jack is not built to avoid creating the # pipewire-jack package. + # minimal.conf is an example of how to minimally configure the + # daemon and is not meant to be used for production. if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then rm -f "${D}${datadir}/pipewire/jack.conf" + rm -f "${D}${datadir}/pipewire/minimal.conf" fi } @@ -179,13 +203,13 @@ PACKAGES =+ "\ ${PN}-pulse \ ${PN}-alsa \ ${PN}-jack \ - ${PN}-media-session \ ${PN}-spa-plugins \ ${PN}-spa-plugins-meta \ ${PN}-spa-tools \ ${PN}-modules \ ${PN}-modules-meta \ ${PN}-alsa-card-profile \ + ${PN}-v4l2 \ gstreamer1.0-pipewire \ " @@ -195,6 +219,7 @@ SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-s CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" FILES:${PN} = " \ ${datadir}/pipewire/pipewire.conf \ + ${systemd_system_unitdir}/pipewire.* \ ${systemd_user_unitdir}/pipewire.* \ ${bindir}/pipewire \ " @@ -217,7 +242,23 @@ RDEPENDS:libpipewire += " \ " FILES:${PN}-tools = " \ - ${bindir}/pw-* \ + ${bindir}/pw-cat \ + ${bindir}/pw-cli \ + ${bindir}/pw-dot \ + ${bindir}/pw-dsdplay \ + ${bindir}/pw-dump \ + ${bindir}/pw-link \ + ${bindir}/pw-loopback \ + ${bindir}/pw-metadata \ + ${bindir}/pw-mididump \ + ${bindir}/pw-midiplay \ + ${bindir}/pw-midirecord \ + ${bindir}/pw-mon \ + ${bindir}/pw-play \ + ${bindir}/pw-profiler \ + ${bindir}/pw-record \ + ${bindir}/pw-reserve \ + ${bindir}/pw-top \ " # This is a shim daemon that is intended to be used as a @@ -226,6 +267,7 @@ FILES:${PN}-tools = " \ CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" FILES:${PN}-pulse = " \ ${datadir}/pipewire/pipewire-pulse.conf \ + ${systemd_system_unitdir}/pipewire-pulse.* \ ${systemd_user_unitdir}/pipewire-pulse.* \ ${bindir}/pipewire-pulse \ " @@ -233,39 +275,32 @@ RDEPENDS:${PN}-pulse += " \ ${PN}-modules-protocol-pulse \ " -# alsa plugin to redirect audio to pipewire +# ALSA plugin to redirect audio to pipewire. FILES:${PN}-alsa = "\ ${libdir}/alsa-lib/* \ ${datadir}/alsa/alsa.conf.d/* \ " -# jack drop-in libraries to redirect audio to pipewire +# JACK drop-in libraries to redirect audio to pipewire. CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" FILES:${PN}-jack = "\ ${datadir}/pipewire/jack.conf \ ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ " -# Example session manager. Not intended for use in production. -CONFFILES:${PN}-media-session = "${datadir}/pipewire/media-session.d/*" -SYSTEMD_SERVICE:${PN}-media-session = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-service', 'pipewire-media-session.service', '', d)}" -FILES:${PN}-media-session = " \ - ${bindir}/pipewire-media-session \ - ${datadir}/pipewire/media-session.d/* \ - ${systemd_system_unitdir}/pipewire-media-session.service \ - ${systemd_user_unitdir}/pipewire-media-session.service \ -" -RPROVIDES:${PN}-media-session = "virtual-pipewire-sessionmanager" - -# Dynamic packages (see set_dynamic_metapkg_rdepends). +# Dynamic SPA plugin packages (see set_dynamic_metapkg_rdepends). FILES:${PN}-spa-plugins = "" RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" +FILES:${PN}-spa-plugins-bluez5 += " \ + ${datadir}/${SPA_SUBDIR}/bluez5/* \ +" + FILES:${PN}-spa-tools = " \ ${bindir}/spa-* \ " -# Dynamic packages (see set_dynamic_metapkg_rdepends). +# Dynamic PipeWire module packages (see set_dynamic_metapkg_rdepends). FILES:${PN}-modules = "" RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" @@ -284,6 +319,12 @@ FILES:${PN}-alsa-card-profile = " \ ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ " +# V4L2 interface emulator for sending/receiving data between PipeWire and V4L2 applications. +FILES:${PN}-v4l2 += " \ + ${bindir}/pw-v4l2 \ + ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ +" + FILES:gstreamer1.0-pipewire = " \ ${libdir}/gstreamer-1.0/* \ " From patchwork Tue Feb 8 16:34:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Rafael Giani X-Patchwork-Id: 3431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 610BDC433F5 for ; Tue, 8 Feb 2022 16:35:02 +0000 (UTC) Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by mx.groups.io with SMTP id smtpd.web12.13581.1644338101584534060 for ; Tue, 08 Feb 2022 08:35:02 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@mailbox.org header.s=mail20150812 header.b=vJiuVGlm; spf=pass (domain: mailbox.org, ip: 80.241.56.152, mailfrom: crg7475@mailbox.org) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4JtTBV2n3nz9sGf; Tue, 8 Feb 2022 17:34:58 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1644338098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sVqI9kFoTZfcLrVK0DSG+w6U9tnZuYIhqGboLzIaJok=; b=vJiuVGlmVN6LbizspkF9UHd50KIXmLVGgHGQE9Ul8nJoDQg3aPiMKns/yK5z6pDLwY30fX r3h3hXaBC7hdeYZ85R9UoGzYbwh8T4MT6B89HuEAbCJ/Bilhvaj1fdytHRrNz9ryVgflaH 0LznBOGpXyuRMye/3hG5yTyat5KuqEZSITUjHJPzyEKIe8lYoxEHJHdfrbyEIVBucHVRDc BAiMXwY/1fXbGCaJw88VckhqJPTd8iMirgveR4ZeizZvcWwYfrkjJ58zNq+FRMPHdy+k9X sESF24gf1FgTnNy+uOvkgglRo/C7YaOfhSBc7EQ7LZhXcNNViwLkSzMM3mEbyQ== From: Carlos Rafael Giani To: openembedded-devel@lists.openembedded.org Cc: =george.kiagiadakis@collabora.com Subject: [meta-multimedia][RFC PATCH 2/2] wireplumber: Add recipe Date: Tue, 8 Feb 2022 17:34:40 +0100 Message-Id: <20220208163440.428471-3-crg7475@mailbox.org> In-Reply-To: <20220208163440.428471-1-crg7475@mailbox.org> References: <20220208163440.428471-1-crg7475@mailbox.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Feb 2022 16:35:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/95270 WirePlumber is a session / policy manager for PipeWire with support for Lua scripting and adding functionality by installing extra modules. Signed-off-by: Carlos Rafael Giani --- .../wireplumber/wireplumber_0.4.8.bb | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb diff --git a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb new file mode 100644 index 000000000..4d26e3360 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb @@ -0,0 +1,140 @@ +SUMMARY = "Session / policy manager implementation for PipeWire" +HOMEPAGE = "https://gitlab.freedesktop.org/pipewire/wireplumber" +BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues" +AUTHOR = "George Kiagiadakis " +SECTION = "multimedia" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=17d1fe479cdec331eecbc65d26bc7e77" + +DEPENDS = "glib-2.0 glib-2.0-native lua pipewire \ + ${@bb.utils.contains("DISTRO_FEATURES", "gobject-introspection-data", "python3-native python3-lxml-native doxygen-native", "", d)} \ +" + +SRCREV = "e14bb72dcc85e2130d0ea96768e5ae3b375a041e" +SRC_URI = "git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https \ + " + +S = "${WORKDIR}/git" + +inherit meson pkgconfig gobject-introspection systemd + +GIR_MESON_ENABLE_FLAG = 'enabled' +GIR_MESON_DISABLE_FLAG = 'disabled' + +# Enable system-lua to let wireplumber use OE's lua. +# Documentation needs python-sphinx, which is not in oe-core or meta-python2 for now. +# elogind is not (yet) available in OE, so disable support. +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Dsystem-lua=true \ + -Delogind=disabled \ + -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ + -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ + -Dtests=false \ +" + +PACKAGECONFIG ??= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service', '', d)} \ +" + +PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" +PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=true,-Dsystemd-system-service=false,systemd" +# "systemd-user-service" packageconfig will only install service +# files to rootfs but not enable them as systemd.bbclass +# currently lacks the feature of enabling user services. +PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=true,-Dsystemd-user-service=false,systemd" + +PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " +PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " + +WP_MODULE_SUBDIR = "wireplumber-0.4" + +python split_dynamic_packages () { + # Create packages for each WirePlumber module. + wp_module_libdir = d.expand('${libdir}/${WP_MODULE_SUBDIR}') + do_split_packages(d, wp_module_libdir, r'^libwireplumber-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'WirePlumber %s module', extra_depends='', recursive=False) +} + +python set_dynamic_metapkg_rdepends () { + import os + import oe.utils + + # Go through all generated WirePlumber module packages + # (excluding the main package and the -meta package itself) + # and add them to the -meta package as RDEPENDS. + + base_pn = d.getVar('PN') + + wp_module_pn = base_pn + '-modules' + wp_module_metapkg = wp_module_pn + '-meta' + + d.setVar('ALLOW_EMPTY:' + wp_module_metapkg, "1") + d.setVar('FILES:' + wp_module_metapkg, "") + + blacklist = [ wp_module_pn, wp_module_metapkg ] + wp_module_metapkg_rdepends = [] + pkgdest = d.getVar('PKGDEST') + + for pkg in oe.utils.packages_filter_out_system(d): + if pkg in blacklist: + continue + + is_wp_module_pkg = pkg.startswith(wp_module_pn) + if not is_wp_module_pkg: + continue + + if pkg in wp_module_metapkg_rdepends: + continue + + # See if the package is empty by looking at the contents of its + # PKGDEST subdirectory. If this subdirectory is empty, then then + # package is empty as well. Empty packages do not get added to + # the meta package's RDEPENDS. + pkgdir = os.path.join(pkgdest, pkg) + if os.path.exists(pkgdir): + dir_contents = os.listdir(pkgdir) or [] + else: + dir_contents = [] + is_empty = len(dir_contents) == 0 + if not is_empty: + if is_wp_module_pkg: + wp_module_metapkg_rdepends.append(pkg) + + d.setVar('RDEPENDS:' + wp_module_metapkg, ' '.join(wp_module_metapkg_rdepends)) + d.setVar('DESCRIPTION:' + wp_module_metapkg, wp_module_pn + ' meta package') +} + +PACKAGES =+ "\ + libwireplumber \ + ${PN}-default-config \ + ${PN}-scripts \ + ${PN}-modules \ + ${PN}-modules-meta \ +" + +PACKAGES_DYNAMIC = "^${PN}-modules.*" + +SYSTEMD_SERVICE:${PN} = "wireplumber.service" +CONFFILES:${PN} += " \ + ${sysconfdir}/wireplumber/config.lua \ + ${sysconfdir}/wireplumber/config.lua.d/* \ +" +FILES:${PN} += " \ + ${sysconfdir}/wireplumber/config.lua \ + ${sysconfdir}/wireplumber/config.lua.d/* \ +" +# Add pipewire to RRECOMMENDS, since WirePlumber expects a PipeWire daemon to +# be present. While in theory any application that uses libpipewire can configure +# itself to become a daemon, in practice, the PipeWire daemon is used. +RRECOMMENDS:${PN} += "${PN}-scripts pipewire" + +FILES:libwireplumber = " \ + ${libdir}/libwireplumber-*.so.* \ +" + +FILES:${PN}-scripts += "${datadir}/wireplumber/scripts/*" + +# Dynamic packages (see set_dynamic_metapkg_rdepends). +FILES:${PN}-modules = "" +RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"