# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils qt3 qt4 MY_P='Xmipp-2.2-src' DESCRIPTION="X-Window-based Microscopy Image Processing Package" HOMEPAGE="http://xmipp.cnb.csic.es/" SRC_URI="mirror://berlios/${PN}/${MY_P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64" IUSE="debug doc matlab qt3 qt4 static swig tiff warn" DOWNLOAD_URL="http://xmipp.cnb.csic.es/Downloads/contact.php" RDEPEND="qt3? ( x11-libs/qt:3 app-shells/tcsh ) qt4? ( || ( x11-libs/qt-gui:4 >=x11-libs/qt-4.1.0:4 ) app-shells/tcsh ) sys-cluster/openmpi tiff? ( media-libs/tiff )" DEPEND="${RDEPEND} swig? ( dev-lang/swig ) >=dev-lang/python-2.3 dev-util/scons dev-util/pkgconfig" RESTRICT="fetch" S=${WORKDIR}/${MY_P} pkg_nofetch() { einfo "Please download Xmipp-2.2-src.tar.gz from" einfo "${DOWNLOAD_URL}" einfo "(select version 2.2 and source for platform) and place it in ${DISTDIR}." } pkg_setup() { # gui needs tkinter if ( use qt3 || use qt4 ); then if ! built_with_use dev-lang/python tk; then ewarn "dev-lang/python must be built with tk for the gui interface" ewarn "to function." die "recompile python with USE=\"tk\"" fi fi } src_compile() { local myconf="" local mybuild="" if use doc; then myconf="${myconf} docs=yes" else myconf="${myconf} docs=no" fi if use debug; then myconf="${myconf} debug=yes" else myconf="${myconf} debug=no" fi if use matlab; then myconf="${myconf} matlab=yes" else myconf="${myconf} matlab=no" fi if use qt4; then QTDIR="/usr/$(get_libdir)" einfo "using QTDIR: '$QTDIR'." local my_qt_lib="${QTDIR}/qt4" einfo "using QT LIBRARY_PATH: '$my_qt_lib'." myconf="${myconf} QT4=yes gui=yes QTDIR=${QTDIR} QT_LIB=${my_qt_lib}" elif use qt3 ; then QTDIR="/usr/qt/3" einfo "using QTDIR: '$QTDIR'." local my_qt_lib="${QTDIR}/$(get_libdir)" einfo "using QT LIBRARY_PATH: '$my_qt_lib'." myconf="${myconf} QT4=no gui=yes QTDIR=${QTDIR} QT_LIB=${my_qt_lib}" else myconf="${myconf} gui=no" fi if use static; then myconf="${myconf} static=yes" else myconf="${myconf} static=no" fi if use swig; then myconf="${myconf} swig=yes" else myconf="${myconf} swig=no" fi if use tiff; then myconf="${myconf} tiff=yes" else myconf="${myconf} tiff=no" fi if use warn; then myconf="${myconf} warn=yes" else myconf="${myconf} warn=no" fi myconf="${myconf} ${MAKEOPTS} mpi=yes" ${S}/scons.configure ${myconf} CXXFLAGS="${CXXFLAGS}"|| die "configure failed" ${S}/scons.compile ${MAKEOPTS} || die "compile failed" if use doc; then ${S}/scons.docs ${MAKEOPTS} || die "make docs failed" fi } src_install() { into /usr/local dolib.so ${S}/lib/* if [ -d ${S}/documentation ] ; then dodoc -r ${S}/documentation/html/ fi mkdir -p "$D/bin" exeinto /usr/local/bin doexe ${S}/bin/* if [ -d ${S}/protocols ] ; then mkdir -p "$D/protocols" exeinto "/usr/local/protocols" doexe ${S}/protocols/* # sed -i "s:set scriptdir.*:set scriptdir=/usr/local/protocols:" ${D}/usr/local/bin/xmipp_gui # sed -i "s:set scriptdir.*:set scriptdir=/usr/local/protocols:" ${D}/usr/local/bin/xmipp_protocols fi prepall make_desktop_entry ${PN} "${PN}" ${PN} }