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