From f3a7de2bdfa8a3e9e360ad528a3f847e4c829b78 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Wed, 30 Mar 2022 21:11:15 +0200 Subject: wireplumber: Upgrade to version 0.4.9 ChangeLog can be found here: https://gitlab.freedesktop.org/pipewire/wireplumber/-/releases/0.4.9 Remove backported fix that is already included in this version. Signed-off-by: Carlos Rafael Giani Signed-off-by: Khem Raj --- ...x-va_list-APIs-for-different-architecture.patch | 217 --------------------- .../wireplumber/wireplumber_0.4.8.bb | 144 -------------- .../wireplumber/wireplumber_0.4.9.bb | 143 ++++++++++++++ 3 files changed, 143 insertions(+), 361 deletions(-) delete mode 100644 meta-multimedia/recipes-multimedia/wireplumber/files/0001-spa-json-fix-va_list-APIs-for-different-architecture.patch delete mode 100644 meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb create mode 100644 meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.9.bb (limited to 'meta-multimedia') diff --git a/meta-multimedia/recipes-multimedia/wireplumber/files/0001-spa-json-fix-va_list-APIs-for-different-architecture.patch b/meta-multimedia/recipes-multimedia/wireplumber/files/0001-spa-json-fix-va_list-APIs-for-different-architecture.patch deleted file mode 100644 index 75c7b850f4..0000000000 --- a/meta-multimedia/recipes-multimedia/wireplumber/files/0001-spa-json-fix-va_list-APIs-for-different-architecture.patch +++ /dev/null @@ -1,217 +0,0 @@ -From e429db7e8c266045aee25e153fb2308bd61fe233 Mon Sep 17 00:00:00 2001 -From: Julian Bouzas -Date: Wed, 9 Feb 2022 07:59:59 -0500 -Subject: [PATCH] spa-json: fix va_list APIs for different architectures - -The va_list type might not always be a pointer in some architectures, so we -cannot guarantee it will be modified after using it for a second time in another -function. This fixes the issue by using macros so args does not get copied, and -always gets modified when using it more than once. - -Upstream-Status: Backport [https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/e429db7e8c266045aee25e153fb2308bd61fe233] - -Signed-off-by: Peter Bergin - ---- - lib/wp/spa-json.c | 156 ++++++++++++++++++++++++---------------------- - 1 file changed, 80 insertions(+), 76 deletions(-) - -diff --git a/lib/wp/spa-json.c b/lib/wp/spa-json.c -index f14f395..c5e59a3 100644 ---- a/lib/wp/spa-json.c -+++ b/lib/wp/spa-json.c -@@ -363,33 +363,33 @@ wp_spa_json_new_string (const gchar *value) - wp_spa_json_builder_new_formatted ("\"%s\"", value)); - } - --static void --wp_spa_json_builder_add_value (WpSpaJsonBuilder *self, const gchar *fmt, -- va_list args) --{ -- switch (*fmt) { -- case 'n': -- wp_spa_json_builder_add_null (self); -- break; -- case 'b': -- wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean)); -- break; -- case 'i': -- wp_spa_json_builder_add_int (self, va_arg(args, gint)); -- break; -- case 'f': -- wp_spa_json_builder_add_float (self, (float)va_arg(args, double)); -- break; -- case 's': -- wp_spa_json_builder_add_string (self, va_arg(args, const gchar *)); -- break; -- case 'J': -- wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *)); -- break; -- default: -- return; -- } --} -+/* Args is not a pointer in some architectures, so this needs to be a macro to -+ * avoid args being copied */ -+#define wp_spa_json_builder_add_value(self,fmt,args) \ -+do { \ -+ switch (*fmt) { \ -+ case 'n': \ -+ wp_spa_json_builder_add_null (self); \ -+ break; \ -+ case 'b': \ -+ wp_spa_json_builder_add_boolean (self, va_arg(args, gboolean)); \ -+ break; \ -+ case 'i': \ -+ wp_spa_json_builder_add_int (self, va_arg(args, gint)); \ -+ break; \ -+ case 'f': \ -+ wp_spa_json_builder_add_float (self, (float)va_arg(args, double)); \ -+ break; \ -+ case 's': \ -+ wp_spa_json_builder_add_string (self, va_arg(args, const gchar *)); \ -+ break; \ -+ case 'J': \ -+ wp_spa_json_builder_add_json (self, va_arg(args, WpSpaJson *)); \ -+ break; \ -+ default: \ -+ break; \ -+ } \ -+} while(false) - - /*! - * \brief Creates a spa json of type array -@@ -724,48 +724,46 @@ wp_spa_json_parse_object_valist (WpSpaJson *self, va_list args) - return res; - } - --static gboolean --wp_spa_json_parse_value (const gchar *data, int len, const gchar *fmt, -- va_list args) --{ -- switch (*fmt) { -- case 'n': -- if (!spa_json_is_null (data, len)) -- return FALSE; -- break; -- case 'b': -- if (!wp_spa_json_parse_boolean_internal (data, len, -- va_arg(args, gboolean *))) -- return FALSE; -- break; -- case 'i': -- if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) -- return FALSE; -- break; -- case 'f': -- if (spa_json_parse_float (data, len, -- (float *)va_arg(args, double *)) < 0) -- return FALSE; -- break; -- case 's': { -- gchar *str = wp_spa_json_parse_string_internal (data, len); -- if (!str) -- return FALSE; -- *va_arg(args, gchar **) = str; -- break; -- } -- case 'J': { -- WpSpaJson *j = wp_spa_json_new (data, len); -- if (!j) -- return FALSE; -- *va_arg(args, WpSpaJson **) = j; -- break; -- } -- default: -- return FALSE; -- } -- return TRUE; --} -+/* Args is not a pointer in some architectures, so this needs to be a macro to -+ * avoid args being copied */ -+#define wp_spa_json_parse_value(data,len,fmt,args) \ -+do { \ -+ switch (*fmt) { \ -+ case 'n': \ -+ if (!spa_json_is_null (data, len)) \ -+ return FALSE; \ -+ break; \ -+ case 'b': \ -+ if (!wp_spa_json_parse_boolean_internal (data, len, \ -+ va_arg(args, gboolean *))) \ -+ return FALSE; \ -+ break; \ -+ case 'i': \ -+ if (spa_json_parse_int (data, len, va_arg(args, gint *)) < 0) \ -+ return FALSE; \ -+ break; \ -+ case 'f': \ -+ if (spa_json_parse_float (data, len, va_arg(args, float *)) < 0) \ -+ return FALSE; \ -+ break; \ -+ case 's': { \ -+ gchar *str = wp_spa_json_parse_string_internal (data, len); \ -+ if (!str) \ -+ return FALSE; \ -+ *va_arg(args, gchar **) = str; \ -+ break; \ -+ } \ -+ case 'J': { \ -+ WpSpaJson *j = wp_spa_json_new (data, len); \ -+ if (!j) \ -+ return FALSE; \ -+ *va_arg(args, WpSpaJson **) = j; \ -+ break; \ -+ } \ -+ default: \ -+ return FALSE; \ -+ } \ -+} while(false) - - /*! - * \brief Parses the object property values of a spa json object -@@ -827,8 +825,7 @@ wp_spa_json_object_get_valist (WpSpaJson *self, va_list args) - value = g_value_get_boxed (&item); - - if (g_strcmp0 (key_str, lookup_key) == 0) { -- if (!wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args)) -- return FALSE; -+ wp_spa_json_parse_value (value->data, value->size, lookup_fmt, args); - lookup_key = va_arg(args, const gchar *); - if (!lookup_key) - return TRUE; -@@ -1366,9 +1363,12 @@ gboolean - wp_spa_json_parser_get_value (WpSpaJsonParser *self, const gchar *fmt, - va_list args) - { -- return wp_spa_json_parser_advance (self) && -- wp_spa_json_parse_value (self->curr.cur, -- self->curr.end - self->curr.cur, fmt, args); -+ if (wp_spa_json_parser_advance (self)) { -+ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur, -+ fmt, args); -+ return TRUE; -+ } -+ return FALSE; - } - - /*! -@@ -1419,9 +1419,13 @@ wp_spa_json_parser_get_valist (WpSpaJsonParser *self, va_list args) - if (!format) - return TRUE; - -- /* parse value */ -- if (!wp_spa_json_parser_get_value (self, format, args)) -+ /* advance */ -+ if (!wp_spa_json_parser_advance (self)) - return FALSE; -+ -+ /* parse value */ -+ wp_spa_json_parse_value (self->curr.cur, self->curr.end - self->curr.cur, -+ format, args); - } while (TRUE); - - return FALSE; --- -2.32.0 - diff --git a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb deleted file mode 100644 index ed7417c280..0000000000 --- a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb +++ /dev/null @@ -1,144 +0,0 @@ -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 \ - file://90-OE-disable-session-dbus-dependent-features.lua \ - file://0001-spa-json-fix-va_list-APIs-for-different-architecture.patch \ - " - -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" - -add_custom_lua_config_scripts() { - install -m 0644 ${WORKDIR}/90-OE-disable-session-dbus-dependent-features.lua ${D}${datadir}/wireplumber/main.lua.d -} - -do_install[postfuncs] += "add_custom_lua_config_scripts" - -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} += " \ - ${datadir}/wireplumber/wireplumber.conf \ - ${datadir}/wireplumber/*.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" diff --git a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.9.bb b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.9.bb new file mode 100644 index 0000000000..0a2ca3b6f7 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.9.bb @@ -0,0 +1,143 @@ +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 = "8b97b40c4467951fbd4181afb47e4175361365a6" +SRC_URI = "git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https \ + file://90-OE-disable-session-dbus-dependent-features.lua \ + " + +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" + +add_custom_lua_config_scripts() { + install -m 0644 ${WORKDIR}/90-OE-disable-session-dbus-dependent-features.lua ${D}${datadir}/wireplumber/main.lua.d +} + +do_install[postfuncs] += "add_custom_lua_config_scripts" + +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} += " \ + ${datadir}/wireplumber/wireplumber.conf \ + ${datadir}/wireplumber/*.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" -- cgit 1.2.3-korg