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" |
| 6 | LIC_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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 10 | DEPENDS = "libatomic-ops libsndfile1 libtool" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | # optional |
| 12 | DEPENDS += "udev alsa-lib glib-2.0 gconf" |
| 13 | DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap" |
| 14 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | |
| 17 | # *.desktop rules wont be generated during configure and build will fail |
| 18 | # if using --disable-nls |
| 19 | USE_NLS = "yes" |
| 20 | |
| 21 | EXTRA_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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | # 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. |
| 37 | EXTRA_OECONF += "--without-soxr" |
| 38 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | PACKAGECONFIG ??= "${@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 | |
| 47 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" |
| 48 | PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc" |
| 49 | PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc" |
| 50 | PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono" |
| 51 | PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3" |
| 52 | 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" |
| 53 | PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb" |
| 54 | PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" |
| 55 | PACKAGECONFIG[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. |
| 58 | PACKAGECONFIG[autospawn-for-root] = ",,," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 59 | PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | |
| 61 | EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}" |
| 62 | EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}" |
| 63 | |
| 64 | |
| 65 | export TARGET_PFPU = "${TARGET_FPU}" |
| 66 | |
| 67 | # TODO: Use more fine granular version |
| 68 | #OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:" |
| 69 | OE_LT_RPATH_ALLOW = "any" |
| 70 | OE_LT_RPATH_ALLOW[export]="1" |
| 71 | |
| 72 | set_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 | |
| 79 | do_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 | |
| 85 | do_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 | |
| 90 | USERADD_PACKAGES = "pulseaudio-server" |
| 91 | GROUPADD_PARAM_pulseaudio-server = "pulse" |
| 92 | USERADD_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. |
| 100 | PACKAGES =+ "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: |
| 104 | RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf" |
| 105 | |
| 106 | PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*" |
| 107 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 108 | FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so" |
| 110 | |
| 111 | # client.conf configures the behaviour of libpulse, so it belongs in the same |
| 112 | # package. |
| 113 | FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf" |
| 114 | |
| 115 | FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*" |
| 116 | FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*" |
| 117 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake" |
| 119 | FILES_${PN}-conf = "${sysconfdir}" |
| 120 | FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse" |
| 121 | FILES_${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" |
| 124 | SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service" |
| 125 | |
| 126 | FILES_${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) |
| 129 | ALLOW_EMPTY_${PN} = "1" |
| 130 | |
| 131 | CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf" |
| 132 | |
| 133 | CONFFILES_pulseaudio-server = "\ |
| 134 | ${sysconfdir}/pulse/default.pa \ |
| 135 | ${sysconfdir}/pulse/daemon.conf \ |
| 136 | ${sysconfdir}/pulse/system.pa \ |
| 137 | " |
| 138 | |
| 139 | pkg_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 | |
| 145 | python 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 | |
| 153 | RDEPENDS_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. |
| 179 | RDEPENDS_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 |
| 183 | RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}" |
| 184 | RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix" |
| 185 | |
| 186 | FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper" |
| 187 | FILES_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. |
| 193 | RDEPENDS_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)}" |