summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb')
-rw-r--r--meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb392
1 files changed, 392 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb b/meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb
new file mode 100644
index 0000000000..12c0fbfa57
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/pipewire/pipewire_1.2.0.bb
@@ -0,0 +1,392 @@
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"
5SECTION = "multimedia"
6
7LICENSE = "MIT & LGPL-2.1-or-later & GPL-2.0-only"
8LIC_FILES_CHKSUM = " \
9 file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \
10 file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \
11"
12
13DEPENDS = "dbus ncurses"
14
15SRCREV = "7b4c0dd5ecb40e4d2c153699a85c51e1460361e1"
16SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=1.2;protocol=https"
17
18S = "${WORKDIR}/git"
19
20inherit meson pkgconfig systemd gettext useradd
21
22USERADD_PACKAGES = "${PN}"
23
24GROUPADD_PARAM:${PN} = "--system pipewire"
25
26USERADD_PARAM:${PN} = "--system --home / --no-create-home \
27 --comment 'PipeWire multimedia daemon' \
28 --gid pipewire --groups audio,video \
29 pipewire"
30
31SYSTEMD_PACKAGES = "${PN}"
32
33# For "EVL", look up https://evlproject.org/ . It involves
34# a specially prepared kernel, and is currently unavailable
35# in Yocto.
36#
37#
38# manpage generation requires xmltoman, which is not available.
39#
40# The session-managers list specifies which session managers Meson
41# shall download (via git clone) and build as subprojects. In OE,
42# this is not how a session manager should be built. Instead, they
43# should be integrated as separate OE recipes. To prevent PipeWire
44# from using this Meson feature, set an empty list.
45# This does not disable support or the need for session managers,
46# it just prevents this subproject feature.
47#
48# AptX and LDAC are not available in OE. Currently, neither
49# are lv2, ROC, and libmysofa.
50#
51# The RTKit module is deprecated in favor of the newer RT module.
52# It still exists for legacy setups that still include it in
53# their PipeWire configuration files.
54EXTRA_OEMESON += " \
55 -Devl=disabled \
56 -Dtests=disabled \
57 -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \
58 -Dsystemd-system-unit-dir=${systemd_system_unitdir} \
59 -Dsystemd-user-unit-dir=${systemd_user_unitdir} \
60 -Dman=disabled \
61 -Dsession-managers='[]' \
62 -Dlv2=disabled \
63 -Droc=disabled \
64 -Dbluez5-codec-aptx=disabled \
65 -Dbluez5-codec-ldac=disabled \
66 -Dlegacy-rtkit=false \
67 -Dlibmysofa=disabled \
68"
69
70# spa alsa plugin code uses typedef redefinition, which is officially a C11 feature.
71# Pipewire builds with 'c_std=gnu99' by default. Recent versions of gcc don't issue this warning in gnu99
72# mode but it looks like clang still does
73CFLAGS:append = " -Wno-typedef-redefinition"
74
75# Specify linking with -latomic on architectures missing 64bit atomics.
76LDFLAGS += "${@bb.utils.contains_any('TUNE_FEATURES', 'riscv32 armv5 mips ppc32 m32', '-latomic', '', d)}"
77
78# According to wireplumber documentation only one session manager should be installed at a time
79# Possible options are media-session, which has fewer dependencies but is very simple,
80# or wireplumber, which is more powerful.
81PIPEWIRE_SESSION_MANAGER ??= "wireplumber"
82
83FFMPEG_AVAILABLE = "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'ffmpeg', '', d)}"
84BLUETOOTH_AAC = "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'bluez-aac', '', d)}"
85
86PACKAGECONFIG:class-target ??= " \
87 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
88 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez bluez-opus ${BLUETOOTH_AAC}', '', d)} \
89 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service systemd-user-service', '', d)} \
90 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa vulkan pulseaudio', d)} \
91 ${PIPEWIRE_SESSION_MANAGER} \
92 ${FFMPEG_AVAILABLE} avahi flatpak gstreamer gsettings jack libusb pw-cat raop sndfile v4l2 udev volume webrtc-echo-cancelling libcamera readline \
93"
94
95# "jack" and "pipewire-jack" packageconfigs cannot be both enabled,
96# since "jack" imports libjack, and "pipewire-jack" generates
97# libjack.so* files, thus colliding with the libpack package. This
98# is why these two are marked in their respective packageconfigs
99# as being in conflict.
100PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev,,pipewire-alsa pipewire-alsa-card-profile"
101PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi"
102PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc"
103PACKAGECONFIG[bluez-aac] = "-Dbluez5-codec-aac=enabled,-Dbluez5-codec-aac=disabled,fdk-aac"
104PACKAGECONFIG[bluez-opus] = "-Dbluez5-codec-opus=enabled,-Dbluez5-codec-opus=disabled,libopus"
105PACKAGECONFIG[bluez-lc3] = "-Dbluez5-codec-lc3=enabled,-Dbluez5-codec-lc3=disabled,liblc3"
106# From the pipewire git log:
107# "Some Linux phones doesn't use oFono but ModemManager to control the modem."
108# This packageconfig enables modemmanager specific code in the BlueZ backend.
109PACKAGECONFIG[bluez-backend-native-mm] = "-Dbluez5-backend-native-mm=enabled,-Dbluez5-backend-native-mm=disabled,modemmanager"
110PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native graphviz-native"
111PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
112PACKAGECONFIG[flatpak] = "-Dflatpak=enabled,-Dflatpak=disabled,glib-2.0"
113PACKAGECONFIG[gsettings] = "-Dgsettings=enabled,-Dgsettings=disabled,glib-2.0"
114PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base,,gstreamer1.0-pipewire"
115PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack"
116PACKAGECONFIG[libcamera] = "-Dlibcamera=enabled,-Dlibcamera=disabled,libcamera libdrm"
117PACKAGECONFIG[libcanberra] = "-Dlibcanberra=enabled,-Dlibcanberra=disabled,libcanberra"
118PACKAGECONFIG[libusb] = "-Dlibusb=enabled,-Dlibusb=disabled,libusb"
119PACKAGECONFIG[media-session] = ",,,pipewire-media-session,,wireplumber"
120PACKAGECONFIG[pulseaudio] = "-Dlibpulse=enabled,-Dlibpulse=disabled,pulseaudio,,pipewire-pulse"
121PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib"
122PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,pipewire-jack,jack"
123PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled"
124PACKAGECONFIG[raop] = "-Draop=enabled,-Draop=disabled,openssl"
125# Starting with version 0.3.60, readline usage can be turned off in pw-cli.
126# If it is disabled, getline() is used as a fallback.
127PACKAGECONFIG[readline] = "-Dreadline=enabled,-Dreadline=disabled,readline"
128PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,libsdl2"
129PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
130PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd"
131PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=enabled,-Dsystemd-system-service=disabled,systemd"
132# "systemd-user-service" packageconfig will only install service
133# files to rootfs but not enable them as systemd.bbclass
134# currently lacks the feature of enabling user services.
135PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=enabled,-Dsystemd-user-service=disabled,systemd"
136# pw-cat needs sndfile packageconfig to be enabled
137PACKAGECONFIG[udev] = "-Dudev=enabled,-Dudev=disabled,udev"
138PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev"
139PACKAGECONFIG[volume] = "-Dvolume=enabled,-Dvolume=disabled"
140PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-headers vulkan-loader"
141PACKAGECONFIG[webrtc-echo-cancelling] = "-Decho-cancel-webrtc=enabled,-Decho-cancel-webrtc=disabled,webrtc-audio-processing-1"
142PACKAGECONFIG[wireplumber] = ",,,wireplumber,,media-session"
143
144PACKAGESPLITFUNCS:prepend = " split_dynamic_packages "
145PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends "
146
147SPA_SUBDIR = "spa-0.2"
148PW_MODULE_SUBDIR = "pipewire-0.3"
149
150remove_unused_installed_files() {
151 # jack.conf is used by pipewire-jack (not the JACK SPA plugin).
152 # Remove it if pipewire-jack is not built to avoid creating the
153 # pipewire-jack package.
154 if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then
155 rm -f "${D}${datadir}/pipewire/jack.conf"
156 fi
157
158 # minimal.conf is an example of how to minimally configure the
159 # daemon and is not meant to be used for production.
160 rm -f "${D}${datadir}/pipewire/minimal.conf"
161}
162
163do_install[postfuncs] += "remove_unused_installed_files"
164
165python split_dynamic_packages () {
166 # Create packages for each SPA plugin. These plugins are located
167 # in individual subdirectories, so a recursive search is needed.
168 spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}')
169 do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True)
170
171 # Create packages for each PipeWire module.
172 pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}')
173 do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False)
174}
175
176python set_dynamic_metapkg_rdepends () {
177 import os
178 import oe.utils
179
180 if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('native', d):
181 return
182
183 # Go through all generated SPA plugin and PipeWire module packages
184 # (excluding the main package and the -meta package itself) and
185 # add them to the -meta package as RDEPENDS.
186
187 base_pn = d.getVar('PN')
188
189 spa_pn = base_pn + '-spa-plugins'
190 spa_metapkg = spa_pn + '-meta'
191
192 pw_module_pn = base_pn + '-modules'
193 pw_module_metapkg = pw_module_pn + '-meta'
194
195 d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1")
196 d.setVar('FILES:' + spa_metapkg, "")
197
198 d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1")
199 d.setVar('FILES:' + pw_module_metapkg, "")
200
201 blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ]
202 spa_metapkg_rdepends = []
203 pw_module_metapkg_rdepends = []
204 pkgdest = d.getVar('PKGDEST')
205
206 for pkg in oe.utils.packages_filter_out_system(d):
207 if pkg in blacklist:
208 continue
209
210 is_spa_pkg = pkg.startswith(spa_pn)
211 is_pw_module_pkg = pkg.startswith(pw_module_pn)
212 if not is_spa_pkg and not is_pw_module_pkg:
213 continue
214
215 if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends:
216 continue
217
218 # See if the package is empty by looking at the contents of its
219 # PKGDEST subdirectory. If this subdirectory is empty, then then
220 # package is empty as well. Empty packages do not get added to
221 # the meta package's RDEPENDS.
222 pkgdir = os.path.join(pkgdest, pkg)
223 if os.path.exists(pkgdir):
224 dir_contents = os.listdir(pkgdir) or []
225 else:
226 dir_contents = []
227 is_empty = len(dir_contents) == 0
228 if not is_empty:
229 if is_spa_pkg:
230 spa_metapkg_rdepends.append(pkg)
231 if is_pw_module_pkg:
232 pw_module_metapkg_rdepends.append(pkg)
233
234 d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends))
235 d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package')
236
237 d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends))
238 d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package')
239}
240
241PACKAGES =+ "\
242 libpipewire \
243 ${PN}-tools \
244 ${PN}-pulse \
245 ${PN}-alsa \
246 ${PN}-jack \
247 ${PN}-spa-plugins \
248 ${PN}-spa-plugins-meta \
249 ${PN}-spa-tools \
250 ${PN}-modules \
251 ${PN}-modules-meta \
252 ${PN}-alsa-card-profile \
253 ${PN}-v4l2 \
254 ${PN}-aes67 \
255 gstreamer1.0-pipewire \
256"
257
258PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*"
259PACKAGES_DYNAMIC:class-native = ""
260
261SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-service', 'pipewire.service', '', d)}"
262CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf"
263FILES:${PN} = " \
264 ${datadir}/pipewire \
265 ${systemd_system_unitdir}/pipewire* \
266 ${systemd_user_unitdir} \
267 ${bindir}/pipewire \
268 ${bindir}/pipewire-avb \
269 ${bindir}/pipewire-vulkan \
270"
271
272RRECOMMENDS:${PN}:class-target += " \
273 pipewire-modules-meta \
274 pipewire-spa-plugins-meta \
275"
276
277FILES:${PN}-dev += " \
278 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \
279"
280
281CONFFILES:libpipewire += "${datadir}/pipewire/client.conf"
282FILES:libpipewire = " \
283 ${datadir}/pipewire/client.conf \
284 ${libdir}/libpipewire-*.so.* \
285"
286# Add the bare minimum modules and plugins required to be able
287# to use libpipewire. Without these, it is essentially unusable.
288RDEPENDS:libpipewire += " \
289 ${PN}-modules-client-node \
290 ${PN}-modules-protocol-native \
291 ${PN}-spa-plugins-support \
292"
293
294FILES:${PN}-tools = " \
295 ${bindir}/pw-cat \
296 ${bindir}/pw-cli \
297 ${bindir}/pw-config \
298 ${bindir}/pw-container \
299 ${bindir}/pw-dot \
300 ${bindir}/pw-dsdplay \
301 ${bindir}/pw-dump \
302 ${bindir}/pw-encplay \
303 ${bindir}/pw-link \
304 ${bindir}/pw-loopback \
305 ${bindir}/pw-metadata \
306 ${bindir}/pw-mididump \
307 ${bindir}/pw-midiplay \
308 ${bindir}/pw-midirecord \
309 ${bindir}/pw-mon \
310 ${bindir}/pw-play \
311 ${bindir}/pw-profiler \
312 ${bindir}/pw-record \
313 ${bindir}/pw-reserve \
314 ${bindir}/pw-top \
315"
316
317# This is a shim daemon that is intended to be used as a
318# drop-in PulseAudio replacement, providing a pulseaudio-compatible
319# socket that can be used by applications that use libpulse.
320CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf"
321FILES:${PN}-pulse = " \
322 ${datadir}/pipewire/pipewire-pulse.conf \
323 ${systemd_system_unitdir}/pipewire-pulse.* \
324 ${systemd_user_unitdir}/pipewire-pulse.* \
325 ${bindir}/pipewire-pulse \
326"
327RDEPENDS:${PN}-pulse += " \
328 ${PN}-modules-protocol-pulse \
329"
330
331# ALSA plugin to redirect audio to pipewire.
332FILES:${PN}-alsa = "\
333 ${libdir}/alsa-lib/* \
334 ${datadir}/alsa/alsa.conf.d/* \
335"
336
337# JACK drop-in libraries to redirect audio to pipewire.
338CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf"
339FILES:${PN}-jack = "\
340 ${bindir}/pw-jack \
341 ${datadir}/pipewire/jack.conf \
342 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \
343"
344
345# Dynamic SPA plugin packages (see set_dynamic_metapkg_rdepends).
346FILES:${PN}-spa-plugins = ""
347RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta"
348
349FILES:${PN}-spa-plugins-bluez5 += " \
350 ${datadir}/${SPA_SUBDIR}/bluez5/* \
351"
352
353FILES:${PN}-spa-tools = " \
354 ${bindir}/spa-* \
355"
356
357# Dynamic PipeWire module packages (see set_dynamic_metapkg_rdepends).
358FILES:${PN}-modules = ""
359RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"
360
361CONFFILES:${PN}-modules-rt = "${datadir}/pipewire/client-rt.conf"
362FILES:${PN}-modules-rt += " \
363 ${datadir}/pipewire/client-rt.conf \
364 ${sysconfdir}/security/limits.d/* \
365 "
366
367CONFFILES:${PN}-modules-filter-chain = "${datadir}/pipewire/filter-chain/*"
368FILES:${PN}-modules-filter-chain += " \
369 ${datadir}/pipewire/filter-chain/* \
370"
371
372FILES:${PN}-alsa-card-profile = " \
373 ${datadir}/alsa-card-profile/* \
374 ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \
375"
376
377# V4L2 interface emulator for sending/receiving data between PipeWire and V4L2 applications.
378FILES:${PN}-v4l2 += " \
379 ${bindir}/pw-v4l2 \
380 ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \
381"
382
383# AES67 is a standard for audio over IP, from the Audio Engineering Society (AES).
384FILES:${PN}-aes67 += " \
385 ${bindir}/pipewire-aes67 \
386"
387
388FILES:gstreamer1.0-pipewire = " \
389 ${libdir}/gstreamer-1.0/* \
390"
391
392BBCLASSEXTEND = "native nativesdk"