diff options
author | Carlos Rafael Giani <crg7475@mailbox.org> | 2022-02-08 17:34:40 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-02-08 09:00:19 -0800 |
commit | f754f4c85156c715193a508f1faaddd6d1b4d620 (patch) | |
tree | 658d503538a842c1c443abf767668658333d7da3 /meta-multimedia | |
parent | 687483235b5542401245711cb610ec327b33c403 (diff) | |
download | meta-openembedded-f754f4c85156c715193a508f1faaddd6d1b4d620.tar.gz |
wireplumber: Add recipe
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 <crg7475@mailbox.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
-rw-r--r-- | meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb | 140 |
1 files changed, 140 insertions, 0 deletions
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 0000000000..4d26e33608 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.4.8.bb | |||
@@ -0,0 +1,140 @@ | |||
1 | SUMMARY = "Session / policy manager implementation for PipeWire" | ||
2 | HOMEPAGE = "https://gitlab.freedesktop.org/pipewire/wireplumber" | ||
3 | BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues" | ||
4 | AUTHOR = "George Kiagiadakis <george.kiagiadakis@collabora.com>" | ||
5 | SECTION = "multimedia" | ||
6 | |||
7 | LICENSE = "MIT" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=17d1fe479cdec331eecbc65d26bc7e77" | ||
9 | |||
10 | DEPENDS = "glib-2.0 glib-2.0-native lua pipewire \ | ||
11 | ${@bb.utils.contains("DISTRO_FEATURES", "gobject-introspection-data", "python3-native python3-lxml-native doxygen-native", "", d)} \ | ||
12 | " | ||
13 | |||
14 | SRCREV = "e14bb72dcc85e2130d0ea96768e5ae3b375a041e" | ||
15 | SRC_URI = "git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https \ | ||
16 | " | ||
17 | |||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit meson pkgconfig gobject-introspection systemd | ||
21 | |||
22 | GIR_MESON_ENABLE_FLAG = 'enabled' | ||
23 | GIR_MESON_DISABLE_FLAG = 'disabled' | ||
24 | |||
25 | # Enable system-lua to let wireplumber use OE's lua. | ||
26 | # Documentation needs python-sphinx, which is not in oe-core or meta-python2 for now. | ||
27 | # elogind is not (yet) available in OE, so disable support. | ||
28 | EXTRA_OEMESON += " \ | ||
29 | -Ddoc=disabled \ | ||
30 | -Dsystem-lua=true \ | ||
31 | -Delogind=disabled \ | ||
32 | -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ | ||
33 | -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ | ||
34 | -Dtests=false \ | ||
35 | " | ||
36 | |||
37 | PACKAGECONFIG ??= "\ | ||
38 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service', '', d)} \ | ||
39 | " | ||
40 | |||
41 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" | ||
42 | PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=true,-Dsystemd-system-service=false,systemd" | ||
43 | # "systemd-user-service" packageconfig will only install service | ||
44 | # files to rootfs but not enable them as systemd.bbclass | ||
45 | # currently lacks the feature of enabling user services. | ||
46 | PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=true,-Dsystemd-user-service=false,systemd" | ||
47 | |||
48 | PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " | ||
49 | PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " | ||
50 | |||
51 | WP_MODULE_SUBDIR = "wireplumber-0.4" | ||
52 | |||
53 | python split_dynamic_packages () { | ||
54 | # Create packages for each WirePlumber module. | ||
55 | wp_module_libdir = d.expand('${libdir}/${WP_MODULE_SUBDIR}') | ||
56 | do_split_packages(d, wp_module_libdir, r'^libwireplumber-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'WirePlumber %s module', extra_depends='', recursive=False) | ||
57 | } | ||
58 | |||
59 | python set_dynamic_metapkg_rdepends () { | ||
60 | import os | ||
61 | import oe.utils | ||
62 | |||
63 | # Go through all generated WirePlumber module packages | ||
64 | # (excluding the main package and the -meta package itself) | ||
65 | # and add them to the -meta package as RDEPENDS. | ||
66 | |||
67 | base_pn = d.getVar('PN') | ||
68 | |||
69 | wp_module_pn = base_pn + '-modules' | ||
70 | wp_module_metapkg = wp_module_pn + '-meta' | ||
71 | |||
72 | d.setVar('ALLOW_EMPTY:' + wp_module_metapkg, "1") | ||
73 | d.setVar('FILES:' + wp_module_metapkg, "") | ||
74 | |||
75 | blacklist = [ wp_module_pn, wp_module_metapkg ] | ||
76 | wp_module_metapkg_rdepends = [] | ||
77 | pkgdest = d.getVar('PKGDEST') | ||
78 | |||
79 | for pkg in oe.utils.packages_filter_out_system(d): | ||
80 | if pkg in blacklist: | ||
81 | continue | ||
82 | |||
83 | is_wp_module_pkg = pkg.startswith(wp_module_pn) | ||
84 | if not is_wp_module_pkg: | ||
85 | continue | ||
86 | |||
87 | if pkg in wp_module_metapkg_rdepends: | ||
88 | continue | ||
89 | |||
90 | # See if the package is empty by looking at the contents of its | ||
91 | # PKGDEST subdirectory. If this subdirectory is empty, then then | ||
92 | # package is empty as well. Empty packages do not get added to | ||
93 | # the meta package's RDEPENDS. | ||
94 | pkgdir = os.path.join(pkgdest, pkg) | ||
95 | if os.path.exists(pkgdir): | ||
96 | dir_contents = os.listdir(pkgdir) or [] | ||
97 | else: | ||
98 | dir_contents = [] | ||
99 | is_empty = len(dir_contents) == 0 | ||
100 | if not is_empty: | ||
101 | if is_wp_module_pkg: | ||
102 | wp_module_metapkg_rdepends.append(pkg) | ||
103 | |||
104 | d.setVar('RDEPENDS:' + wp_module_metapkg, ' '.join(wp_module_metapkg_rdepends)) | ||
105 | d.setVar('DESCRIPTION:' + wp_module_metapkg, wp_module_pn + ' meta package') | ||
106 | } | ||
107 | |||
108 | PACKAGES =+ "\ | ||
109 | libwireplumber \ | ||
110 | ${PN}-default-config \ | ||
111 | ${PN}-scripts \ | ||
112 | ${PN}-modules \ | ||
113 | ${PN}-modules-meta \ | ||
114 | " | ||
115 | |||
116 | PACKAGES_DYNAMIC = "^${PN}-modules.*" | ||
117 | |||
118 | SYSTEMD_SERVICE:${PN} = "wireplumber.service" | ||
119 | CONFFILES:${PN} += " \ | ||
120 | ${sysconfdir}/wireplumber/config.lua \ | ||
121 | ${sysconfdir}/wireplumber/config.lua.d/* \ | ||
122 | " | ||
123 | FILES:${PN} += " \ | ||
124 | ${sysconfdir}/wireplumber/config.lua \ | ||
125 | ${sysconfdir}/wireplumber/config.lua.d/* \ | ||
126 | " | ||
127 | # Add pipewire to RRECOMMENDS, since WirePlumber expects a PipeWire daemon to | ||
128 | # be present. While in theory any application that uses libpipewire can configure | ||
129 | # itself to become a daemon, in practice, the PipeWire daemon is used. | ||
130 | RRECOMMENDS:${PN} += "${PN}-scripts pipewire" | ||
131 | |||
132 | FILES:libwireplumber = " \ | ||
133 | ${libdir}/libwireplumber-*.so.* \ | ||
134 | " | ||
135 | |||
136 | FILES:${PN}-scripts += "${datadir}/wireplumber/scripts/*" | ||
137 | |||
138 | # Dynamic packages (see set_dynamic_metapkg_rdepends). | ||
139 | FILES:${PN}-modules = "" | ||
140 | RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" | ||