blob: 7e54ad4b5565f6facd8128226258e86672e6730d [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"
5LICENSE = "GPLv2+ & LGPLv2.1"
Patrick Williamsc0f7c042017-02-23 20:41:17 -06006LIC_FILES_CHKSUM = "file://LICENSE;md5=d9ae089c8dc5339f8ac9d8563038a29f \
7 file://GPL;md5=4325afd396febcb659c36b49533135d4 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008 file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
9 file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84"
10
Patrick Williamsc0f7c042017-02-23 20:41:17 -060011DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012# optional
13DEPENDS += "udev alsa-lib glib-2.0 gconf"
14DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap"
15
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18# *.desktop rules wont be generated during configure and build will fail
19# if using --disable-nls
20USE_NLS = "yes"
21
22EXTRA_OECONF = "\
23 --disable-hal-compat \
24 --disable-orc \
25 --enable-tcpwrap=no \
26 --with-access-group=audio \
27 --disable-openssl \
28 --disable-xen \
29 --with-database=simple \
30 --without-fftw \
31 --without-zsh-completion-dir \
32 --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
33 ac_cv_header_valgrind_memcheck_h=no \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060034 --disable-tests \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035"
36
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
38# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
39EXTRA_OECONF += "--without-soxr"
40
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
42 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
43 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
44 ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
45 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047 dbus \
48 "
49
50PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
51PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc"
52PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
53PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
54PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
55PACKAGECONFIG[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"
56PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
57PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
58PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
59# Since many embedded systems don't have non-root users, it's useful to be
60# able to use pulseaudio autospawn for root as well.
61PACKAGECONFIG[autospawn-for-root] = ",,,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050062PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060063PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
64PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065
66EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
67EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
68
69
70export TARGET_PFPU = "${TARGET_FPU}"
71
72# TODO: Use more fine granular version
73#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
74OE_LT_RPATH_ALLOW = "any"
75OE_LT_RPATH_ALLOW[export]="1"
76
77set_cfg_value () {
78 sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
79 if ! grep -q "^$2 = $3\$" "$1"; then
80 die "Use of sed to set '$2' to '$3' in '$1' failed"
81 fi
82}
83
84do_compile_append () {
85 if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
86 set_cfg_value src/client.conf allow-autospawn-for-root yes
87 fi
88}
89
90do_install_append() {
91 install -d ${D}${sysconfdir}/default/volatiles
92 install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
93}
94
95USERADD_PACKAGES = "pulseaudio-server"
96GROUPADD_PARAM_pulseaudio-server = "pulse"
97USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
98 --no-create-home --shell /bin/false \
99 --groups audio,pulse --gid pulse pulse"
100
101# The console-kit module is included here explicitly so bitbake can map to the
102# RDEPENDS we define for it in this recipe, and thereby ensure that when
103# adding the console-kit module to an image, we also get the necessary
104# consolekit package produced.
105PACKAGES =+ "libpulsecore libpulsecommon libpulse libpulse-simple libpulse-mainloop-glib \
106 pulseaudio-server pulseaudio-misc ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
107
108#upgrade path:
109RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
110
111PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
112
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500113FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500114FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
115
116# client.conf configures the behaviour of libpulse, so it belongs in the same
117# package.
118FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
119
120FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
121FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
122
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"
124FILES_${PN}-conf = "${sysconfdir}"
125FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
126FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
127
128#SYSTEMD_PACKAGES = "${PN}-server"
129SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
130
131FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
132
133# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
134ALLOW_EMPTY_${PN} = "1"
135
136CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
137
138CONFFILES_pulseaudio-server = "\
139 ${sysconfdir}/pulse/default.pa \
140 ${sysconfdir}/pulse/daemon.conf \
141 ${sysconfdir}/pulse/system.pa \
142 "
143
144pkg_postinst_${PN}-server() {
145 if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
146 ${sysconfdir}/init.d/populate-volatile.sh update
147 fi
148}
149
150python populate_packages_prepend() {
151 #d.setVar('PKG_pulseaudio', 'pulseaudio')
152
153 plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
154 do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
155 do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
156}
157
158RDEPENDS_pulseaudio-server = " \
159 pulseaudio-module-filter-apply \
160 pulseaudio-module-filter-heuristics \
161 pulseaudio-module-udev-detect \
162 pulseaudio-module-null-sink \
163 pulseaudio-module-device-restore \
164 pulseaudio-module-stream-restore \
165 pulseaudio-module-card-restore \
166 pulseaudio-module-augment-properties \
167 pulseaudio-module-detect \
168 pulseaudio-module-alsa-sink \
169 pulseaudio-module-alsa-source \
170 pulseaudio-module-alsa-card \
171 pulseaudio-module-native-protocol-unix \
172 pulseaudio-module-default-device-restore \
173 pulseaudio-module-intended-roles \
174 pulseaudio-module-rescue-streams \
175 pulseaudio-module-always-sink \
176 pulseaudio-module-suspend-on-idle \
177 pulseaudio-module-position-event-sounds \
178 pulseaudio-module-role-cork \
179 pulseaudio-module-switch-on-port-available"
180
181# If the server is installed, it's usually desirable to make ALSA applications
182# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
183# that makes the PulseAudio plugin the default ALSA device.
184RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
185
186# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
187# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
188RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
189RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
190
191FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper"
192FILES_pulseaudio-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
193
194# The console-kit module is good to have on X11 systems (it keeps PulseAudio
195# running for the duration of the user login session). The device-manager and
196# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
197# modules must be installed when X11 is enabled.
198RDEPENDS_pulseaudio-server += "\
199 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
200 pulseaudio-module-console-kit \
201 pulseaudio-module-device-manager \
202 pulseaudio-module-x11-cork-request \
203 pulseaudio-module-x11-publish \
204 pulseaudio-module-x11-xsmp \
205 ', '', d)}"