# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils qt3 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 gui matlab mpi qt3 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 ) mpi? ( 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() { export myconf="" 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 gui; then myconf="${myconf} gui=yes" else myconf="${myconf} gui=no" fi if use matlab; then if [ -d /usr/local/matlab ] ; then myconf="${myconf} matlab=yes" else die "Xmipp expects matlab in /usr/local/matlab/ when the matlab use flag is set." fi else myconf="${myconf} matlab=no" fi if use mpi; then local my_mpidir="/usr/$(get_libdir)" einfo "mpidir is ${my_mpidir}" myconf="${myconf} MPI_LIBDIR=${my_mpidir} MPI_LIB=mpi mpi=yes" else myconf="${myconf} mpi=no" fi if use qt3 ; then export LIBRARY_PATH="${QTDIR}/$(get_libdir):${LIBRARY_PATH}" export QTDIR 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}" einfo "Running ${S}/scons.configure with options:" einfo "${myconf} CXXFLAGS=${CXXFLAGS}" ${S}/scons.configure ${myconf} CXXFLAGS="${CXXFLAGS}"|| die "configure failed" einfo "Running ${S}/scons.compile with options:" einfo "${MAKEOPTS}" ${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} }