# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs qt4 DESCRIPTION="Voice chat software for gaming written in Qt4" HOMEPAGE="http://mumble.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="dbus portaudio pulseaudio alsa oss texttospeech" DEPEND="$(qt4_min_version 4.3) >=media-libs/speex-1.2_beta3 dev-libs/boost x11-libs/libXevie dbus? ( sys-apps/dbus ) alsa? ( media-libs/alsa-lib ) portaudio? ( media-libs/portaudio ) pulseaudio? ( media-sound/pulseaudio ) texttospeech? ( app-accessibility/festival app-accessibility/speech-dispatcher )" RDEPEND="${DEPEND}" pkg_setup() { if ! built_with_use -a =x11-libs/qt-4* sqlite3 dbus ; then echo if ! built_with_use =x11-libs/qt-4* sqlite3; then eerror "You need to build Qt4 with the sqlite3 use-flag" fi if ! built_with_use =x11-libs/qt-4* dbus; then eerror "You need to build Qt4 with the dbus use-flag" fi echo die "Your Qt4 installation lacks propper useflag configuration, see above" fi # this check is extra, so that both useflag dependencies in qt can be shown # at once if needed. if ! use dbus && ! built_with_use =x11-libs/qt-4* sqlite3; then eerror "You need to build Qt4 with the sqlite3 use-flag" die "Your Qt4 installation lacks propper useflag configuration, see above" fi if [[ $(gcc-major-version) -eq 3 && $(gcc-minor-version) -lt 4 ]]; then eerror "You need >=sys-devel/gcc-3.4 to compile ${PN}." die "System gcc is too old to compile ${PN}." fi } src_unpack() { unpack ${A} cd "${S}" #getting rid of carrier returns sed -i -e 's/\r$//' "${S}"/main.pro sed -i -e '/CONFIG += ordered/s/$/ no-server no-bundled-speex/' \ "${S}"/main.pro || die sed -i -e '/LIBS /s/-lspeex/& -lspeexdsp/' \ "${S}"/src/mumble/mumble.pro || die local conf_add="" use dbus || conf_add="${conf_add} no-dbus" use portaudio || conf_add="${conf_add} no-portaudio" use pulseaudio || conf_add="${conf_add} no-pulseaudio" use alsa || conf_add="${conf_add} no-alsa" use oss || conf_add="${conf_add} no-oss" use texttospeech || conf_add="${conf_add} no-speechd" [ -z "${conf_add}" ] || sed -i -e "/CONFIG\t\t+= qt /s/$/${conf_add}/" \ "${S}"/src/mumble.pri || die } src_compile() { qmake "${S}/main.pro" sed -i -e 's/-include release\/mumble //g' ${S}/src/mumble/Makefile.Release emake } src_install() { newdoc README.Linux README dodoc CHANGES local dir if built_with_use =x11-libs/qt-4* debug; then dir=debug ewarn "Built debug-version because your Qt4 has the debug use-flag enabled." else dir=release fi dobin ${dir}/mumble || die "installing failed" dolib.so ${dir}/lib*.so* || die "installing failed" dobin scripts/mumble-overlay || die "installing failed" newicon icons/mumble.64x64.png mumble.png || die "installing icon failed" make_desktop_entry ${PN} "Mumble" mumble "KDE;Qt;AudioVideo" \ || die "installing menu entry failed" doman man/mumble-overlay.1 doman man/mumble.1 insinto /usr/share/services use dbus && doins scripts/mumble.protocol } pkg_postinst() { elog elog "Visit http://mumble.sourceforge.net/Audio_Tuning for futher configuration" elog "type mumble to run the client" elog "you might want to add this to your xorg.conf to get shortcut support" elog " Section \"Extensions\"" elog " Option \"XEVIE\" \"Enable\"" elog " EndSection" }