pulseaudio.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. SUMMARY = "Sound server for Linux and Unix-like operating systems"
  2. DESCRIPTION = "A general purpose sound server intended to run as a middleware \
  3. between your applications and your hardware devices, either using ALSA or OSS."
  4. HOMEPAGE = "http://www.pulseaudio.org"
  5. SECTION = "libs/multimedia"
  6. # Most of PulseAudio code is under LGPL-2.1-or-later. There are a few
  7. # exceptions:
  8. #
  9. # The "adrian" echo canceller variant has code under a non-standard permissive
  10. # license. See src/modules/echo-cancel/adrian-license.txt for details. This
  11. # recipe disables the adrian echo canceller to avoid hassle with the unusual
  12. # license.
  13. #
  14. # The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
  15. # license.
  16. #
  17. # The src/pulsecore/filter/ directory contains code under the 3-clause BSD
  18. # license.
  19. #
  20. # People who distribute PulseAudio binaries need to also consider that there
  21. # are some dependencies to GPL libraries. LGPL code that depends on GPL
  22. # libraries probably becomes effectively GPL-licensed (at compile-time? or at
  23. # at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
  24. # implications. The GPL dependencies only affect the server, not the client
  25. # library, with the exception of libdbus that affects both. These are the GPL
  26. # library dependencies:
  27. #
  28. # One of the resampler implementations uses libsamplerate. This recipe doesn't
  29. # enable that resampler, however.
  30. #
  31. # One of the database implementations uses gdbm. This recipe doesn't enable
  32. # that database implementation, however.
  33. #
  34. # module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
  35. #
  36. # module-equalizer-sink uses FFTW. This recipe disables that, however.
  37. #
  38. # The dependency with the most complicated licensing considerations is libdbus.
  39. # When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
  40. # used by both the server and the client library (libpulse). Does this affect
  41. # applications that use libpulse? It should also be noted that libdbus is
  42. # dual-licensed: either GPL-2.0-or-later or AFL-2.0 terms apply. Whose decision
  43. # is it which of the licenses apply? What a mess. Some people hold the view that
  44. # libdbus is a system library that is covered by the "special exception" in
  45. # GPLv2's section 3, and therefore libdbus's GPL license doesn't affect
  46. # PulseAudio.
  47. LICENSE = "LGPL-2.1-or-later & MIT & BSD-3-Clause"
  48. LIC_FILES_CHKSUM = "file://LICENSE;md5=0e5cd938de1a7a53ea5adac38cc10c39 \
  49. file://GPL;md5=4325afd396febcb659c36b49533135d4 \
  50. file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
  51. file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
  52. file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
  53. file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
  54. file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
  55. file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
  56. file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
  57. file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
  58. "
  59. # libtool is needed for libltdl, used in module loading.
  60. DEPENDS = "m4-native libatomic-ops libsndfile1 libtool"
  61. # optional
  62. DEPENDS += "udev alsa-lib glib-2.0"
  63. DEPENDS += "speexdsp libxml-parser-perl-native libcap"
  64. inherit bash-completion meson pkgconfig useradd gettext perlnative systemd manpages gsettings
  65. # *.desktop rules wont be generated during configure and build will fail
  66. # if using --disable-nls
  67. USE_NLS = "yes"
  68. # Helps tests for -msse fail on non-SSE architectures which is all non-x86
  69. TUNE_CCARGS:append:toolchain-clang = " -Werror=unused-command-line-argument"
  70. # mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2]
  71. # vld1.s32 ${1:h}, [$3] '
  72. TOOLCHAIN:armv7ve = "gcc"
  73. TOOLCHAIN:armv7a = "gcc"
  74. EXTRA_OEMESON = "\
  75. -Dhal-compat=false \
  76. -Dorc=disabled \
  77. -Daccess_group=audio \
  78. -Dopenssl=disabled \
  79. -Ddatabase=simple \
  80. -Dzshcompletiondir=no \
  81. -Dudevrulesdir=`pkg-config --variable=udevdir udev`/rules.d \
  82. -Dvalgrind=disabled \
  83. -Dtests=false \
  84. -Drunning-from-build-tree=false \
  85. "
  86. # soxr (the SoX Resampler library) doesn't seem to be currently packaged in
  87. # oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
  88. EXTRA_OEMESON += "-Dsoxr=disabled"
  89. # The FFTW dependency (for module-equalizer-sink) was removed in commit
  90. # ddbd713293 without explaining why it was not made a PACKAGECONFIG item
  91. # instead. Oh well, let's keep it disabled until someone expresses some
  92. # interest in having it enabled.
  93. EXTRA_OEMESON += "-Dfftw=disabled"
  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).
  99. EXTRA_OEMESON += "-Dadrian-aec=false"
  100. PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
  101. ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
  102. ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
  103. ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
  104. dbus gsettings \
  105. "
  106. PACKAGECONFIG[dbus] = "-Ddbus=enabled,-Ddbus=disabled,dbus"
  107. PACKAGECONFIG[bluez5] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc"
  108. PACKAGECONFIG[gsettings] = "-Dgsettings=enabled,-Dgsettings=disabled,glib-2.0-native glib-2.0"
  109. PACKAGECONFIG[ofono] = "-Dbluez5-ofono-headset=true,-Dbluez5-ofono-headset=false,ofono"
  110. PACKAGECONFIG[gtk] = "-Dgtk=enabled,-Dgtk=disabled,gtk+3"
  111. PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemduserunitdir=${systemd_user_unitdir},-Dsystemd=disabled,systemd"
  112. PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libxtst libice libsm libxcb"
  113. PACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi"
  114. PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
  115. # Since many embedded systems don't have non-root users, it's useful to be
  116. # able to use pulseaudio autospawn for root as well.
  117. PACKAGECONFIG[autospawn-for-root] = ",,,"
  118. PACKAGECONFIG[lirc] = "-Dlirc=enabled,-Dlirc=disabled,lirc"
  119. PACKAGECONFIG[webrtc] = "-Dwebrtc-aec=enabled,-Dwebrtc-aec=disabled,webrtc-audio-processing-1"
  120. PACKAGECONFIG[ipv6] = "-Dipv6=true,-Dipv6=false,"
  121. PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,"
  122. PACKAGECONFIG[oss-output] = "-Doss-output=enabled,-Doss-output=disabled,"
  123. export TARGET_PFPU = "${TARGET_FPU}"
  124. set_cfg_value () {
  125. sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
  126. if ! grep -q "^$2 = $3\$" "$1"; then
  127. die "Use of sed to set '$2' to '$3' in '$1' failed"
  128. fi
  129. }
  130. do_compile:append () {
  131. if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
  132. set_cfg_value src/pulse/client.conf allow-autospawn-for-root yes
  133. fi
  134. }
  135. do_install:append() {
  136. install -d ${D}${sysconfdir}/default/volatiles
  137. install -m 0644 ${UNPACKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/04_pulse
  138. }
  139. USERADD_PACKAGES = "pulseaudio-server"
  140. GROUPADD_PARAM:pulseaudio-server = "--system pulse"
  141. USERADD_PARAM:pulseaudio-server = "--system --home /var/run/pulse \
  142. --no-create-home --shell /bin/false \
  143. --groups audio,pulse --gid pulse pulse"
  144. PACKAGES =+ "\
  145. libpulse \
  146. libpulse-mainloop-glib \
  147. libpulse-simple \
  148. libpulsecommon \
  149. libpulsecore \
  150. ${PN}-pa-info \
  151. ${PN}-server \
  152. ${PN}-misc \
  153. "
  154. # The console-kit module is included here explicitly so bitbake can map to the
  155. # RDEPENDS we define for it in this recipe, and thereby ensure that when
  156. # adding the console-kit module to an image, we also get the necessary
  157. # consolekit package produced.
  158. PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
  159. #upgrade path:
  160. RREPLACES:pulseaudio-server = "libpulse-bin libpulse-conf"
  161. PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
  162. FILES:libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
  163. FILES:libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
  164. # client.conf configures the behaviour of libpulse, so it belongs in the same
  165. # package.
  166. FILES:libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
  167. FILES:libpulse-simple = "${libdir}/libpulse-simple.so.*"
  168. FILES:libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
  169. FILES:${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala"
  170. FILES:${PN}-bin += "${sysconfdir}/default/volatiles/04_pulse"
  171. FILES:${PN}-pa-info = "${bindir}/pa-info"
  172. FILES:${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
  173. FILES:${PN}-server += "${datadir}/dbus-1/system.d/pulseaudio-system.conf"
  174. #SYSTEMD_PACKAGES = "${PN}-server"
  175. SYSTEMD_SERVICE:${PN}-server = "pulseaudio.service"
  176. FILES:${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
  177. # Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
  178. FILES:${PN} = ""
  179. ALLOW_EMPTY:${PN} = "1"
  180. CONFFILES:libpulse = "${sysconfdir}/pulse/client.conf"
  181. CONFFILES:pulseaudio-server = "\
  182. ${sysconfdir}/pulse/default.pa \
  183. ${sysconfdir}/pulse/daemon.conf \
  184. ${sysconfdir}/pulse/system.pa \
  185. "
  186. pkg_postinst:${PN}-server() {
  187. if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
  188. ${sysconfdir}/init.d/populate-volatile.sh update
  189. fi
  190. }
  191. python populate_packages:prepend() {
  192. plugindir = d.expand('${libdir}/pulseaudio/modules/')
  193. do_split_packages(d, plugindir, r'^module-(.*)\.so$', '${PN}-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
  194. do_split_packages(d, plugindir, r'^lib(.*)\.so$', '${PN}-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
  195. }
  196. # pa-info is a bash script that collects information about the audio setup.
  197. # It's primarily useful for attaching an information dump when reporting bugs.
  198. RDEPENDS:${PN}-pa-info = "\
  199. alsa-utils-amixer \
  200. alsa-utils-aplay \
  201. alsa-utils-scripts \
  202. bash \
  203. ${PN}-server \
  204. "
  205. RDEPENDS:pulseaudio-server = " \
  206. pulseaudio-module-filter-apply \
  207. pulseaudio-module-filter-heuristics \
  208. pulseaudio-module-udev-detect \
  209. pulseaudio-module-null-sink \
  210. pulseaudio-module-device-restore \
  211. pulseaudio-module-stream-restore \
  212. pulseaudio-module-card-restore \
  213. pulseaudio-module-augment-properties \
  214. pulseaudio-module-detect \
  215. pulseaudio-module-alsa-sink \
  216. pulseaudio-module-alsa-source \
  217. pulseaudio-module-alsa-card \
  218. pulseaudio-module-native-protocol-unix \
  219. pulseaudio-module-default-device-restore \
  220. pulseaudio-module-intended-roles \
  221. pulseaudio-module-rescue-streams \
  222. pulseaudio-module-always-sink \
  223. pulseaudio-module-suspend-on-idle \
  224. pulseaudio-module-position-event-sounds \
  225. pulseaudio-module-role-cork \
  226. pulseaudio-module-switch-on-port-available"
  227. # If the server is installed, it's usually desirable to make ALSA applications
  228. # use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
  229. # that makes the PulseAudio plugin the default ALSA device.
  230. RDEPENDS:pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
  231. # pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
  232. # but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
  233. RDEPENDS:pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit x11', 'consolekit', '', d)}"
  234. RDEPENDS:pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
  235. FILES:${PN}-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
  236. GSETTINGS_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'gsettings', '${PN}-module-gsettings', '', d)}"
  237. FILES:${PN}-module-gsettings += "${libexecdir}/pulse/gsettings-helper ${datadir}/GConf/gsettings ${datadir}/glib-2.0/schemas"
  238. # The console-kit module is good to have on X11 systems (it keeps PulseAudio
  239. # running for the duration of the user login session). The device-manager and
  240. # x11-* modules are referenced from the start-pulseaudio-x11 script, so those
  241. # modules must be installed when X11 is enabled.
  242. RDEPENDS:pulseaudio-server += "\
  243. ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
  244. pulseaudio-module-device-manager \
  245. pulseaudio-module-x11-cork-request \
  246. pulseaudio-module-x11-publish \
  247. pulseaudio-module-x11-xsmp \
  248. ', '', d)}"
  249. RDEPENDS:pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', \
  250. bb.utils.contains('DISTRO_FEATURES', 'systemd', 'pulseaudio-module-systemd-login', 'pulseaudio-module-console-kit', d), \
  251. '', d)}"