blob: fdbf5abc16a2ed628dbaf42ebfc3e2cdc5191449 [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#
19# src/utils/qpaeq is licensed under AGPL. qpaeq is not installed by this
20# recipe, however, which is why AGPL is not mentioned in LICENSE.
21#
22# 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
43# applications that use libpulse? It should be also noted that libdbus is
44# dual-licensed: either GPLv2+ or AFL-2 terms apply. Whose decision is it which
45# of the licenses apply? What a mess. Some people hold the view that libdbus is
46# a system library that is covered by the "special exception" in GPLv2's
47# section 3, and therefore libdbus's GPL license doesn't affect PulseAudio.
48LICENSE = "LGPLv2.1+ & MIT & BSD-3-Clause"
49
50LIC_FILES_CHKSUM = "file://LICENSE;md5=a848e8d03f04976778eab2348b59ed2b \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051 file://GPL;md5=4325afd396febcb659c36b49533135d4 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053 file://AGPL;md5=73f1eb20517c55bf9493b7dd6e480788 \
54 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 \
59 file://src/utils/qpaeq;beginline=2;endline=16;md5=7f62515a4762f0c3fc3d4201858bb964 \
60 file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
61 file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
62"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063
Patrick Williamsc0f7c042017-02-23 20:41:17 -060064DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065# optional
66DEPENDS += "udev alsa-lib glib-2.0 gconf"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067DEPENDS += "speexdsp libxml-parser-perl-native libcap"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
Brad Bishop6e60e8b2018-02-01 10:27:11 -050069inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd manpages
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
75EXTRA_OECONF = "\
76 --disable-hal-compat \
77 --disable-orc \
78 --enable-tcpwrap=no \
79 --with-access-group=audio \
80 --disable-openssl \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 --with-database=simple \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082 --without-zsh-completion-dir \
83 --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
84 ac_cv_header_valgrind_memcheck_h=no \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060085 --disable-tests \
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.
90EXTRA_OECONF += "--without-soxr"
91
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.
96#
97# One nice thing about disabling this is that it also prevents qpaeq from
98# being installed, so we avoid adding AGPL to the list of licenses (nothing
99# else in PulseAudio is licensed under AGPL).
100EXTRA_OECONF += "--without-fftw"
101
102# The "adrian" echo canceller implementation has a non-standard license
103# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
104# the licensing terms are probably not problematic, but it would be an extra
105# hassle to add the license to OE-Core's set of licenses. The canceller isn't
106# very good anyway, better alternatives exist (such as the webrtc canceller).
107EXTRA_OECONF += "--disable-adrian-aec"
108
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
110 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111 ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500112 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113 dbus \
114 "
115
116PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
117PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc"
118PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
119PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
120PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
121PACKAGECONFIG[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"
122PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
123PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
124PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
125# Since many embedded systems don't have non-root users, it's useful to be
126# able to use pulseaudio autospawn for root as well.
127PACKAGECONFIG[autospawn-for-root] = ",,,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500128PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600129PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
130PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500131PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, "
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500132
133EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
134EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
135
136
137export TARGET_PFPU = "${TARGET_FPU}"
138
139# TODO: Use more fine granular version
140#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
141OE_LT_RPATH_ALLOW = "any"
142OE_LT_RPATH_ALLOW[export]="1"
143
144set_cfg_value () {
145 sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
146 if ! grep -q "^$2 = $3\$" "$1"; then
147 die "Use of sed to set '$2' to '$3' in '$1' failed"
148 fi
149}
150
151do_compile_append () {
152 if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
153 set_cfg_value src/client.conf allow-autospawn-for-root yes
154 fi
155}
156
157do_install_append() {
158 install -d ${D}${sysconfdir}/default/volatiles
159 install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
160}
161
162USERADD_PACKAGES = "pulseaudio-server"
163GROUPADD_PARAM_pulseaudio-server = "pulse"
164USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
165 --no-create-home --shell /bin/false \
166 --groups audio,pulse --gid pulse pulse"
167
168# The console-kit module is included here explicitly so bitbake can map to the
169# RDEPENDS we define for it in this recipe, and thereby ensure that when
170# adding the console-kit module to an image, we also get the necessary
171# consolekit package produced.
172PACKAGES =+ "libpulsecore libpulsecommon libpulse libpulse-simple libpulse-mainloop-glib \
173 pulseaudio-server pulseaudio-misc ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
174
175#upgrade path:
176RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
177
178PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
179
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500180FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
182
183# client.conf configures the behaviour of libpulse, so it belongs in the same
184# package.
185FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
186
187FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
188FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
189
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"
191FILES_${PN}-conf = "${sysconfdir}"
192FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
193FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
194
195#SYSTEMD_PACKAGES = "${PN}-server"
196SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
197
198FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
199
200# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
201ALLOW_EMPTY_${PN} = "1"
202
203CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
204
205CONFFILES_pulseaudio-server = "\
206 ${sysconfdir}/pulse/default.pa \
207 ${sysconfdir}/pulse/daemon.conf \
208 ${sysconfdir}/pulse/system.pa \
209 "
210
211pkg_postinst_${PN}-server() {
212 if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
213 ${sysconfdir}/init.d/populate-volatile.sh update
214 fi
215}
216
217python populate_packages_prepend() {
218 #d.setVar('PKG_pulseaudio', 'pulseaudio')
219
220 plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
221 do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
222 do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
223}
224
225RDEPENDS_pulseaudio-server = " \
226 pulseaudio-module-filter-apply \
227 pulseaudio-module-filter-heuristics \
228 pulseaudio-module-udev-detect \
229 pulseaudio-module-null-sink \
230 pulseaudio-module-device-restore \
231 pulseaudio-module-stream-restore \
232 pulseaudio-module-card-restore \
233 pulseaudio-module-augment-properties \
234 pulseaudio-module-detect \
235 pulseaudio-module-alsa-sink \
236 pulseaudio-module-alsa-source \
237 pulseaudio-module-alsa-card \
238 pulseaudio-module-native-protocol-unix \
239 pulseaudio-module-default-device-restore \
240 pulseaudio-module-intended-roles \
241 pulseaudio-module-rescue-streams \
242 pulseaudio-module-always-sink \
243 pulseaudio-module-suspend-on-idle \
244 pulseaudio-module-position-event-sounds \
245 pulseaudio-module-role-cork \
246 pulseaudio-module-switch-on-port-available"
247
248# If the server is installed, it's usually desirable to make ALSA applications
249# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
250# that makes the PulseAudio plugin the default ALSA device.
251RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
252
253# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
254# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
255RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
256RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
257
258FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper"
259FILES_pulseaudio-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
260
261# The console-kit module is good to have on X11 systems (it keeps PulseAudio
262# running for the duration of the user login session). The device-manager and
263# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
264# modules must be installed when X11 is enabled.
265RDEPENDS_pulseaudio-server += "\
266 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
267 pulseaudio-module-console-kit \
268 pulseaudio-module-device-manager \
269 pulseaudio-module-x11-cork-request \
270 pulseaudio-module-x11-publish \
271 pulseaudio-module-x11-xsmp \
272 ', '', d)}"