diff -ur libkate.orig//libkate-0.4.1.ebuild libkate//libkate-0.4.1.ebuild --- libkate.orig//libkate-0.4.1.ebuild 2011-09-09 02:00:27.000000000 +0800 +++ libkate//libkate-0.4.1.ebuild 2011-11-26 20:05:20.947000055 +0800 @@ -2,6 +2,10 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-libs/libkate/libkate-0.4.1.ebuild,v 1.1 2011/09/08 18:00:27 aballier Exp $ +EAPI="3" +PYTHON_DEPEND="wxwidgets? 2" +inherit python + DESCRIPTION="Codec for karaoke and text encapsulation for Ogg" HOMEPAGE="http://code.google.com/p/libkate/" SRC_URI="http://libkate.googlecode.com/files/${P}.tar.gz" @@ -14,7 +18,6 @@ COMMON_DEPEND="media-libs/libogg media-libs/libpng" DEPEND="${COMMON_DEPEND} - wxwidgets? ( dev-lang/python ) dev-util/pkgconfig sys-devel/flex sys-devel/bison @@ -22,13 +25,42 @@ RDEPEND="${COMMON_DEPEND} wxwidgets? ( =dev-python/wxpython-2.8* media-libs/liboggz )" -src_compile() { +pkg_setup() { + if use wxwidgets; then + python_set_active_version 2 + python_pkg_setup + fi +} + +src_prepare() { + echo "#!/bin/sh" > misc/autotools/py-compile +} + +src_configure() { use wxwidgets || sed -i -e "s/HAVE_PYTHON=yes/HAVE_PYTHON=no/" configure econf $(use_enable debug) $(use_enable doc) --docdir=/usr/share/doc/${PF} +} + +src_compile() { emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "make install failed" dodoc AUTHORS ChangeLog README + if use wxwidgets; then + python_convert_shebangs -r 2 "${D}" + fi +} + +pkg_postinst() { + if use wxwidgets; then + python_mod_optimize kdj + fi +} + +pkg_postrm() { + if use wxwidgets; then + python_mod_cleanup kdj + fi }