blob: 0d725b9ee200f2a7a847b649346488f1b8f9f3c5 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "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"
5AUTHOR = "Wim Taymans <wtaymans@redhat.com>"
6SECTION = "multimedia"
7
8LICENSE = "MIT & LGPL-2.1-or-later & GPL-2.0-only"
9LIC_FILES_CHKSUM = " \
10 file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \
11 file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \
12"
13
14DEPENDS = "dbus ncurses"
15
Patrick Williams03907ee2022-05-01 06:28:52 -050016SRCREV = "64cf5e80e6240284e6b757907b900507fe56f1b5"
17SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000018
19S = "${WORKDIR}/git"
20
21inherit meson pkgconfig systemd gettext useradd
22
23USERADD_PACKAGES = "${PN}"
24
25GROUPADD_PARAM:${PN} = "--system pipewire"
26
27USERADD_PARAM:${PN} = "--system --home / --no-create-home \
28 --comment 'PipeWire multimedia daemon' \
29 --gid pipewire --groups audio,video \
30 pipewire"
31
32SYSTEMD_PACKAGES = "${PN}"
33
34# For "EVL", look up https://evlproject.org/ . It involves
35# a specially prepared kernel, and is currently unavailable
36# in Yocto.
37#
38# Vulkan support is currently (as of version 0.3.44) not functional.
39#
40# manpage generation requires xmltoman, which is not available.
41#
42# The session-managers list specifies which session managers Meson
43# shall download (via git clone) and build as subprojects. In OE,
44# this is not how a session manager should be built. Instead, they
45# should be integrated as separate OE recipes. To prevent PipeWire
46# from using this Meson feature, set an empty list.
47# This does not disable support or the need for session managers,
48# it just prevents this subproject feature.
49#
50# AptX and LDAC are not available in OE. Currently, neither
51# are lv2 and ROC.
Patrick Williams45852732022-04-02 08:58:32 -050052#
53# The RTKit module is deprecated in favor of the newer RT module.
54# It still exists for legacy setups that still include it in
55# their PipeWire configuration files.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000056EXTRA_OEMESON += " \
57 -Devl=disabled \
58 -Dtests=disabled \
59 -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \
60 -Dsystemd-system-unit-dir=${systemd_system_unitdir} \
61 -Dsystemd-user-unit-dir=${systemd_user_unitdir} \
62 -Dvulkan=disabled \
63 -Dman=disabled \
64 -Dsession-managers='[]' \
65 -Dlv2=disabled \
66 -Droc=disabled \
67 -Dbluez5-codec-aptx=disabled \
68 -Dbluez5-codec-ldac=disabled \
Patrick Williams45852732022-04-02 08:58:32 -050069 -Dlegacy-rtkit=false \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000070"
71
72PACKAGECONFIG ??= "\
73 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
74 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
75 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service', '', d)} \
76 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)} \
77 gstreamer jack libusb pw-cat raop sndfile v4l2 \
78"
79
80# "jack" and "pipewire-jack" packageconfigs cannot be both enabled,
81# since "jack" imports libjack, and "pipewire-jack" generates
82# libjack.so* files, thus colliding with the libpack package. This
83# is why these two are marked in their respective packageconfigs
84# as being in conflict.
85PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev"
86PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi"
87PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc"
88PACKAGECONFIG[bluez-aac] = "-Dbluez5-codec-aac=enabled,-Dbluez5-codec-aac=disabled,fdk-aac"
89PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native graphviz-native"
90PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg"
91PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
92PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack"
93PACKAGECONFIG[libcamera] = "-Dlibcamera=enabled,-Dlibcamera=disabled,libcamera"
94PACKAGECONFIG[libcanberra] = "-Dlibcanberra=enabled,-Dlibcanberra=disabled,libcanberra"
95PACKAGECONFIG[libusb] = "-Dlibusb=enabled,-Dlibusb=disabled,libusb"
96PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib"
97PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack"
98PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled"
99PACKAGECONFIG[raop] = "-Draop=enabled,-Draop=disabled,openssl"
100PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2"
101PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
102PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd"
103PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=enabled,-Dsystemd-system-service=disabled,systemd"
104# "systemd-user-service" packageconfig will only install service
105# files to rootfs but not enable them as systemd.bbclass
106# currently lacks the feature of enabling user services.
107PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=enabled,-Dsystemd-user-service=disabled,systemd"
108# pw-cat needs sndfile packageconfig to be enabled
109PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev"
110PACKAGECONFIG[webrtc-echo-cancelling] = "-Decho-cancel-webrtc=enabled,-Decho-cancel-webrtc=disabled,webrtc-audio-processing"
111
112PACKAGESPLITFUNCS:prepend = " split_dynamic_packages "
113PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends "
114
115SPA_SUBDIR = "spa-0.2"
116PW_MODULE_SUBDIR = "pipewire-0.3"
117
118remove_unused_installed_files() {
119 # jack.conf is used by pipewire-jack (not the JACK SPA plugin).
120 # Remove it if pipewire-jack is not built to avoid creating the
121 # pipewire-jack package.
122 if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then
123 rm -f "${D}${datadir}/pipewire/jack.conf"
124 fi
125
126 # minimal.conf is an example of how to minimally configure the
127 # daemon and is not meant to be used for production.
128 rm -f "${D}${datadir}/pipewire/minimal.conf"
129}
130
131do_install[postfuncs] += "remove_unused_installed_files"
132
133python split_dynamic_packages () {
134 # Create packages for each SPA plugin. These plugins are located
135 # in individual subdirectories, so a recursive search is needed.
136 spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}')
137 do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True)
138
139 # Create packages for each PipeWire module.
140 pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}')
141 do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False)
142}
143
144python set_dynamic_metapkg_rdepends () {
145 import os
146 import oe.utils
147
148 # Go through all generated SPA plugin and PipeWire module packages
149 # (excluding the main package and the -meta package itself) and
150 # add them to the -meta package as RDEPENDS.
151
152 base_pn = d.getVar('PN')
153
154 spa_pn = base_pn + '-spa-plugins'
155 spa_metapkg = spa_pn + '-meta'
156
157 pw_module_pn = base_pn + '-modules'
158 pw_module_metapkg = pw_module_pn + '-meta'
159
160 d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1")
161 d.setVar('FILES:' + spa_metapkg, "")
162
163 d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1")
164 d.setVar('FILES:' + pw_module_metapkg, "")
165
166 blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ]
167 spa_metapkg_rdepends = []
168 pw_module_metapkg_rdepends = []
169 pkgdest = d.getVar('PKGDEST')
170
171 for pkg in oe.utils.packages_filter_out_system(d):
172 if pkg in blacklist:
173 continue
174
175 is_spa_pkg = pkg.startswith(spa_pn)
176 is_pw_module_pkg = pkg.startswith(pw_module_pn)
177 if not is_spa_pkg and not is_pw_module_pkg:
178 continue
179
180 if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends:
181 continue
182
183 # See if the package is empty by looking at the contents of its
184 # PKGDEST subdirectory. If this subdirectory is empty, then then
185 # package is empty as well. Empty packages do not get added to
186 # the meta package's RDEPENDS.
187 pkgdir = os.path.join(pkgdest, pkg)
188 if os.path.exists(pkgdir):
189 dir_contents = os.listdir(pkgdir) or []
190 else:
191 dir_contents = []
192 is_empty = len(dir_contents) == 0
193 if not is_empty:
194 if is_spa_pkg:
195 spa_metapkg_rdepends.append(pkg)
196 if is_pw_module_pkg:
197 pw_module_metapkg_rdepends.append(pkg)
198
199 d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends))
200 d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package')
201
202 d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends))
203 d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package')
204}
205
206PACKAGES =+ "\
207 libpipewire \
208 ${PN}-tools \
209 ${PN}-pulse \
210 ${PN}-alsa \
211 ${PN}-jack \
212 ${PN}-spa-plugins \
213 ${PN}-spa-plugins-meta \
214 ${PN}-spa-tools \
215 ${PN}-modules \
216 ${PN}-modules-meta \
217 ${PN}-alsa-card-profile \
218 ${PN}-v4l2 \
219 gstreamer1.0-pipewire \
220"
221
222PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*"
223
224SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-service', 'pipewire.service', '', d)}"
225CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf"
226FILES:${PN} = " \
227 ${datadir}/pipewire/pipewire.conf \
228 ${systemd_system_unitdir}/pipewire.* \
229 ${systemd_user_unitdir}/pipewire.* \
230 ${bindir}/pipewire \
231"
232
233FILES:${PN}-dev += " \
234 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \
235"
236
237CONFFILES:libpipewire += "${datadir}/pipewire/client.conf"
238FILES:libpipewire = " \
239 ${datadir}/pipewire/client.conf \
240 ${libdir}/libpipewire-*.so.* \
241"
242# Add the bare minimum modules and plugins required to be able
243# to use libpipewire. Without these, it is essentially unusable.
244RDEPENDS:libpipewire += " \
245 ${PN}-modules-client-node \
246 ${PN}-modules-protocol-native \
247 ${PN}-spa-plugins-support \
248"
249
250FILES:${PN}-tools = " \
251 ${bindir}/pw-cat \
252 ${bindir}/pw-cli \
253 ${bindir}/pw-dot \
254 ${bindir}/pw-dsdplay \
255 ${bindir}/pw-dump \
256 ${bindir}/pw-link \
257 ${bindir}/pw-loopback \
258 ${bindir}/pw-metadata \
259 ${bindir}/pw-mididump \
260 ${bindir}/pw-midiplay \
261 ${bindir}/pw-midirecord \
262 ${bindir}/pw-mon \
263 ${bindir}/pw-play \
264 ${bindir}/pw-profiler \
265 ${bindir}/pw-record \
266 ${bindir}/pw-reserve \
267 ${bindir}/pw-top \
268"
269
270# This is a shim daemon that is intended to be used as a
271# drop-in PulseAudio replacement, providing a pulseaudio-compatible
272# socket that can be used by applications that use libpulse.
273CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf"
274FILES:${PN}-pulse = " \
275 ${datadir}/pipewire/pipewire-pulse.conf \
276 ${systemd_system_unitdir}/pipewire-pulse.* \
277 ${systemd_user_unitdir}/pipewire-pulse.* \
278 ${bindir}/pipewire-pulse \
279"
280RDEPENDS:${PN}-pulse += " \
281 ${PN}-modules-protocol-pulse \
282"
283
284# ALSA plugin to redirect audio to pipewire.
285FILES:${PN}-alsa = "\
286 ${libdir}/alsa-lib/* \
287 ${datadir}/alsa/alsa.conf.d/* \
288"
289
290# JACK drop-in libraries to redirect audio to pipewire.
291CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf"
292FILES:${PN}-jack = "\
293 ${bindir}/pw-jack \
294 ${datadir}/pipewire/jack.conf \
295 ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \
296"
297
298# Dynamic SPA plugin packages (see set_dynamic_metapkg_rdepends).
299FILES:${PN}-spa-plugins = ""
300RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta"
301
302FILES:${PN}-spa-plugins-bluez5 += " \
303 ${datadir}/${SPA_SUBDIR}/bluez5/* \
304"
305
306FILES:${PN}-spa-tools = " \
307 ${bindir}/spa-* \
308"
309
310# Dynamic PipeWire module packages (see set_dynamic_metapkg_rdepends).
311FILES:${PN}-modules = ""
312RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"
313
Patrick Williams45852732022-04-02 08:58:32 -0500314CONFFILES:${PN}-modules-rt = "${datadir}/pipewire/client-rt.conf"
315FILES:${PN}-modules-rt += " \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000316 ${datadir}/pipewire/client-rt.conf \
317 "
318
319CONFFILES:${PN}-modules-filter-chain = "${datadir}/pipewire/filter-chain/*"
320FILES:${PN}-modules-filter-chain += " \
321 ${datadir}/pipewire/filter-chain/* \
322"
323
324FILES:${PN}-alsa-card-profile = " \
325 ${datadir}/alsa-card-profile/* \
326 ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \
327"
328
329# V4L2 interface emulator for sending/receiving data between PipeWire and V4L2 applications.
330FILES:${PN}-v4l2 += " \
331 ${bindir}/pw-v4l2 \
332 ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \
333"
334
335FILES:gstreamer1.0-pipewire = " \
336 ${libdir}/gstreamer-1.0/* \
337"