# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" WX_GTK_VER="2.8" inherit autotools wxwidgets confutils DESCRIPTION="MediaInfo supplies technical and tag information about media files" HOMEPAGE="http://mediainfo.sourceforge.net" SRC_URI="cli? ( mirror://sourceforge/${PN}/MediaInfo_CLI_${PV}_GNU_FromSource.tar.bz2 ) wxwidgets? ( mirror://sourceforge/${PN}/MediaInfo_GUI_${PV}_GNU_FromSource.tar.bz2 )" S="${WORKDIR}" SZ="${S}/ZenLib/Project/GNU/Library" SL="${S}/MediaInfoLib/Project/GNU/Library" SC="${S}/MediaInfo/Project/GNU/CLI" SG="${S}/MediaInfo/Project/GNU/GUI" LICENSE="GPL-3 LGPL-3 ZLIB" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" IUSE="+cli curl debug libmms unicode wxwidgets" DEPEND="sys-libs/zlib curl? ( net-misc/curl ) libmms? ( >=media-libs/libmms-0.4 ) wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )" RDEPEND="${DEPEND}" pkg_setup() { ! use cli && ! use wxwidgets && die "Nothing to build, enable cli or/and gui." SBuild="${SZ} ${SL}" SInstall="" if use cli; then SBuild="${SBuild} ${SC}" SInstall="${SInstall} ${SC}" fi use wxwidgets && SInstall="${SInstall} ${SG}" use cli && use wxwidgets && SInstall="${SZ} ${SL} ${SInstall}" } src_prepare() { use cli && cp -rf MediaInfo_CLI_GNU_FromSource/* ./ use wxwidgets && cp -rf MediaInfo_GUI_GNU_FromSource/* ./ rm -rf MediaInfo_*_GNU_FromSource } src_compile() { local myconf=" --disable-option-checking \ --disable-dependency-tracking \ $(use_enable debug) \ $(use_enable unicode) \ $(use_with curl libcurl) \ $(use_with libmms) \ " local myXconf=" $(use_with wxwidgets wxwidgets) \ $(use_with wxwidgets wx-gui) \ $(use_with wxwidgets wx-config ${WX_CONFIG}) \ " if use cli && use wxwidgets; then myconf="${myconf} --enable-shared=yes --enable-static=no --disable-staticlibs" else myconf="${myconf} --enable-shared=no --enable-static=yes --enable-staticlibs" fi # We normally do every step in src_prepare, src_configure and src_compile, but libzen must be compiled before configuring libmediainfo for d in ${SBuild}; do cd ${d} eautoreconf econf ${myconf} || die "econf failed in ${d}" emake || die "emake failed in ${d}" done # GUI needs other options if use wxwidgets; then cd ${SG} eautoreconf econf ${myconf} ${myXconf} || die "econf failed in ${SG}" emake || die "emake failed in ${SG}" fi } src_install() { for d in ${SInstall}; do emake DESTDIR="${D}" -C ${d} install || die "emake install failed in ${d}" done dodoc MediaInfo/History*.txt MediaInfoLib/*.txt \ MediaInfo/Release/ReadMe*Linux.txt MediaInfoLib/Release/ReadMe*Linux.txt \ ZenLib/*.txt if use wxwidgets; then newicon MediaInfo/Source/Ressource/Image/MediaInfo.png ${PN}.png make_desktop_entry "${PN}-gui" "MediaInfo" "${PN}" "AudioVideo;GTK;" fi }