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