# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils EAPI="2" DESCRIPTION="Prediction and design of protein structures, folding mechanisms, and protein-protein interactions" HOMEPAGE="http://www.rosettacommons.org/" SRC_URI="https://www.rosettacommons.org/software/academic/2.3.0/rosetta++_source-${PV}.tgz" RESTRICT="fetch test" LICENSE="rosetta" SLOT="0" KEYWORDS="~x86" IUSE="boinc opengl mpi debug doc icc profile test static" RDEPEND=" mpi? ( virtual/mpi ) boinc? ( sci-misc/boinc ) " DEPEND="${RDEPEND} >=dev-util/scons-0.96.1 doc? ( app-doc/doxygen ) icc? ( dev-lang/icc ) test? ( dev-libs/boost ) sys-apps/sed sys-apps/findutils" S="${WORKDIR}/rosetta++" MYCONF="" pkg_nofetch() { einfo "Please fill out the registration form at" einfo \ "http://depts.washington.edu/ventures/UW_Technology/Express_Licenses/rosetta.php" einfo "Then download the file ${A} manually " einfo "and place it into ${DISTDIR} ." einfo "If you prefer to download RosettaBundle-2.3.0.tgz instead," einfo "then, after having unpacked the bundle, the file " einfo "'rosetta++_srouce-2.3.0.tgz' has to be renamed to " einfo "'rosetta++-source-2.3.0.tgz' manually, due to a typo" einfo "which is present only in RosettaBundle-2.3.0.tgz" } src_prepare() { epatch "${FILESDIR}/rosetta-elliptic-msd.patch" epatch "${FILESDIR}/rosetta-gl-graphics.patch" epatch "${FILESDIR}/rosetta-setup-platforms.patch" epatch "${FILESDIR}/rosetta-options-settings.patch" epatch "${FILESDIR}/rosetta-FileName-cc-ostream.patch" epatch "${FILESDIR}/rosetta-PathName-cc-ostream.patch" epatch "${FILESDIR}/rosetta-basic-settings-nostdc99.patch" epatch "${FILESDIR}/rosetta-SConscript-src-use-clone.patch" epatch "${FILESDIR}/rosetta-SConscript-src-2-use-clone.patch" epatch "${FILESDIR}/rosetta-string-functions-cc.patch" epatch "${FILESDIR}/rosetta-zipstream-ipp.patch" epatch "${FILESDIR}/rosetta-DirectedSimAnnealer-cc.patch" epatch "${FILESDIR}/rosetta-dna-cc.patch" epatch "${FILESDIR}/rosetta-kin_id-h.patch" epatch "${FILESDIR}/rosetta-dna_classes-h.patch" epatch "${FILESDIR}/rosetta-loop_class-h.patch" epatch "${FILESDIR}/rosetta-barcode_classes-h.patch" epatch "${FILESDIR}/rosetta-packing_measures-cc.patch" epatch "${FILESDIR}/rosetta-XUtilities-cc.patch" epatch "${FILESDIR}/rosetta-basic-settings-nostrip.patch" epatch "${FILESDIR}/rosetta-basic-settings-gcc43.patch" epatch "${FILESDIR}/rosetta-barcode_classes-h-unitialized.patch" epatch "${FILESDIR}/rosetta-marchingCubes-cc-missing-braces.patch" #UPSTREAM: source archive contains headers and sourcefiles marked as executable # (don't want to install executable headers by stripdebug feature) find "${S}" -name '*.h' -exec chmod a-x {} ';' find "${S}" -name '*.hh' -exec chmod a-x {} ';' find "${S}" -name '*.cc' -exec chmod a-x {} ';' #UPSTREAM: "README" was obviously renamed to "README.rosetta++", but is # still referenced as "README" # -> create a symlink, because else scons cat=doc fails if use doc; then ln -s "${S}/README.rosetta++" "${S}/README" fi } src_unpack() { unpack ${A} } my_filter_option() { local value="$1" local exp="$2" local result=`echo ${value} | sed -e s/${exp}//g` echo "${result}" return 0; } src_configure() { local myextras="" local mymode="" local mycxx="" local myfiles="" use boinc && myextras="boinc" if use opengl; then test -n "${myextras}" && myextras="${myextras}," myextras="${myextras}graphics" fi if use mpi; then test -n "${myextras}" && myextras="${myextras}," myextras="${myextras}mpi" fi #UPSTREAM:dynamic linking is only performed if "valgrind" # was specified: see tools/build/setup*.py if ( ! use static ); then test -n "${myextras}" && myextras="${myextras}," myextras="${myextras}valgrind" fi #FIXME: uncertain if a newly invented use flag is appropriate use icc && mycxx="cxx=icc" test -n "${myextras}" && myextras="extras=${myextras}" if use debug; then mymode="debug" elif use profile; then mymode="profile" else mymode="release" fi #Bug: scons issues a __warning__ about -l not yet being # supported, but then simply aborts. einfo "filtering MAKOPTS for -l --load-average ..." MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "--load-average[=0-9.]*") MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "-l[0-9.]*") # add a filter for any other insane flag here MYCONF="${MAKEOPTS} mode=${mymode} ${myextras} ${mycxx}" } src_compile() { #UPSTREAM: scons script returns ok even after a RuntimeError was raised # exception handler in toplevel SConstruct file is probably # incomplete einfo "running 'scons ${MYCONF}' ..." scons ${MYCONF} || die "scons ${MYCONF} failed" #Workaround: see if at least one rosetta executable exists # problem: executable name is rosetta.release||rosetta.debug # rosetta.gcc || ... local myfiles=`ls -l "${S}"/bin/rosetta* 2>/dev/null | wc -l`; if test ${myfiles} -eq 0; then die "scons ${MYCONF} failed" fi if use doc; then einfo "running scons ${MYCONF} cat=doc ..." scons ${MYCONF} cat=doc || die "scons failed to build documentation" #UPSTREAM: rosetta doxygen source documentation make is broken #scons doc || die "scons failed to build documentation" fi } src_test() { #UPSTREAM: 1. multiple library naming issues (libutil_release.a vs libutil.a) # 2. undefined symbol main, if these naming issues are fixed # manually # 3. boost dependency for test target only ... #scons testing #scons ${MYCONF} cat=test || die "scons ${MYCONF} cat=test failed" elog "The rosetta test target is still completely broken" } src_install() { #install executable(s) dobin bin/* #UPSTREAM: there is a complete doxy-generated source documentation, # but not yet compilable via scons if use doc; then dohtml build/doc/rosetta++/docs/* fi #UPSTREAM: a copy of rosetta++ license should be part of archive #FIXME: what is the officially correct procedure to install a license # ${PORTAGE_ROOT} is not available here (unset) #install rosetta license as obtained from www.rosettacommons.org #insinto "/usr/portage/licenses" && doins "${FILESDIR}/static/rosetta" }