summaryrefslogtreecommitdiffstats
path: root/meta-multimedia
diff options
context:
space:
mode:
authorCarlos Rafael Giani <crg7475@mailbox.org>2021-03-03 12:41:30 +0100
committerKhem Raj <raj.khem@gmail.com>2021-03-03 11:08:29 -0800
commit39046f1a1d1a93a9976af33ab51626fe02df045e (patch)
treebc50a9e78b42307f5a6aa9931c3d0b4c68b84370 /meta-multimedia
parentd1c756da89a00bc23b7be4a96415ce7b3d0356da (diff)
downloadmeta-openembedded-39046f1a1d1a93a9976af33ab51626fe02df045e.tar.gz
pipewire: Rework 0.3 recipe and upgrade to 0.3.22
* Use a versioned recipe instead of _git * Add more packageconfigs: alsa, docs, sdl2, sndfile, v4l2, pipewire-alsa, pipewire-jack * Split SPA and module packages dynamically to generate one package for each SPA plugin and for each module * Split pipewire library, shim PulseAudio daemon, main tools & SPA tools, pipewire-alsa, pipewire-jack, ALSA card profiles, GStreamer plugin, and example session manager into separate packages * Set up a "pipewire" user and group to run the PipeWire daemon with that user instead of root 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/pipewire/pipewire_0.3.22.bb273
-rw-r--r--meta-multimedia/recipes-multimedia/pipewire/pipewire_git.bb77
2 files changed, 273 insertions, 77 deletions
diff --git a/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.22.bb b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.22.bb
new file mode 100644
index 000000000..b54be7f89
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.22.bb
@@ -0,0 +1,273 @@
1SUMMARY = "Multimedia processing server for Linux"
2DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices"
3HOMEPAGE = "https://pipewire.org/"
4BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues"
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = " \
7 file://LICENSE;md5=e2c0b7d86d04e716a3c4c9ab34260e69 \
8 file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \
9"
10SECTION = "multimedia"
11
12DEPENDS = "dbus"
13
14SRCREV = "22d563720a7f6ba7bdf59950f8c14488d80dfa95"
15SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https"
16
17S = "${WORKDIR}/git"
18
19inherit meson pkgconfig systemd manpages gettext useradd
20
21USERADD_PACKAGES = "${PN}"
22
23GROUPADD_PARAM_${PN} = "--system pipewire"
24
25USERADD_PARAM_${PN} = "--system --home / --no-create-home \
26 --comment 'PipeWire multimedia daemon' \
27 --gid pipewire --groups audio,video \
28 pipewire"
29
30# For "EVL", look up https://evlproject.org/ . It involves
31# a specially prepared kernel, and is currently unavailable
32# in Yocto.
33# FFmpeg and Vulkan aren't really supported - at the current
34# stage (version 0.3.22), these are just experiments, not
35# actual features.
36# libcamera support currently does not build successfully.
37# systemd user service files are disabled because per-user
38# PipeWire instances aren't really something that makes
39# much sense in an embedded environment. A system-wide
40# instance does.
41EXTRA_OEMESON += " \
42 -Daudiotestsrc=true \
43 -Devl=false \
44 -Dsystemd-user-service=false \
45 -Dtests=false \
46 -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \
47 -Dvideotestsrc=true \
48 -Dffmpeg=false \
49 -Dvulkan=false \
50 -Dlibcamera=false \
51"
52
53PACKAGECONFIG ??= "\
54 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
55 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \
56 gstreamer jack v4l2 \
57"
58
59# "jack" and "pipewire-jack" packageconfigs cannot be both enabled,
60# since "jack" imports libjack, and "pipewire-jack" generates
61# libjack.so* files, thus colliding with the libpack package. This
62# is why these two are marked in their respective packageconfigs
63# as being in conflict.
64
65PACKAGECONFIG[alsa] = "-Dalsa=true,-Dalsa=false,alsa-lib udev"
66PACKAGECONFIG[bluez] = "-Dbluez5=true,-Dbluez5=false,bluez5 sbc"
67PACKAGECONFIG[docs] = "-Ddocs=true,-Ddocs=false,doxygen"
68PACKAGECONFIG[gstreamer] = "-Dgstreamer=true,-Dgstreamer=false,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
69PACKAGECONFIG[jack] = "-Djack=true,-Djack=false,jack,,,pipewire-jack"
70PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxml-parser-perl-native"
71PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2"
72PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
73PACKAGECONFIG[systemd] = "-Dsystemd=true -Dsystemd-system-service=true ,-Dsystemd=false -Dsystemd-system-service=false,systemd"
74PACKAGECONFIG[v4l2] = "-Dv4l2=true,-Dv4l2=false,udev"
75PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=true,-Dpipewire-alsa=false,alsa-lib"
76PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=true -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=false,jack,,,jack"
77
78PACKAGESPLITFUNCS_prepend = " split_dynamic_packages "
79PACKAGESPLITFUNCS_append = " set_dynamic_metapkg_rdepends "
80
81SPA_SUBDIR = "spa-0.2"
82PW_MODULE_SUBDIR = "pipewire-0.3"
83
84remove_unused_installed_files() {
85 # jack.conf is used by pipewire-jack (not the JACK SPA plugin).
86 # Remove it if pipewire-jack is not built to avoid creating the
87 # pipewire-jack package.
88 if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then
89 rm -f "${D}${sysconfdir}/pipewire/jack.conf"
90 fi
91}
92
93do_install[postfuncs] += "remove_unused_installed_files"
94
95python split_dynamic_packages () {
96 # Create packages for each SPA plugin. These plugins are located
97 # in individual subdirectories, so a recursive search is needed.
98 spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}')
99 do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True)
100
101 # Create packages for each PipeWire module.
102 pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}')
103 do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False)
104}
105
106python set_dynamic_metapkg_rdepends () {
107 import os
108 import oe.utils
109
110 # Go through all generated SPA plugin and PipeWire module packages
111 # (excluding the main package and the -meta package itself) and
112 # add them to the -meta package as RDEPENDS.
113
114 base_pn = d.getVar('PN')
115
116 spa_pn = base_pn + '-spa-plugins'
117 spa_metapkg = spa_pn + '-meta'
118
119 pw_module_pn = base_pn + '-modules'
120 pw_module_metapkg = pw_module_pn + '-meta'
121
122 d.setVar('ALLOW_EMPTY_' + spa_metapkg, "1")
123 d.setVar('FILES_' + spa_metapkg, "")
124
125 d.setVar('ALLOW_EMPTY_' + pw_module_metapkg, "1")
126 d.setVar('FILES_' + pw_module_metapkg, "")
127
128 blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ]
129 spa_metapkg_rdepends = []
130 pw_module_metapkg_rdepends = []
131 pkgdest = d.getVar('PKGDEST')
132
133 for pkg in oe.utils.packages_filter_out_system(d):
134 if pkg in blacklist:
135 continue
136
137 is_spa_pkg = pkg.startswith(spa_pn)
138 is_pw_module_pkg = pkg.startswith(pw_module_pn)
139 if not is_spa_pkg and not is_pw_module_pkg:
140 continue
141
142 if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends:
143 continue
144
145 # See if the package is empty by looking at the contents of its
146 # PKGDEST subdirectory. If this subdirectory is empty, then then
147 # package is empty as well. Empty packages do not get added to
148 # the meta package's RDEPENDS.
149 pkgdir = os.path.join(pkgdest, pkg)
150 if os.path.exists(pkgdir):
151 dir_contents = os.listdir(pkgdir) or []
152 else:
153 dir_contents = []
154 is_empty = len(dir_contents) == 0
155 if not is_empty:
156 if is_spa_pkg:
157 spa_metapkg_rdepends.append(pkg)
158 if is_pw_module_pkg:
159 pw_module_metapkg_rdepends.append(pkg)
160
161 d.setVar('RDEPENDS_' + spa_metapkg, ' '.join(spa_metapkg_rdepends))
162 d.setVar('DESCRIPTION_' + spa_metapkg, spa_pn + ' meta package')
163
164 d.setVar('RDEPENDS_' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends))
165 d.setVar('DESCRIPTION_' + pw_module_metapkg, pw_module_pn + ' meta package')
166}
167
168PACKAGES =+ "\
169 libpipewire \
170 ${PN}-tools \
171 ${PN}-pulse \
172 ${PN}-alsa \
173 ${PN}-jack \
174 ${PN}-media-session \
175 ${PN}-spa-plugins \
176 ${PN}-spa-plugins-meta \
177 ${PN}-spa-tools \
178 ${PN}-modules \
179 ${PN}-modules-meta \
180 ${PN}-alsa-card-profile \
181 gstreamer1.0-pipewire \
182"
183
184PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*"
185
186SYSTEMD_SERVICE_${PN} = "pipewire.service"
187CONFFILES_${PN} += "${sysconfdir}/pipewire/pipewire.conf"
188FILES_${PN} = " \
189 ${sysconfdir}/pipewire/pipewire.conf \
190 ${systemd_user_unitdir}/pipewire.* \
191 ${bindir}/pipewire \
192"
193
194FILES_${PN}-dev += " \
195 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \
196"
197
198CONFFILES_libpipewire += "${sysconfdir}/pipewire/client.conf"
199FILES_libpipewire = " \
200 ${sysconfdir}/pipewire/client.conf \
201 ${libdir}/libpipewire-*.so.* \
202"
203# Add the bare minimum modules and plugins required to be able
204# to use libpipewire. Without these, it is essentially unusable.
205RDEPENDS_libpipewire += " \
206 ${PN}-modules-client-node \
207 ${PN}-modules-protocol-native \
208 ${PN}-spa-plugins-support \
209"
210
211FILES_${PN}-tools = " \
212 ${bindir}/pw-* \
213"
214
215# This is a shim daemon that is intended to be used as a
216# drop-in PulseAudio replacement, providing a pulseaudio-compatible
217# socket that can be used by applications that use libpulse.
218CONFFILES_${PN}-pulse += "${sysconfdir}/pipewire/pipewire-pulse.conf"
219FILES_${PN}-pulse = " \
220 ${sysconfdir}/pipewire/pipewire-pulse.conf \
221 ${systemd_user_unitdir}/pipewire-pulse.* \
222 ${bindir}/pipewire-pulse \
223"
224RDEPENDS_${PN}-pulse += " \
225 ${PN}-modules-protocol-pulse \
226"
227
228# alsa plugin to redirect audio to pipewire
229FILES_${PN}-alsa = "\
230 ${libdir}/alsa-lib/* \
231 ${datadir}/alsa/alsa.conf.d/* \
232"
233
234# jack drop-in libraries to redirect audio to pipewire
235CONFFILES_${PN}-jack = "${sysconfdir}/pipewire/jack.conf"
236FILES_${PN}-jack = "\
237 ${sysconfdir}/pipewire/jack.conf \
238 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \
239"
240
241# Example session manager. Not intended for use in production.
242CONFFILES_${PN}-media-session = "${sysconfdir}/pipewire/media-session.d/*"
243FILES_${PN}-media-session = " \
244 ${bindir}/pipewire-media-session \
245 ${sysconfdir}/pipewire/media-session.d/* \
246"
247RPROVIDES_${PN}-media-session = "virtual/pipewire-sessionmanager"
248
249# Dynamic packages (see set_dynamic_metapkg_rdepends).
250FILES_${PN}-spa-plugins = ""
251RRECOMMENDS_${PN}-spa-plugins += "${PN}-spa-plugins-meta"
252
253FILES_${PN}-spa-tools = " \
254 ${bindir}/spa-* \
255"
256
257# Dynamic packages (see set_dynamic_metapkg_rdepends).
258FILES_${PN}-modules = ""
259RRECOMMENDS_${PN}-modules += "${PN}-modules-meta"
260
261CONFFILES_${PN}-modules-rtkit = "${sysconfdir}/pipewire/client-rt.conf"
262FILES_${PN}-modules-rtkit += " \
263 ${sysconfdir}/pipewire/client-rt.conf \
264 "
265
266FILES_${PN}-alsa-card-profile = " \
267 ${datadir}/alsa-card-profile/* \
268 ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \
269"
270
271FILES_gstreamer1.0-pipewire = " \
272 ${libdir}/gstreamer-1.0/* \
273"
diff --git a/meta-multimedia/recipes-multimedia/pipewire/pipewire_git.bb b/meta-multimedia/recipes-multimedia/pipewire/pipewire_git.bb
deleted file mode 100644
index 173b695e1..000000000
--- a/meta-multimedia/recipes-multimedia/pipewire/pipewire_git.bb
+++ /dev/null
@@ -1,77 +0,0 @@
1SUMMARY = "Multimedia processing server for Linux"
2AUTHOR = "Wim Taymans <wtaymans@redhat.com>"
3HOMEPAGE = "https://pipewire.org"
4SECTION = "multimedia"
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = " \
7 file://LICENSE;md5=e2c0b7d86d04e716a3c4c9ab34260e69 \
8 file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \
9"
10DEPENDS = "alsa-lib dbus udev"
11SRCREV = "74a1632f0720886d5b3b6c23ee8fcd6c03ca7aac"
12PV = "0.3.1"
13
14SRC_URI = "git://github.com/PipeWire/pipewire"
15
16S = "${WORKDIR}/git"
17
18inherit meson pkgconfig systemd manpages
19
20PACKAGECONFIG ??= "\
21 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
22 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio systemd vulkan', d)} \
23 jack gstreamer \
24"
25
26PACKAGECONFIG[bluez] = "-Dbluez5=true,-Dbluez5=false,bluez5 sbc"
27PACKAGECONFIG[jack] = "-Djack=true,-Djack=false,jack"
28PACKAGECONFIG[gstreamer] = "-Dgstreamer=true,-Dgstreamer=false,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
29PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxml-parser-perl-native"
30PACKAGECONFIG[pulseaudio] = "-Dpipewire-pulseaudio=true,-Dpipewire-pulseaudio=false,pulseaudio"
31PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
32PACKAGECONFIG[vulkan] = "-Dvulkan=true,-Dvulkan=false,vulkan-loader"
33
34LDFLAGS_append_mipsarch = " -latomic"
35LDFLAGS_append_x86 = " -latomic"
36LDFLAGS_append_riscv32 = " -latomic"
37
38PACKAGES =+ "\
39 ${PN}-spa-plugins \
40 ${PN}-alsa \
41 ${PN}-config \
42 gstreamer1.0-${PN} \
43 lib${PN} \
44 lib${PN}-modules \
45 lib${PN}-jack \
46"
47
48RDEPENDS_lib${PN} += "lib${PN}-modules ${PN}-spa-plugins"
49
50FILES_${PN} = "\
51 ${sysconfdir}/pipewire/pipewire.conf \
52 ${bindir}/pw-* \
53 ${bindir}/pipewire* \
54 ${systemd_user_unitdir}/* \
55"
56FILES_lib${PN} = "\
57 ${libdir}/libpipewire-*.so.* \
58 ${libdir}/libjack-*.so.* \
59 ${libdir}/libpulse-*.so.* \
60"
61FILES_lib${PN}-modules = "\
62 ${libdir}/pipewire-*/* \
63"
64FILES_${PN}-spa-plugins = "\
65 ${bindir}/spa-* \
66 ${libdir}/spa-*/* \
67"
68FILES_${PN}-alsa = "\
69 ${libdir}/alsa-lib/* \
70"
71FILES_gstreamer1.0-${PN} = "\
72 ${libdir}/gstreamer-1.0/* \
73"
74
75CONFFILES_${PN} = "\
76 ${sysconfdir}/pipewire/pipewire.conf \
77"