# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3
inherit eutils

DESCRIPTION="Stereoscopic media player"
HOMEPAGE="http://www.sview.ru/"
SRC_URI="http://www.sview.ru/repository/src/${PN}-${PV}-1.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="custom-cflags"
RDEPEND="x11-libs/gtk+:2
	>=media-libs/glew-1.5.0
	media-libs/openal
	media-libs/mesa"
DEPEND="${RDEPEND}"
RESTRICT="strip"
S="${WORKDIR}/${PN}-${PV}-1"

src_prepare() {
if use custom-cflags; then
	cd "${S}"
	sed -i -e 's/CXXFLAGS = -O3 -std=c++0x -Wall -fPIC -mmmx -msse `pkg-config gtk+-2.0 --cflags` $(INC)/CXXFLAGS = -O3 -std=c++0x -Wall -fPIC -mmmx -msse $(CFLAGS) `pkg-config gtk+-2.0 --cflags` $(INC)/' Makefile || die
	emake CFLAGS="${CFLAGS}" || die "emake failed"
fi
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
}