blob: a69dd32bd7fb7d22e4cb53ba534353bf5eec094f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Sound server for Linux and Unix-like operating systems"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "A general purpose sound server intended to run as a middleware \
3between your applications and your hardware devices, either using ALSA or OSS."
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004HOMEPAGE = "http://www.pulseaudio.org"
5AUTHOR = "Lennart Poettering"
6SECTION = "libs/multimedia"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007
Andrew Geissler9aee5002022-03-30 16:27:02 +00008# Most of PulseAudio code is under LGPL-2.1-or-later. There are a few
9# exceptions:
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010#
11# The "adrian" echo canceller variant has code under a non-standard permissive
12# license. See src/modules/echo-cancel/adrian-license.txt for details. This
13# recipe disables the adrian echo canceller to avoid hassle with the unusual
14# license.
15#
16# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
17# license.
18#
19# The src/pulsecore/filter/ directory contains code under the 3-clause BSD
20# license.
21#
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022# People who distribute PulseAudio binaries need to also consider that there
23# are some dependencies to GPL libraries. LGPL code that depends on GPL
24# libraries probably becomes effectively GPL-licensed (at compile-time? or at
25# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
26# implications. The GPL dependencies only affect the server, not the client
27# library, with the exception of libdbus that affects both. These are the GPL
28# library dependencies:
29#
30# One of the resampler implementations uses libsamplerate. This recipe doesn't
31# enable that resampler, however.
32#
33# One of the database implementations uses gdbm. This recipe doesn't enable
34# that database implementation, however.
35#
36# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
37#
38# module-equalizer-sink uses FFTW. This recipe disables that, however.
39#
40# The dependency with the most complicated licensing considerations is libdbus.
41# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
42# used by both the server and the client library (libpulse). Does this affect
Andrew Geissler9aee5002022-03-30 16:27:02 +000043# applications that use libpulse? It should also be noted that libdbus is
44# dual-licensed: either GPL-2.0-or-later or AFL-2.0 terms apply. Whose decision
45# is it which of the licenses apply? What a mess. Some people hold the view that
46# libdbus is a system library that is covered by the "special exception" in
47# GPLv2's section 3, and therefore libdbus's GPL license doesn't affect
48# PulseAudio.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000049LICENSE = "LGPL-2.1-or-later & MIT & BSD-3-Clause"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050050
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051LIC_FILES_CHKSUM = "file://LICENSE;md5=0e5cd938de1a7a53ea5adac38cc10c39 \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052 file://GPL;md5=4325afd396febcb659c36b49533135d4 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054 file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
55 file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
56 file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
57 file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
58 file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059 file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
60 file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
61"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062
Andrew Geisslerd1e89492021-02-12 15:35:20 -060063# libtool is needed for libltdl, used in module loading.
Andrew Geissler82c905d2020-04-13 13:39:40 -050064DEPENDS = "libatomic-ops libsndfile1 libtool"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065# optional
Brad Bishop19323692019-04-05 15:28:33 -040066DEPENDS += "udev alsa-lib glib-2.0"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067DEPENDS += "speexdsp libxml-parser-perl-native libcap"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
Andrew Geisslerd1e89492021-02-12 15:35:20 -060069inherit bash-completion meson pkgconfig useradd gettext perlnative systemd manpages gsettings
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070
71# *.desktop rules wont be generated during configure and build will fail
72# if using --disable-nls
73USE_NLS = "yes"
74
Andrew Geisslerd1e89492021-02-12 15:35:20 -060075EXTRA_OEMESON = "\
76 -Dhal-compat=false \
77 -Dorc=disabled \
78 -Daccess_group=audio \
79 -Dopenssl=disabled \
80 -Ddatabase=simple \
81 -Dzshcompletiondir=no \
82 -Dudevrulesdir=`pkg-config --variable=udevdir udev`/rules.d \
83 -Dvalgrind=disabled \
84 -Dtests=false \
85 -Drunning-from-build-tree=false \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086"
87
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050088# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
89# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
Andrew Geisslerd1e89492021-02-12 15:35:20 -060090EXTRA_OEMESON += "-Dsoxr=disabled"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050091
Brad Bishop6e60e8b2018-02-01 10:27:11 -050092# The FFTW dependency (for module-equalizer-sink) was removed in commit
93# ddbd713293 without explaining why it was not made a PACKAGECONFIG item
94# instead. Oh well, let's keep it disabled until someone expresses some
95# interest in having it enabled.
Andrew Geisslerd1e89492021-02-12 15:35:20 -060096EXTRA_OEMESON += "-Dfftw=disabled"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050097
98# The "adrian" echo canceller implementation has a non-standard license
99# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
100# the licensing terms are probably not problematic, but it would be an extra
101# hassle to add the license to OE-Core's set of licenses. The canceller isn't
102# very good anyway, better alternatives exist (such as the webrtc canceller).
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600103EXTRA_OEMESON += "-Dadrian-aec=false"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500104
Brad Bishop96ff1982019-08-19 13:50:42 -0400105PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500106 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107 ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500108 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
Brad Bishop19323692019-04-05 15:28:33 -0400109 dbus gsettings \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110 "
111
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600112PACKAGECONFIG[dbus] = "-Ddbus=enabled,-Ddbus=disabled,dbus"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500113PACKAGECONFIG[bluez5] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600114PACKAGECONFIG[gsettings] = "-Dgsettings=enabled,-Dgsettings=disabled,glib-2.0-native glib-2.0"
115PACKAGECONFIG[ofono] = "-Dbluez5-ofono-headset=true,-Dbluez5-ofono-headset=false,ofono"
116PACKAGECONFIG[gtk] = "-Dgtk=enabled,-Dgtk=disabled,gtk+3"
117PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemduserunitdir=${systemd_user_unitdir},-Dsystemd=disabled,systemd"
118PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libxtst libice libsm libxcb"
119PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi"
120PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121# Since many embedded systems don't have non-root users, it's useful to be
122# able to use pulseaudio autospawn for root as well.
123PACKAGECONFIG[autospawn-for-root] = ",,,"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600124PACKAGECONFIG[lirc] = "-Dlirc=enabled,-Dlirc=disabled,lirc"
125PACKAGECONFIG[webrtc] = "-Dwebrtc-aec=enabled,-Dwebrtc-aec=disabled,webrtc-audio-processing"
126PACKAGECONFIG[ipv6] = "-Dipv6=true,-Dipv6=false,"
127PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500128
129export TARGET_PFPU = "${TARGET_FPU}"
130
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500131set_cfg_value () {
132 sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
133 if ! grep -q "^$2 = $3\$" "$1"; then
134 die "Use of sed to set '$2' to '$3' in '$1' failed"
135 fi
136}
137
Patrick Williams213cb262021-08-07 19:21:33 -0500138do_compile:append () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500139 if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600140 set_cfg_value src/pulse/client.conf allow-autospawn-for-root yes
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141 fi
142}
143
Patrick Williams213cb262021-08-07 19:21:33 -0500144do_install:append() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500145 install -d ${D}${sysconfdir}/default/volatiles
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600146 install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/04_pulse
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500147}
148
149USERADD_PACKAGES = "pulseaudio-server"
Patrick Williams213cb262021-08-07 19:21:33 -0500150GROUPADD_PARAM:pulseaudio-server = "--system pulse"
151USERADD_PARAM:pulseaudio-server = "--system --home /var/run/pulse \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500152 --no-create-home --shell /bin/false \
153 --groups audio,pulse --gid pulse pulse"
154
Andrew Geissler82c905d2020-04-13 13:39:40 -0500155PACKAGES =+ "\
156 libpulse \
157 libpulse-mainloop-glib \
158 libpulse-simple \
159 libpulsecommon \
160 libpulsecore \
161 ${PN}-pa-info \
162 ${PN}-server \
163 ${PN}-misc \
164 "
165
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500166# The console-kit module is included here explicitly so bitbake can map to the
167# RDEPENDS we define for it in this recipe, and thereby ensure that when
168# adding the console-kit module to an image, we also get the necessary
169# consolekit package produced.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500170PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500171
172#upgrade path:
Patrick Williams213cb262021-08-07 19:21:33 -0500173RREPLACES:pulseaudio-server = "libpulse-bin libpulse-conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500174
175PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
176
Patrick Williams213cb262021-08-07 19:21:33 -0500177FILES:libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
178FILES:libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179
180# client.conf configures the behaviour of libpulse, so it belongs in the same
181# package.
Patrick Williams213cb262021-08-07 19:21:33 -0500182FILES:libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183
Patrick Williams213cb262021-08-07 19:21:33 -0500184FILES:libpulse-simple = "${libdir}/libpulse-simple.so.*"
185FILES:libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186
Patrick Williams213cb262021-08-07 19:21:33 -0500187FILES:${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala"
188FILES:${PN}-bin += "${sysconfdir}/default/volatiles/04_pulse"
189FILES:${PN}-pa-info = "${bindir}/pa-info"
190FILES:${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500191
192#SYSTEMD_PACKAGES = "${PN}-server"
Patrick Williams213cb262021-08-07 19:21:33 -0500193SYSTEMD_SERVICE:${PN}-server = "pulseaudio.service"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194
Patrick Williams213cb262021-08-07 19:21:33 -0500195FILES:${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500196
197# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
Patrick Williams213cb262021-08-07 19:21:33 -0500198FILES:${PN} = ""
199ALLOW_EMPTY:${PN} = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500200
Patrick Williams213cb262021-08-07 19:21:33 -0500201CONFFILES:libpulse = "${sysconfdir}/pulse/client.conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202
Patrick Williams213cb262021-08-07 19:21:33 -0500203CONFFILES:pulseaudio-server = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500204 ${sysconfdir}/pulse/default.pa \
205 ${sysconfdir}/pulse/daemon.conf \
206 ${sysconfdir}/pulse/system.pa \
207 "
208
Patrick Williams213cb262021-08-07 19:21:33 -0500209pkg_postinst:${PN}-server() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210 if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
211 ${sysconfdir}/init.d/populate-volatile.sh update
212 fi
213}
214
Patrick Williams213cb262021-08-07 19:21:33 -0500215python populate_packages:prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500216 plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
Brad Bishop19323692019-04-05 15:28:33 -0400217 do_split_packages(d, plugindir, r'^module-(.*)\.so$', '${PN}-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
218 do_split_packages(d, plugindir, r'^lib(.*)\.so$', '${PN}-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219}
220
Andrew Geissler82c905d2020-04-13 13:39:40 -0500221# pa-info is a bash script that collects information about the audio setup.
222# It's primarily useful for attaching an information dump when reporting bugs.
Patrick Williams213cb262021-08-07 19:21:33 -0500223RDEPENDS:${PN}-pa-info = "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500224 alsa-utils-amixer \
225 alsa-utils-aplay \
226 alsa-utils-scripts \
227 bash \
228 ${PN}-server \
229 "
230
Patrick Williams213cb262021-08-07 19:21:33 -0500231RDEPENDS:pulseaudio-server = " \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500232 pulseaudio-module-filter-apply \
233 pulseaudio-module-filter-heuristics \
234 pulseaudio-module-udev-detect \
235 pulseaudio-module-null-sink \
236 pulseaudio-module-device-restore \
237 pulseaudio-module-stream-restore \
238 pulseaudio-module-card-restore \
239 pulseaudio-module-augment-properties \
240 pulseaudio-module-detect \
241 pulseaudio-module-alsa-sink \
242 pulseaudio-module-alsa-source \
243 pulseaudio-module-alsa-card \
244 pulseaudio-module-native-protocol-unix \
245 pulseaudio-module-default-device-restore \
246 pulseaudio-module-intended-roles \
247 pulseaudio-module-rescue-streams \
248 pulseaudio-module-always-sink \
249 pulseaudio-module-suspend-on-idle \
250 pulseaudio-module-position-event-sounds \
251 pulseaudio-module-role-cork \
252 pulseaudio-module-switch-on-port-available"
253
254# If the server is installed, it's usually desirable to make ALSA applications
255# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
256# that makes the PulseAudio plugin the default ALSA device.
Patrick Williams213cb262021-08-07 19:21:33 -0500257RDEPENDS:pulseaudio-server += "alsa-plugins-pulseaudio-conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500258
259# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
260# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
Patrick Williams213cb262021-08-07 19:21:33 -0500261RDEPENDS:pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
262RDEPENDS:pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500263
Patrick Williams213cb262021-08-07 19:21:33 -0500264FILES:${PN}-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
Brad Bishop19323692019-04-05 15:28:33 -0400265
266GSETTINGS_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'gsettings', '${PN}-module-gsettings', '', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -0500267FILES:${PN}-module-gsettings += "${libexecdir}/pulse/gsettings-helper ${datadir}/GConf/gsettings ${datadir}/glib-2.0/schemas"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268
269# The console-kit module is good to have on X11 systems (it keeps PulseAudio
270# running for the duration of the user login session). The device-manager and
271# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
272# modules must be installed when X11 is enabled.
Patrick Williams213cb262021-08-07 19:21:33 -0500273RDEPENDS:pulseaudio-server += "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500274 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500275 pulseaudio-module-device-manager \
276 pulseaudio-module-x11-cork-request \
277 pulseaudio-module-x11-publish \
278 pulseaudio-module-x11-xsmp \
279 ', '', d)}"
Brad Bishop08902b02019-08-20 09:16:51 -0400280
Patrick Williams213cb262021-08-07 19:21:33 -0500281RDEPENDS:pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', \
Brad Bishop08902b02019-08-20 09:16:51 -0400282 bb.utils.contains('DISTRO_FEATURES', 'systemd', 'pulseaudio-module-systemd-login', 'pulseaudio-module-console-kit', d), \
283 '', d)}"