| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/pulseaudio-1.99.2.ebuild,v 1.4 2012/05/05 08:49:55 mgorny Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils libtool flag-o-matic versionator
|
| 8 |
|
| 9 |
DESCRIPTION="A networked sound server with an advanced plugin system"
|
| 10 |
HOMEPAGE="http://www.pulseaudio.org/"
|
| 11 |
|
| 12 |
SRC_URI="http://freedesktop.org/software/pulseaudio/releases/${P}.tar.xz"
|
| 13 |
|
| 14 |
# libpulse-simple and libpulse link to libpulse-core; this is daemon's
|
| 15 |
# library and can link to gdbm and other GPL-only libraries. In this
|
| 16 |
# cases, we have a fully GPL-2 package. Leaving the rest of the
|
| 17 |
# GPL-forcing USE flags for those who use them.
|
| 18 |
LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
|
| 19 |
SLOT="0"
|
| 20 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
|
| 21 |
IUSE="+alsa avahi +caps equalizer jack lirc oss tcpd +X dbus libsamplerate gnome bluetooth +asyncns +glib test doc +udev ipv6 system-wide realtime +orc ssl +gdbm +webrtc-aec"
|
| 22 |
|
| 23 |
RDEPEND=">=media-libs/libsndfile-1.0.20
|
| 24 |
X? (
|
| 25 |
>=x11-libs/libX11-1.4.0
|
| 26 |
>=x11-libs/libxcb-1.6
|
| 27 |
>=x11-libs/xcb-util-0.3.1
|
| 28 |
x11-libs/libSM
|
| 29 |
x11-libs/libICE
|
| 30 |
x11-libs/libXtst
|
| 31 |
)
|
| 32 |
caps? ( sys-libs/libcap )
|
| 33 |
libsamplerate? ( >=media-libs/libsamplerate-0.1.1-r1 )
|
| 34 |
alsa? ( >=media-libs/alsa-lib-1.0.19 )
|
| 35 |
glib? ( >=dev-libs/glib-2.4.0 )
|
| 36 |
avahi? ( >=net-dns/avahi-0.6.12[dbus] )
|
| 37 |
jack? ( >=media-sound/jack-audio-connection-kit-0.117 )
|
| 38 |
tcpd? ( sys-apps/tcp-wrappers )
|
| 39 |
lirc? ( app-misc/lirc )
|
| 40 |
dbus? ( >=sys-apps/dbus-1.0.0 )
|
| 41 |
gnome? ( >=gnome-base/gconf-2.4.0 )
|
| 42 |
bluetooth? (
|
| 43 |
>=net-wireless/bluez-4
|
| 44 |
>=sys-apps/dbus-1.0.0
|
| 45 |
)
|
| 46 |
asyncns? ( net-libs/libasyncns )
|
| 47 |
udev? ( || ( >=sys-fs/udev-171[hwdb] >=sys-fs/udev-143[extras] ) )
|
| 48 |
realtime? ( sys-auth/rtkit )
|
| 49 |
equalizer? ( sci-libs/fftw:3.0 )
|
| 50 |
orc? ( >=dev-lang/orc-0.4.9 )
|
| 51 |
ssl? ( dev-libs/openssl )
|
| 52 |
>=media-libs/speex-1.2_rc1
|
| 53 |
gdbm? ( sys-libs/gdbm )
|
| 54 |
webrtc-aec? ( media-libs/webrtc-audio-processing )
|
| 55 |
dev-libs/json-c
|
| 56 |
>=sys-devel/libtool-2.2.4" # it's a valid RDEPEND, libltdl.so is used
|
| 57 |
|
| 58 |
DEPEND="${RDEPEND}
|
| 59 |
doc? ( app-doc/doxygen )
|
| 60 |
X? (
|
| 61 |
x11-proto/xproto
|
| 62 |
>=x11-libs/libXtst-1.0.99.2
|
| 63 |
)
|
| 64 |
dev-libs/libatomic_ops
|
| 65 |
virtual/pkgconfig
|
| 66 |
system-wide? ( || ( dev-util/unifdef sys-freebsd/freebsd-ubin ) )
|
| 67 |
dev-util/intltool"
|
| 68 |
# This is a PDEPEND to avoid a circular dep
|
| 69 |
PDEPEND="alsa? ( media-plugins/alsa-plugins[pulseaudio] )"
|
| 70 |
|
| 71 |
# alsa-utils dep is for the alsasound init.d script (see bug #155707)
|
| 72 |
# bluez dep is for the bluetooth init.d script
|
| 73 |
RDEPEND="${RDEPEND}
|
| 74 |
X? ( gnome-extra/gnome-audio )
|
| 75 |
system-wide? (
|
| 76 |
sys-apps/openrc
|
| 77 |
alsa? ( media-sound/alsa-utils )
|
| 78 |
bluetooth? ( >=net-wireless/bluez-4 )
|
| 79 |
)"
|
| 80 |
|
| 81 |
# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
|
| 82 |
REQUIRED_USE="bluetooth? ( dbus )"
|
| 83 |
|
| 84 |
pkg_setup() {
|
| 85 |
enewgroup audio 18 # Just make sure it exists
|
| 86 |
enewgroup pulse-access
|
| 87 |
enewgroup pulse
|
| 88 |
enewuser pulse -1 -1 /var/run/pulse pulse,audio
|
| 89 |
}
|
| 90 |
|
| 91 |
src_configure() {
|
| 92 |
# It's a binutils bug, once I can find time to fix that I'll add a
|
| 93 |
# proper dependency and fix this up. — flameeyes
|
| 94 |
append-ldflags $(no-as-needed)
|
| 95 |
|
| 96 |
if use gdbm; then
|
| 97 |
myconf+=" --with-database=gdbm"
|
| 98 |
#elif use tdb; then
|
| 99 |
# myconf+=" --with-database=tdb"
|
| 100 |
else
|
| 101 |
myconf+=" --with-database=simple"
|
| 102 |
fi
|
| 103 |
|
| 104 |
econf \
|
| 105 |
--enable-largefile \
|
| 106 |
$(use_enable glib glib2) \
|
| 107 |
--disable-solaris \
|
| 108 |
$(use_enable asyncns) \
|
| 109 |
$(use_enable oss oss-output) \
|
| 110 |
$(use_enable alsa) \
|
| 111 |
$(use_enable lirc) \
|
| 112 |
$(use_enable tcpd tcpwrap) \
|
| 113 |
$(use_enable jack) \
|
| 114 |
$(use_enable lirc) \
|
| 115 |
$(use_enable avahi) \
|
| 116 |
--disable-hal \
|
| 117 |
$(use_enable dbus) \
|
| 118 |
$(use_enable gnome gconf) \
|
| 119 |
$(use_enable libsamplerate samplerate) \
|
| 120 |
$(use_enable bluetooth bluez) \
|
| 121 |
$(use_enable X x11) \
|
| 122 |
$(use_enable test default-build-tests) \
|
| 123 |
$(use_enable udev) \
|
| 124 |
$(use_enable ipv6) \
|
| 125 |
$(use_enable ssl openssl) \
|
| 126 |
$(use_enable webrtc-aec) \
|
| 127 |
$(use_with caps) \
|
| 128 |
$(use_with equalizer fftw) \
|
| 129 |
--disable-adrian-aec \
|
| 130 |
--disable-esound \
|
| 131 |
--localstatedir="${EPREFIX}"/var \
|
| 132 |
--with-udev-rules-dir="${EPREFIX}/lib/udev/rules.d" \
|
| 133 |
${myconf}
|
| 134 |
|
| 135 |
if use doc; then
|
| 136 |
pushd doxygen
|
| 137 |
doxygen doxygen.conf
|
| 138 |
popd
|
| 139 |
fi
|
| 140 |
}
|
| 141 |
|
| 142 |
src_test() {
|
| 143 |
# We avoid running the toplevel check target because that will run
|
| 144 |
# po/'s tests too, and they are broken. Officially, it should work
|
| 145 |
# with intltool 0.41, but that doesn't look like a stable release.
|
| 146 |
emake -C src check
|
| 147 |
}
|
| 148 |
|
| 149 |
src_install() {
|
| 150 |
emake -j1 DESTDIR="${D}" install
|
| 151 |
|
| 152 |
# Drop the script entirely if X is disabled
|
| 153 |
use X || rm "${ED}"/usr/bin/start-pulseaudio-x11
|
| 154 |
|
| 155 |
if use system-wide; then
|
| 156 |
newconfd "${FILESDIR}/pulseaudio.conf.d" pulseaudio
|
| 157 |
|
| 158 |
use_define() {
|
| 159 |
local define=${2:-$(echo $1 | tr '[:lower:]' '[:upper:]')}
|
| 160 |
|
| 161 |
use "$1" && echo "-D$define" || echo "-U$define"
|
| 162 |
}
|
| 163 |
|
| 164 |
unifdef $(use_define avahi) \
|
| 165 |
$(use_define alsa) \
|
| 166 |
$(use_define bluetooth) \
|
| 167 |
$(use_define udev) \
|
| 168 |
"${FILESDIR}/pulseaudio.init.d-5" \
|
| 169 |
> "${T}/pulseaudio"
|
| 170 |
|
| 171 |
doinitd "${T}/pulseaudio"
|
| 172 |
fi
|
| 173 |
|
| 174 |
use avahi && sed -i -e '/module-zeroconf-publish/s:^#::' "${ED}/etc/pulse/default.pa"
|
| 175 |
|
| 176 |
dodoc README todo
|
| 177 |
|
| 178 |
if use doc; then
|
| 179 |
pushd doxygen/html
|
| 180 |
dohtml *
|
| 181 |
popd
|
| 182 |
fi
|
| 183 |
|
| 184 |
# Create the state directory
|
| 185 |
use prefix || diropts -o pulse -g pulse -m0755
|
| 186 |
keepdir /var/run/pulse
|
| 187 |
|
| 188 |
find "${D}" -name '*.la' -delete
|
| 189 |
}
|
| 190 |
|
| 191 |
pkg_postinst() {
|
| 192 |
if use system-wide; then
|
| 193 |
elog "PulseAudio in Gentoo can use a system-wide pulseaudio daemon."
|
| 194 |
elog "This support is enabled by starting the pulseaudio init.d ."
|
| 195 |
elog "To be able to access that you need to be in the group pulse-access."
|
| 196 |
elog "If you choose to use this feature, please make sure that you"
|
| 197 |
elog "really want to run PulseAudio this way:"
|
| 198 |
elog " http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode"
|
| 199 |
elog "For more information about system-wide support, please refer to:"
|
| 200 |
elog " http://pulseaudio.org/wiki/SystemWideInstance"
|
| 201 |
if use gnome ; then
|
| 202 |
elog
|
| 203 |
elog "By enabling gnome USE flag, you enabled gconf support. Please note"
|
| 204 |
elog "that you might need to remove the gnome USE flag or disable the"
|
| 205 |
elog "gconf module on /etc/pulse/system.pa to be able to use PulseAudio"
|
| 206 |
elog "with a system-wide instance."
|
| 207 |
fi
|
| 208 |
fi
|
| 209 |
if use bluetooth; then
|
| 210 |
elog
|
| 211 |
elog "The Bluetooth proximity module is not enabled in the default"
|
| 212 |
elog "configuration file. If you do enable it, you'll have to have"
|
| 213 |
elog "your Bluetooth controller enabled and inserted at bootup or"
|
| 214 |
elog "PulseAudio will refuse to start."
|
| 215 |
fi
|
| 216 |
|
| 217 |
eselect esd update --if-unset
|
| 218 |
}
|