Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Sound server for Linux and Unix-like operating systems" |
| 2 | HOMEPAGE = "http://www.pulseaudio.org" |
| 3 | AUTHOR = "Lennart Poettering" |
| 4 | SECTION = "libs/multimedia" |
| 5 | LICENSE = "GPLv2+ & LGPLv2.1" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d9ae089c8dc5339f8ac9d8563038a29f \ |
| 7 | file://GPL;md5=4325afd396febcb659c36b49533135d4 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \ |
| 9 | file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84" |
| 10 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 11 | DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | # optional |
| 13 | DEPENDS += "udev alsa-lib glib-2.0 gconf" |
| 14 | DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap" |
| 15 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
| 18 | # *.desktop rules wont be generated during configure and build will fail |
| 19 | # if using --disable-nls |
| 20 | USE_NLS = "yes" |
| 21 | |
| 22 | EXTRA_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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 34 | --disable-tests \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | " |
| 36 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 37 | # 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. |
| 39 | EXTRA_OECONF += "--without-soxr" |
| 40 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | PACKAGECONFIG ??= "${@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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 46 | ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | dbus \ |
| 48 | " |
| 49 | |
| 50 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" |
| 51 | PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc" |
| 52 | PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc" |
| 53 | PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono" |
| 54 | PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3" |
| 55 | PACKAGECONFIG[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" |
| 56 | PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb" |
| 57 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 58 | PACKAGECONFIG[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. |
| 61 | PACKAGECONFIG[autospawn-for-root] = ",,," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 62 | PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 63 | PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing" |
| 64 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | |
| 66 | EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}" |
| 67 | EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}" |
| 68 | |
| 69 | |
| 70 | export TARGET_PFPU = "${TARGET_FPU}" |
| 71 | |
| 72 | # TODO: Use more fine granular version |
| 73 | #OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:" |
| 74 | OE_LT_RPATH_ALLOW = "any" |
| 75 | OE_LT_RPATH_ALLOW[export]="1" |
| 76 | |
| 77 | set_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 | |
| 84 | do_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 | |
| 90 | do_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 | |
| 95 | USERADD_PACKAGES = "pulseaudio-server" |
| 96 | GROUPADD_PARAM_pulseaudio-server = "pulse" |
| 97 | USERADD_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. |
| 105 | PACKAGES =+ "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: |
| 109 | RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf" |
| 110 | |
| 111 | PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*" |
| 112 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 113 | FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so" |
| 115 | |
| 116 | # client.conf configures the behaviour of libpulse, so it belongs in the same |
| 117 | # package. |
| 118 | FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf" |
| 119 | |
| 120 | FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*" |
| 121 | FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*" |
| 122 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 123 | FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake" |
| 124 | FILES_${PN}-conf = "${sysconfdir}" |
| 125 | FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse" |
| 126 | FILES_${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" |
| 129 | SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service" |
| 130 | |
| 131 | FILES_${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) |
| 134 | ALLOW_EMPTY_${PN} = "1" |
| 135 | |
| 136 | CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf" |
| 137 | |
| 138 | CONFFILES_pulseaudio-server = "\ |
| 139 | ${sysconfdir}/pulse/default.pa \ |
| 140 | ${sysconfdir}/pulse/daemon.conf \ |
| 141 | ${sysconfdir}/pulse/system.pa \ |
| 142 | " |
| 143 | |
| 144 | pkg_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 | |
| 150 | python 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 | |
| 158 | RDEPENDS_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. |
| 184 | RDEPENDS_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 |
| 188 | RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}" |
| 189 | RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix" |
| 190 | |
| 191 | FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper" |
| 192 | FILES_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. |
| 198 | RDEPENDS_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)}" |