diff options
Diffstat (limited to 'meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.56.bb')
-rw-r--r-- | meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.56.bb | 367 |
1 files changed, 367 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.56.bb b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.56.bb new file mode 100644 index 0000000000..6c88e99f92 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/pipewire/pipewire_0.3.56.bb | |||
@@ -0,0 +1,367 @@ | |||
1 | SUMMARY = "Multimedia processing server for Linux" | ||
2 | DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices" | ||
3 | HOMEPAGE = "https://pipewire.org/" | ||
4 | BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues" | ||
5 | AUTHOR = "Wim Taymans <wtaymans@redhat.com>" | ||
6 | SECTION = "multimedia" | ||
7 | |||
8 | LICENSE = "MIT & LGPL-2.1-or-later & GPL-2.0-only" | ||
9 | LIC_FILES_CHKSUM = " \ | ||
10 | file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \ | ||
11 | file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \ | ||
12 | " | ||
13 | |||
14 | DEPENDS = "dbus ncurses" | ||
15 | |||
16 | SRCREV = "f274e53d25ee8f483ac6fce9e516bb1830abe88b" | ||
17 | SRC_URI = " \ | ||
18 | git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https \ | ||
19 | file://0001-avb-fix-compilation-on-big-endian.patch \ | ||
20 | " | ||
21 | |||
22 | S = "${WORKDIR}/git" | ||
23 | |||
24 | inherit meson pkgconfig systemd gettext useradd | ||
25 | |||
26 | USERADD_PACKAGES = "${PN}" | ||
27 | |||
28 | GROUPADD_PARAM:${PN} = "--system pipewire" | ||
29 | |||
30 | USERADD_PARAM:${PN} = "--system --home / --no-create-home \ | ||
31 | --comment 'PipeWire multimedia daemon' \ | ||
32 | --gid pipewire --groups audio,video \ | ||
33 | pipewire" | ||
34 | |||
35 | SYSTEMD_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. | ||
55 | # | ||
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. | ||
59 | EXTRA_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 | -Dman=disabled \ | ||
66 | -Dsession-managers='[]' \ | ||
67 | -Dlv2=disabled \ | ||
68 | -Droc=disabled \ | ||
69 | -Dbluez5-codec-aptx=disabled \ | ||
70 | -Dbluez5-codec-ldac=disabled \ | ||
71 | -Dlegacy-rtkit=false \ | ||
72 | " | ||
73 | |||
74 | # spa alsa plugin code uses typedef redefinition, which is officially a C11 feature. | ||
75 | # Pipewire builds with 'c_std=gnu99' by default. Recent versions of gcc don't issue this warning in gnu99 | ||
76 | # mode but it looks like clang still does | ||
77 | CFLAGS:append = " -Wno-typedef-redefinition" | ||
78 | |||
79 | # According to wireplumber documentation only one session manager should be installed at a time | ||
80 | # Possible options are media-session, which has fewer dependencies but is very simple, | ||
81 | # or wireplumber, which is more powerful. | ||
82 | PIPEWIRE_SESSION_MANAGER ??= "media-session" | ||
83 | |||
84 | FFMPEG_AVAILABLE = "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'ffmpeg', '', d)}" | ||
85 | BLUETOOTH_AAC = "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'bluez-aac', '', d)}" | ||
86 | |||
87 | PACKAGECONFIG:class-target ??= " \ | ||
88 | ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ | ||
89 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez ${BLUETOOTH_AAC}', '', d)} \ | ||
90 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service systemd-user-service', '', d)} \ | ||
91 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa vulkan pulseaudio', d)} \ | ||
92 | ${PIPEWIRE_SESSION_MANAGER} \ | ||
93 | ${FFMPEG_AVAILABLE} gstreamer jack libusb pw-cat raop sndfile v4l2 udev volume \ | ||
94 | " | ||
95 | |||
96 | # "jack" and "pipewire-jack" packageconfigs cannot be both enabled, | ||
97 | # since "jack" imports libjack, and "pipewire-jack" generates | ||
98 | # libjack.so* files, thus colliding with the libpack package. This | ||
99 | # is why these two are marked in their respective packageconfigs | ||
100 | # as being in conflict. | ||
101 | PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev,,pipewire-alsa pipewire-alsa-card-profile" | ||
102 | PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi" | ||
103 | PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" | ||
104 | PACKAGECONFIG[bluez-aac] = "-Dbluez5-codec-aac=enabled,-Dbluez5-codec-aac=disabled,fdk-aac" | ||
105 | PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native graphviz-native" | ||
106 | PACKAGECONFIG[ffmpeg] = "-Dffmpeg=enabled,-Dffmpeg=disabled,ffmpeg" | ||
107 | PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base,,gstreamer1.0-pipewire" | ||
108 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack" | ||
109 | PACKAGECONFIG[libcamera] = "-Dlibcamera=enabled,-Dlibcamera=disabled,libcamera libdrm" | ||
110 | PACKAGECONFIG[libcanberra] = "-Dlibcanberra=enabled,-Dlibcanberra=disabled,libcanberra" | ||
111 | PACKAGECONFIG[libusb] = "-Dlibusb=enabled,-Dlibusb=disabled,libusb" | ||
112 | PACKAGECONFIG[media-session] = ",,,pipewire-media-session" | ||
113 | PACKAGECONFIG[pulseaudio] = "-Dlibpulse=enabled,-Dlibpulse=disabled,pulseaudio,,pipewire-pulse" | ||
114 | PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib" | ||
115 | PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack" | ||
116 | PACKAGECONFIG[pw-cat] = "-Dpw-cat=enabled,-Dpw-cat=disabled" | ||
117 | PACKAGECONFIG[raop] = "-Draop=enabled,-Draop=disabled,openssl" | ||
118 | PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,libsdl2" | ||
119 | PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1" | ||
120 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" | ||
121 | PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=enabled,-Dsystemd-system-service=disabled,systemd" | ||
122 | # "systemd-user-service" packageconfig will only install service | ||
123 | # files to rootfs but not enable them as systemd.bbclass | ||
124 | # currently lacks the feature of enabling user services. | ||
125 | PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=enabled,-Dsystemd-user-service=disabled,systemd" | ||
126 | # pw-cat needs sndfile packageconfig to be enabled | ||
127 | PACKAGECONFIG[udev] = "-Dudev=enabled,-Dudev=disabled,udev" | ||
128 | PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev" | ||
129 | PACKAGECONFIG[volume] = "-Dvolume=enabled,-Dvolume=disabled" | ||
130 | PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-headers vulkan-loader" | ||
131 | PACKAGECONFIG[webrtc-echo-cancelling] = "-Decho-cancel-webrtc=enabled,-Decho-cancel-webrtc=disabled,webrtc-audio-processing" | ||
132 | PACKAGECONFIG[wireplumber] = ",,,wireplumber" | ||
133 | |||
134 | PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " | ||
135 | PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " | ||
136 | |||
137 | SPA_SUBDIR = "spa-0.2" | ||
138 | PW_MODULE_SUBDIR = "pipewire-0.3" | ||
139 | |||
140 | remove_unused_installed_files() { | ||
141 | # jack.conf is used by pipewire-jack (not the JACK SPA plugin). | ||
142 | # Remove it if pipewire-jack is not built to avoid creating the | ||
143 | # pipewire-jack package. | ||
144 | if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then | ||
145 | rm -f "${D}${datadir}/pipewire/jack.conf" | ||
146 | fi | ||
147 | |||
148 | # minimal.conf is an example of how to minimally configure the | ||
149 | # daemon and is not meant to be used for production. | ||
150 | rm -f "${D}${datadir}/pipewire/minimal.conf" | ||
151 | } | ||
152 | |||
153 | do_install[postfuncs] += "remove_unused_installed_files" | ||
154 | |||
155 | python split_dynamic_packages () { | ||
156 | # Create packages for each SPA plugin. These plugins are located | ||
157 | # in individual subdirectories, so a recursive search is needed. | ||
158 | spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}') | ||
159 | do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True) | ||
160 | |||
161 | # Create packages for each PipeWire module. | ||
162 | pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}') | ||
163 | do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False) | ||
164 | } | ||
165 | |||
166 | python set_dynamic_metapkg_rdepends () { | ||
167 | import os | ||
168 | import oe.utils | ||
169 | |||
170 | # Go through all generated SPA plugin and PipeWire module packages | ||
171 | # (excluding the main package and the -meta package itself) and | ||
172 | # add them to the -meta package as RDEPENDS. | ||
173 | |||
174 | base_pn = d.getVar('PN') | ||
175 | |||
176 | spa_pn = base_pn + '-spa-plugins' | ||
177 | spa_metapkg = spa_pn + '-meta' | ||
178 | |||
179 | pw_module_pn = base_pn + '-modules' | ||
180 | pw_module_metapkg = pw_module_pn + '-meta' | ||
181 | |||
182 | d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1") | ||
183 | d.setVar('FILES:' + spa_metapkg, "") | ||
184 | |||
185 | d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1") | ||
186 | d.setVar('FILES:' + pw_module_metapkg, "") | ||
187 | |||
188 | blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ] | ||
189 | spa_metapkg_rdepends = [] | ||
190 | pw_module_metapkg_rdepends = [] | ||
191 | pkgdest = d.getVar('PKGDEST') | ||
192 | |||
193 | for pkg in oe.utils.packages_filter_out_system(d): | ||
194 | if pkg in blacklist: | ||
195 | continue | ||
196 | |||
197 | is_spa_pkg = pkg.startswith(spa_pn) | ||
198 | is_pw_module_pkg = pkg.startswith(pw_module_pn) | ||
199 | if not is_spa_pkg and not is_pw_module_pkg: | ||
200 | continue | ||
201 | |||
202 | if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends: | ||
203 | continue | ||
204 | |||
205 | # See if the package is empty by looking at the contents of its | ||
206 | # PKGDEST subdirectory. If this subdirectory is empty, then then | ||
207 | # package is empty as well. Empty packages do not get added to | ||
208 | # the meta package's RDEPENDS. | ||
209 | pkgdir = os.path.join(pkgdest, pkg) | ||
210 | if os.path.exists(pkgdir): | ||
211 | dir_contents = os.listdir(pkgdir) or [] | ||
212 | else: | ||
213 | dir_contents = [] | ||
214 | is_empty = len(dir_contents) == 0 | ||
215 | if not is_empty: | ||
216 | if is_spa_pkg: | ||
217 | spa_metapkg_rdepends.append(pkg) | ||
218 | if is_pw_module_pkg: | ||
219 | pw_module_metapkg_rdepends.append(pkg) | ||
220 | |||
221 | d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends)) | ||
222 | d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package') | ||
223 | |||
224 | d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends)) | ||
225 | d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package') | ||
226 | } | ||
227 | |||
228 | PACKAGES =+ "\ | ||
229 | libpipewire \ | ||
230 | ${PN}-tools \ | ||
231 | ${PN}-pulse \ | ||
232 | ${PN}-alsa \ | ||
233 | ${PN}-jack \ | ||
234 | ${PN}-spa-plugins \ | ||
235 | ${PN}-spa-plugins-meta \ | ||
236 | ${PN}-spa-tools \ | ||
237 | ${PN}-modules \ | ||
238 | ${PN}-modules-meta \ | ||
239 | ${PN}-alsa-card-profile \ | ||
240 | ${PN}-v4l2 \ | ||
241 | gstreamer1.0-pipewire \ | ||
242 | " | ||
243 | |||
244 | PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*" | ||
245 | |||
246 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd-system-service', 'pipewire.service', '', d)}" | ||
247 | CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf" | ||
248 | FILES:${PN} = " \ | ||
249 | ${datadir}/pipewire \ | ||
250 | ${systemd_system_unitdir}/pipewire* \ | ||
251 | ${systemd_user_unitdir}/pipewire* \ | ||
252 | ${bindir}/pipewire \ | ||
253 | ${bindir}/pipewire-avb \ | ||
254 | " | ||
255 | |||
256 | RRECOMMENDS:${PN}:class-target += " \ | ||
257 | pipewire-modules-meta \ | ||
258 | pipewire-spa-plugins-meta \ | ||
259 | " | ||
260 | |||
261 | FILES:${PN}-dev += " \ | ||
262 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \ | ||
263 | " | ||
264 | |||
265 | CONFFILES:libpipewire += "${datadir}/pipewire/client.conf" | ||
266 | FILES:libpipewire = " \ | ||
267 | ${datadir}/pipewire/client.conf \ | ||
268 | ${libdir}/libpipewire-*.so.* \ | ||
269 | " | ||
270 | # Add the bare minimum modules and plugins required to be able | ||
271 | # to use libpipewire. Without these, it is essentially unusable. | ||
272 | RDEPENDS:libpipewire += " \ | ||
273 | ${PN}-modules-client-node \ | ||
274 | ${PN}-modules-protocol-native \ | ||
275 | ${PN}-spa-plugins-support \ | ||
276 | " | ||
277 | |||
278 | FILES:${PN}-tools = " \ | ||
279 | ${bindir}/pw-cat \ | ||
280 | ${bindir}/pw-cli \ | ||
281 | ${bindir}/pw-dot \ | ||
282 | ${bindir}/pw-dsdplay \ | ||
283 | ${bindir}/pw-dump \ | ||
284 | ${bindir}/pw-link \ | ||
285 | ${bindir}/pw-loopback \ | ||
286 | ${bindir}/pw-metadata \ | ||
287 | ${bindir}/pw-mididump \ | ||
288 | ${bindir}/pw-midiplay \ | ||
289 | ${bindir}/pw-midirecord \ | ||
290 | ${bindir}/pw-mon \ | ||
291 | ${bindir}/pw-play \ | ||
292 | ${bindir}/pw-profiler \ | ||
293 | ${bindir}/pw-record \ | ||
294 | ${bindir}/pw-reserve \ | ||
295 | ${bindir}/pw-top \ | ||
296 | " | ||
297 | |||
298 | # This is a shim daemon that is intended to be used as a | ||
299 | # drop-in PulseAudio replacement, providing a pulseaudio-compatible | ||
300 | # socket that can be used by applications that use libpulse. | ||
301 | CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf" | ||
302 | FILES:${PN}-pulse = " \ | ||
303 | ${datadir}/pipewire/pipewire-pulse.conf \ | ||
304 | ${systemd_system_unitdir}/pipewire-pulse.* \ | ||
305 | ${systemd_user_unitdir}/pipewire-pulse.* \ | ||
306 | ${bindir}/pipewire-pulse \ | ||
307 | " | ||
308 | RDEPENDS:${PN}-pulse += " \ | ||
309 | ${PN}-modules-protocol-pulse \ | ||
310 | " | ||
311 | |||
312 | # ALSA plugin to redirect audio to pipewire. | ||
313 | FILES:${PN}-alsa = "\ | ||
314 | ${libdir}/alsa-lib/* \ | ||
315 | ${datadir}/alsa/alsa.conf.d/* \ | ||
316 | " | ||
317 | |||
318 | # JACK drop-in libraries to redirect audio to pipewire. | ||
319 | CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf" | ||
320 | FILES:${PN}-jack = "\ | ||
321 | ${bindir}/pw-jack \ | ||
322 | ${datadir}/pipewire/jack.conf \ | ||
323 | ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \ | ||
324 | " | ||
325 | |||
326 | # Dynamic SPA plugin packages (see set_dynamic_metapkg_rdepends). | ||
327 | FILES:${PN}-spa-plugins = "" | ||
328 | RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta" | ||
329 | |||
330 | FILES:${PN}-spa-plugins-bluez5 += " \ | ||
331 | ${datadir}/${SPA_SUBDIR}/bluez5/* \ | ||
332 | " | ||
333 | |||
334 | FILES:${PN}-spa-tools = " \ | ||
335 | ${bindir}/spa-* \ | ||
336 | " | ||
337 | |||
338 | # Dynamic PipeWire module packages (see set_dynamic_metapkg_rdepends). | ||
339 | FILES:${PN}-modules = "" | ||
340 | RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" | ||
341 | |||
342 | CONFFILES:${PN}-modules-rt = "${datadir}/pipewire/client-rt.conf" | ||
343 | FILES:${PN}-modules-rt += " \ | ||
344 | ${datadir}/pipewire/client-rt.conf \ | ||
345 | " | ||
346 | |||
347 | CONFFILES:${PN}-modules-filter-chain = "${datadir}/pipewire/filter-chain/*" | ||
348 | FILES:${PN}-modules-filter-chain += " \ | ||
349 | ${datadir}/pipewire/filter-chain/* \ | ||
350 | " | ||
351 | |||
352 | FILES:${PN}-alsa-card-profile = " \ | ||
353 | ${datadir}/alsa-card-profile/* \ | ||
354 | ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \ | ||
355 | " | ||
356 | |||
357 | # V4L2 interface emulator for sending/receiving data between PipeWire and V4L2 applications. | ||
358 | FILES:${PN}-v4l2 += " \ | ||
359 | ${bindir}/pw-v4l2 \ | ||
360 | ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \ | ||
361 | " | ||
362 | |||
363 | FILES:gstreamer1.0-pipewire = " \ | ||
364 | ${libdir}/gstreamer-1.0/* \ | ||
365 | " | ||
366 | |||
367 | BBCLASSEXTEND = "native nativesdk" | ||