blob: 4e32b27087e0f8022f60fd737268f9ec70264d1d [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Sound server for Linux and Unix-like operating systems"
2HOMEPAGE = "http://www.pulseaudio.org"
3AUTHOR = "Lennart Poettering"
4SECTION = "libs/multimedia"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
6# Most of PulseAudio code is under LGPLv2.1+. There are a few exceptions:
7#
8# The "adrian" echo canceller variant has code under a non-standard permissive
9# license. See src/modules/echo-cancel/adrian-license.txt for details. This
10# recipe disables the adrian echo canceller to avoid hassle with the unusual
11# license.
12#
13# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
14# license.
15#
16# The src/pulsecore/filter/ directory contains code under the 3-clause BSD
17# license.
18#
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019# People who distribute PulseAudio binaries need to also consider that there
20# are some dependencies to GPL libraries. LGPL code that depends on GPL
21# libraries probably becomes effectively GPL-licensed (at compile-time? or at
22# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
23# implications. The GPL dependencies only affect the server, not the client
24# library, with the exception of libdbus that affects both. These are the GPL
25# library dependencies:
26#
27# One of the resampler implementations uses libsamplerate. This recipe doesn't
28# enable that resampler, however.
29#
30# One of the database implementations uses gdbm. This recipe doesn't enable
31# that database implementation, however.
32#
33# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
34#
35# module-equalizer-sink uses FFTW. This recipe disables that, however.
36#
37# The dependency with the most complicated licensing considerations is libdbus.
38# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
39# used by both the server and the client library (libpulse). Does this affect
40# applications that use libpulse? It should be also noted that libdbus is
41# dual-licensed: either GPLv2+ or AFL-2 terms apply. Whose decision is it which
42# of the licenses apply? What a mess. Some people hold the view that libdbus is
43# a system library that is covered by the "special exception" in GPLv2's
44# section 3, and therefore libdbus's GPL license doesn't affect PulseAudio.
45LICENSE = "LGPLv2.1+ & MIT & BSD-3-Clause"
46
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080047LIC_FILES_CHKSUM = "file://LICENSE;md5=0e5cd938de1a7a53ea5adac38cc10c39 \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 file://GPL;md5=4325afd396febcb659c36b49533135d4 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050050 file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
51 file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
52 file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
53 file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
54 file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055 file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
56 file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
57"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058
Andrew Geissler82c905d2020-04-13 13:39:40 -050059DEPENDS = "libatomic-ops libsndfile1 libtool"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060# optional
Brad Bishop19323692019-04-05 15:28:33 -040061DEPENDS += "udev alsa-lib glib-2.0"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062DEPENDS += "speexdsp libxml-parser-perl-native libcap"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063
Brad Bishop96ff1982019-08-19 13:50:42 -040064inherit autotools bash-completion pkgconfig useradd gettext perlnative systemd manpages gsettings
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065
66# *.desktop rules wont be generated during configure and build will fail
67# if using --disable-nls
68USE_NLS = "yes"
69
70EXTRA_OECONF = "\
71 --disable-hal-compat \
72 --disable-orc \
73 --enable-tcpwrap=no \
74 --with-access-group=audio \
75 --disable-openssl \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 --with-database=simple \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 --without-zsh-completion-dir \
78 --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
Brad Bishop19323692019-04-05 15:28:33 -040079 ac_cv_header_valgrind_memcheck_h=no \
80 --disable-tests \
81 --disable-running-from-build-tree \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082"
83
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050084# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
85# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
86EXTRA_OECONF += "--without-soxr"
87
Brad Bishop6e60e8b2018-02-01 10:27:11 -050088# The FFTW dependency (for module-equalizer-sink) was removed in commit
89# ddbd713293 without explaining why it was not made a PACKAGECONFIG item
90# instead. Oh well, let's keep it disabled until someone expresses some
91# interest in having it enabled.
Brad Bishop6e60e8b2018-02-01 10:27:11 -050092EXTRA_OECONF += "--without-fftw"
93
94# The "adrian" echo canceller implementation has a non-standard license
95# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
96# the licensing terms are probably not problematic, but it would be an extra
97# hassle to add the license to OE-Core's set of licenses. The canceller isn't
98# very good anyway, better alternatives exist (such as the webrtc canceller).
99EXTRA_OECONF += "--disable-adrian-aec"
100
Brad Bishop96ff1982019-08-19 13:50:42 -0400101PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103 ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500104 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
Brad Bishop19323692019-04-05 15:28:33 -0400105 dbus gsettings \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500106 "
107
108PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
Brad Bishop19323692019-04-05 15:28:33 -0400110PACKAGECONFIG[gconf] = "--enable-gconf,--disable-gconf,gconf"
111PACKAGECONFIG[gsettings] = "--enable-gsettings,--disable-gsettings,glib-2.0-native glib-2.0"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
113PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
114PACKAGECONFIG[systemd] = "--enable-systemd-daemon --enable-systemd-login --enable-systemd-journal --with-systemduserunitdir=${systemd_user_unitdir},--disable-systemd-daemon --disable-systemd-login --disable-systemd-journal,systemd"
115PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
116PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
117PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
118# Since many embedded systems don't have non-root users, it's useful to be
119# able to use pulseaudio autospawn for root as well.
120PACKAGECONFIG[autospawn-for-root] = ",,,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500121PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600122PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
123PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500124PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, "
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125
126EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
127EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
128
129
130export TARGET_PFPU = "${TARGET_FPU}"
131
132# TODO: Use more fine granular version
133#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
134OE_LT_RPATH_ALLOW = "any"
135OE_LT_RPATH_ALLOW[export]="1"
136
137set_cfg_value () {
138 sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
139 if ! grep -q "^$2 = $3\$" "$1"; then
140 die "Use of sed to set '$2' to '$3' in '$1' failed"
141 fi
142}
143
144do_compile_append () {
145 if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
146 set_cfg_value src/client.conf allow-autospawn-for-root yes
147 fi
148}
149
150do_install_append() {
151 install -d ${D}${sysconfdir}/default/volatiles
152 install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
153}
154
155USERADD_PACKAGES = "pulseaudio-server"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400156GROUPADD_PARAM_pulseaudio-server = "--system pulse"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500157USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
158 --no-create-home --shell /bin/false \
159 --groups audio,pulse --gid pulse pulse"
160
Andrew Geissler82c905d2020-04-13 13:39:40 -0500161PACKAGES =+ "\
162 libpulse \
163 libpulse-mainloop-glib \
164 libpulse-simple \
165 libpulsecommon \
166 libpulsecore \
167 ${PN}-pa-info \
168 ${PN}-server \
169 ${PN}-misc \
170 "
171
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172# The console-kit module is included here explicitly so bitbake can map to the
173# RDEPENDS we define for it in this recipe, and thereby ensure that when
174# adding the console-kit module to an image, we also get the necessary
175# consolekit package produced.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500176PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177
178#upgrade path:
179RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
180
181PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
182
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500183FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500184FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
185
186# client.conf configures the behaviour of libpulse, so it belongs in the same
187# package.
188FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
189
190FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
191FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
192
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500193FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"
194FILES_${PN}-conf = "${sysconfdir}"
195FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500196FILES_${PN}-pa-info = "${bindir}/pa-info"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
198
199#SYSTEMD_PACKAGES = "${PN}-server"
200SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
201
202FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
203
204# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
Brad Bishop19323692019-04-05 15:28:33 -0400205FILES_${PN} = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500206ALLOW_EMPTY_${PN} = "1"
207
208CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
209
210CONFFILES_pulseaudio-server = "\
211 ${sysconfdir}/pulse/default.pa \
212 ${sysconfdir}/pulse/daemon.conf \
213 ${sysconfdir}/pulse/system.pa \
214 "
215
216pkg_postinst_${PN}-server() {
217 if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
218 ${sysconfdir}/init.d/populate-volatile.sh update
219 fi
220}
221
222python populate_packages_prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500223 plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
Brad Bishop19323692019-04-05 15:28:33 -0400224 do_split_packages(d, plugindir, r'^module-(.*)\.so$', '${PN}-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
225 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 -0500226}
227
Andrew Geissler82c905d2020-04-13 13:39:40 -0500228# pa-info is a bash script that collects information about the audio setup.
229# It's primarily useful for attaching an information dump when reporting bugs.
230RDEPENDS_${PN}-pa-info = "\
231 alsa-utils-amixer \
232 alsa-utils-aplay \
233 alsa-utils-scripts \
234 bash \
235 ${PN}-server \
236 "
237
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238RDEPENDS_pulseaudio-server = " \
239 pulseaudio-module-filter-apply \
240 pulseaudio-module-filter-heuristics \
241 pulseaudio-module-udev-detect \
242 pulseaudio-module-null-sink \
243 pulseaudio-module-device-restore \
244 pulseaudio-module-stream-restore \
245 pulseaudio-module-card-restore \
246 pulseaudio-module-augment-properties \
247 pulseaudio-module-detect \
248 pulseaudio-module-alsa-sink \
249 pulseaudio-module-alsa-source \
250 pulseaudio-module-alsa-card \
251 pulseaudio-module-native-protocol-unix \
252 pulseaudio-module-default-device-restore \
253 pulseaudio-module-intended-roles \
254 pulseaudio-module-rescue-streams \
255 pulseaudio-module-always-sink \
256 pulseaudio-module-suspend-on-idle \
257 pulseaudio-module-position-event-sounds \
258 pulseaudio-module-role-cork \
259 pulseaudio-module-switch-on-port-available"
260
261# If the server is installed, it's usually desirable to make ALSA applications
262# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
263# that makes the PulseAudio plugin the default ALSA device.
264RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
265
266# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
267# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
268RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
269RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
270
Brad Bishop19323692019-04-05 15:28:33 -0400271FILES_${PN}-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
272FILES_${PN}-module-gconf += "${libexecdir}/pulse/gconf-helper"
273
274GSETTINGS_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'gsettings', '${PN}-module-gsettings', '', d)}"
275FILES_${PN}-module-gsettings += "${libexecdir}/pulse/gsettings-helper ${datadir}/GConf/gsettings ${datadir}/glib-2.0/schemas"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500276
277# The console-kit module is good to have on X11 systems (it keeps PulseAudio
278# running for the duration of the user login session). The device-manager and
279# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
280# modules must be installed when X11 is enabled.
281RDEPENDS_pulseaudio-server += "\
282 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500283 pulseaudio-module-device-manager \
284 pulseaudio-module-x11-cork-request \
285 pulseaudio-module-x11-publish \
286 pulseaudio-module-x11-xsmp \
287 ', '', d)}"
Brad Bishop08902b02019-08-20 09:16:51 -0400288
289RDEPENDS_pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', \
290 bb.utils.contains('DISTRO_FEATURES', 'systemd', 'pulseaudio-module-systemd-login', 'pulseaudio-module-console-kit', d), \
291 '', d)}"