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