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