diff options
author | Justin Lecher (jlec) <jlec@j-schmitz.net> | 2009-04-13 19:51:23 +0200 |
---|---|---|
committer | Justin Lecher (jlec) <jlec@j-schmitz.net> | 2009-04-13 19:51:23 +0200 |
commit | 1817ba79eb1508bf4dfdf5d93136fd235dc3cd96 (patch) | |
tree | d74355706dcc080cd4da864afd589b48342b44c1 /sci-chemistry/rosetta | |
parent | dev-libs/libunzip added (diff) | |
download | sci-1817ba79eb1508bf4dfdf5d93136fd235dc3cd96.tar.gz sci-1817ba79eb1508bf4dfdf5d93136fd235dc3cd96.tar.bz2 sci-1817ba79eb1508bf4dfdf5d93136fd235dc3cd96.zip |
sci-chemistry/rosetta added
Diffstat (limited to 'sci-chemistry/rosetta')
-rw-r--r-- | sci-chemistry/rosetta/ChangeLog | 17 | ||||
-rw-r--r-- | sci-chemistry/rosetta/Manifest | 11 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-boinc.patch | 53 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-fix-scons-warnings.patch | 82 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-fix-valgrind.patch | 11 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-platform.patch | 11 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-user-settings.patch | 26 | ||||
-rw-r--r-- | sci-chemistry/rosetta/files/3.0-zlib.patch | 12 | ||||
-rw-r--r-- | sci-chemistry/rosetta/metadata.xml | 17 | ||||
-rw-r--r-- | sci-chemistry/rosetta/rosetta-3.0-r1.ebuild | 151 | ||||
-rw-r--r-- | sci-chemistry/rosetta/rosetta-3.0.ebuild | 140 |
11 files changed, 531 insertions, 0 deletions
diff --git a/sci-chemistry/rosetta/ChangeLog b/sci-chemistry/rosetta/ChangeLog new file mode 100644 index 000000000..69d600fb2 --- /dev/null +++ b/sci-chemistry/rosetta/ChangeLog @@ -0,0 +1,17 @@ +# ChangeLog for sci-chemistry/rosetta +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*rosetta-3.0 (13 Apr 2009) +*rosetta-3.0-r1 (13 Apr 2009) + + 13 Apr 2009; Justin Lecher (jlec) <jlec@j-schmitz.net> + +files/3.0-boinc.patch, +files/3.0-fix-scons-warnings.patch, + +files/3.0-fix-valgrind.patch, +files/3.0-platform.patch, + +files/3.0-user-settings.patch, +files/3.0-zlib.patch, +metadata.xml, + +rosetta-3.0-r1.ebuild, +rosetta-3.0.ebuild: + Added to sci + Thanks to Hugo Mildenberger for intial ebuild + BOINC support is broken because current version of libboinc_zip.a sucks (TEXTREL, not + compiled w/ fPIC) + diff --git a/sci-chemistry/rosetta/Manifest b/sci-chemistry/rosetta/Manifest new file mode 100644 index 000000000..c3ab1c2d6 --- /dev/null +++ b/sci-chemistry/rosetta/Manifest @@ -0,0 +1,11 @@ +AUX 3.0-boinc.patch 1465 RMD160 03589223e1e4a7ecf0a6a8d33aa6917c736ea176 SHA1 bb31126516df3fcdebb33fd1cb1a1c9a8332d764 SHA256 8b659950a55812eff06618e0b65e7b88eed0e115140a347674ab58975869b558 +AUX 3.0-fix-scons-warnings.patch 3784 RMD160 85066633038304cec3d64c42ca8c20c3aebb4a00 SHA1 426c8574442aece0aed7294118e0d90ca4b63bef SHA256 d026e79f7bdf4e8d12f690f38dd1fad3a6eeeabec7858d7f23bd4db0581c0262 +AUX 3.0-fix-valgrind.patch 442 RMD160 de52c31b1d61659a8b7ff1cbc1ea4533814f21cb SHA1 8d77340882f7e71b84cae04ae4d2c5c7e913641f SHA256 718f55aa0f52999eaef4a437dbe806a1a9e0c015904a04f17e292c2ca9c2987c +AUX 3.0-platform.patch 431 RMD160 2359b805d3d87f58eeff88864e1ebd0cba02d2ae SHA1 f9f5249cdd1da3ad261f8d4747366eb26aa3cbcc SHA256 3fc457b037ca2735978255240a43cacf35ebab2c61f29202d484ea035221901f +AUX 3.0-user-settings.patch 989 RMD160 fbdb678459c4663d181eb83b1ed4d58fcc507065 SHA1 e90cfd9b9055d8dc3b0e3029ff20ae05fd5fb601 SHA256 0b751e7a885faa0645de0d3450f6b3229c2959d5b42dc7dd77956199947b77df +AUX 3.0-zlib.patch 289 RMD160 dac6ffb48adff95d7ea5a8aa90ebe8be13087a6a SHA1 6336f6d23a924ce42943ea5959937ab397cb9365 SHA256 ee8cae00b2098b4e672fa46b60a35d381cc17d5ccbc6bbf38cdf966777ff1f03 +DIST rosetta3_source.tgz 98443598 RMD160 09c7bdaef58ef761bfdc8143c38f81f814be41a4 SHA1 3477856807a6fb4898c8c2aa7852b3b6e4fe90ee SHA256 1870727caea342c3b55af7c353b991758fe1cf4a395a65b48543708e52dc75c5 +EBUILD rosetta-3.0-r1.ebuild 3421 RMD160 d064ed1856baca5a6693574ac6e188e07b715a4d SHA1 f71700a6d06174b64d0d10208e98c3f0db4afc67 SHA256 28c7005b7cff4276cc3ed2055fbbb6f65f83139abb2e857827eaf99efedfe3a5 +EBUILD rosetta-3.0.ebuild 3171 RMD160 db7babe0444366a7d2c9bb946bfd23596971cd9c SHA1 e7ffd0664ab2da8b653dbba4c5eeb4af74a818cf SHA256 0d0328abe99edb5a89f7463b240c2f4fbffc88f9606de4acac629783b2b7d3c5 +MISC ChangeLog 655 RMD160 e1d43b2957924a0b5e3a346eb268072d9aaa9a87 SHA1 35896430dc84c433d54142b2d9d25298c97a3e3e SHA256 652ff3e717111dbbdf5ee564a2c2f3f3d5b5ac24ff509852e3107eb0a8c4d5c7 +MISC metadata.xml 450 RMD160 13d6fc607a68ab354ae5e01887aa96152c1838fd SHA1 857337c1113dfe1826ea2ba81694e416440a4e55 SHA256 979b679698fd4b06b80ce01558fba3759219e071787a56fd036ee8dfa51ee8ac diff --git a/sci-chemistry/rosetta/files/3.0-boinc.patch b/sci-chemistry/rosetta/files/3.0-boinc.patch new file mode 100644 index 000000000..1f6da965c --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-boinc.patch @@ -0,0 +1,53 @@ +--- src/protocols/boinc/boinc_shmem.hh 2009-02-03 22:47:07.000000000 +0100 ++++ src/protocols/boinc/boinc_shmem.hh.new 2009-04-09 14:59:15.000000000 +0200 +@@ -18,7 +18,7 @@ + #include <core/types.hh> + + #ifdef BOINC +-#include "boinc_api.h" ++#include "boinc/boinc_api.h" + #endif + + namespace protocols { +--- src/protocols/boinc/boinc.hh 2009-02-03 22:47:07.000000000 +0100 ++++ src/protocols/boinc/boinc.hh.new 2009-04-09 15:00:57.000000000 +0200 +@@ -20,11 +20,11 @@ + #include <boinc_win.h> + #include <str_util.h> + #endif +-#include <boinc_api.h> +-#include <diagnostics.h> +-#include <error_numbers.h> ++#include <boinc/boinc_api.h> ++#include <boinc/diagnostics.h> ++#include <boinc/error_numbers.h> + #ifdef BOINC_GRAPHICS +-#include <graphics2.h> +-#include <util.h> +-#include <shmem.h> ++#include <boinc/graphics2.h> ++#include <boinc/util.h> ++#include <boinc/shmem.h> + +--- src/utility/exit.cc 2009-02-03 22:47:28.000000000 +0100 ++++ src/utility/exit.cc.new 2009-04-09 16:23:18.000000000 +0200 +@@ -23,7 +23,7 @@ + // Boinc headers + #ifdef BOINC + #include <utility/io/izstream.hh> +-#include <boinc_api.h> ++#include <boinc/boinc_api.h> + #include <string> + #endif + +--- src/utility/boinc/boinc_util.cc 2009-02-03 22:47:30.000000000 +0100 ++++ src/utility/boinc/boinc_util.cc.new 2009-04-09 16:25:16.000000000 +0200 +@@ -20,7 +20,7 @@ + //#ifdef _WIN32 + //#include <boinc_win.h> + //#endif +-#include <boinc_api.h> ++#include <boinc/boinc_api.h> + + // C++ headers + #include <iostream> diff --git a/sci-chemistry/rosetta/files/3.0-fix-scons-warnings.patch b/sci-chemistry/rosetta/files/3.0-fix-scons-warnings.patch new file mode 100644 index 000000000..321d0a784 --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-fix-scons-warnings.patch @@ -0,0 +1,82 @@ +--- src/SConscript.src 2009-02-03 22:44:31.000000000 +0100 ++++ src/SConscript.src.new 2009-04-07 16:25:30.000000000 +0200 +@@ -85,7 +85,7 @@ + + # Transform the modified settings into SCons Environment variables. + # Gives priority to project settings over global settings. +-env = build.environment.Copy() ++env = build.environment.Clone() + env.Prepend(**actual.symbols()) + + +--- tools/build/setup.py 2009-02-03 22:44:32.000000000 +0100 ++++ tools/build/setup.py.new 2009-04-07 16:43:42.000000000 +0200 +@@ -42,21 +42,21 @@ + # Read in the options from the .settings files (1st pass) + # This has to be done in two passes, because some legal values + # (version numbers) are dependent on the other values +- options.AddOptions( ++ options.AddVariables( + # Options for the build. Modifiable on the command-line. +- EnumOption("cxx", "Select the C++ compiler to build with", ++ EnumVariable("cxx", "Select the C++ compiler to build with", + defaults.cxx, supported.cxx), +- EnumOption("os", "Select the operating system to build for", ++ EnumVariable("os", "Select the operating system to build for", + defaults.os, supported.os), +- EnumOption("arch", "Select the processor architecture to build for", ++ EnumVariable("arch", "Select the processor architecture to build for", + defaults.arch, supported.arch), +- EnumOption("mode", "Select the optimization mode", ++ EnumVariable("mode", "Select the optimization mode", + defaults.mode, supported.mode), +- ListOption("cat", "Select the build category", ++ ListVariable("cat", "Select the build category", + defaults.cat, supported.cat), +- ListOption("extras", "Select any extras", ++ ListVariable("extras", "Select any extras", + defaults.extras, supported.extras), +- ListOption("log", "Log debugging output", ++ ListVariable("log", "Log debugging output", + defaults.log, supported.log), + ) + +--- tools/build/setup.py 2009-04-07 16:44:26.000000000 +0200 ++++ tools/build/setup.py.new 2009-04-07 16:46:45.000000000 +0200 +@@ -37,7 +37,7 @@ + + # Incorporate options in site and user options + option_files = [ "%s.options" % (name) for name in ("site", "user") ] +- options = Options(option_files) ++ options = Variables(option_files) + + # Read in the options from the .settings files (1st pass) + # This has to be done in two passes, because some legal values +@@ -68,12 +68,12 @@ + cxx = env["cxx"] + os = env["os"] + arch = env["arch"] +- options.AddOptions( +- EnumOption("cxx_ver", "Select the C++ compiler version", ++ options.AddVariables( ++ EnumVariable("cxx_ver", "Select the C++ compiler version", + defaults.cxx_ver, supported.cxx[cxx]), +- EnumOption("os_ver", "Select the operating system version", ++ EnumVariable("os_ver", "Select the operating system version", + defaults.os_ver, supported.os[os]), +- EnumOption("arch_size", "Select the architecture bit-size", ++ EnumVariable("arch_size", "Select the architecture bit-size", + defaults.arch_size, supported.arch[arch]), + ) + +--- src/SConscript.apps 2009-02-03 22:44:31.000000000 +0100 ++++ src/SConscript.apps.new 2009-04-07 16:48:06.000000000 +0200 +@@ -92,7 +92,7 @@ + + # Transform the modified settings into SCons Environment variables. + # Gives priority to project settings over global settings. +-env = build.environment.Copy() ++env = build.environment.Clone() + env.Prepend(**actual.symbols()) + if "static" not in build.options.extras: + env["RPATH"] = build.toplevel + "/build/src/" + build.platform diff --git a/sci-chemistry/rosetta/files/3.0-fix-valgrind.patch b/sci-chemistry/rosetta/files/3.0-fix-valgrind.patch new file mode 100644 index 000000000..bc98773c1 --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-fix-valgrind.patch @@ -0,0 +1,11 @@ +--- tools/build/options.settings 2009-02-03 22:44:32.000000000 +0100 ++++ tools/build/options.settings.new 2009-04-07 18:12:00.000000000 +0200 +@@ -76,7 +76,7 @@ + # Build so that valgrind can follow the memory use. + # Valgrind normally works fine with most executables but not + # with static builds, which we are doing. +- "valgrind", ++ "shared", + + # Build using static linking. + "static", diff --git a/sci-chemistry/rosetta/files/3.0-platform.patch b/sci-chemistry/rosetta/files/3.0-platform.patch new file mode 100644 index 000000000..82f0ba63f --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-platform.patch @@ -0,0 +1,11 @@ +--- ./tools/build/setup_platforms.py 2009-02-03 22:44:32.000000000 +0100 ++++ ./tools/build/setup_platforms.py.new 2009-04-07 16:16:44.000000000 +0200 +@@ -274,7 +274,7 @@ + """ + # Note that these are very different values, and need processing + if globals().has_key("platform"): +- return platform.processor() or _uname()[4] ++ return platform.machine() or _uname()[4] + else: + return _uname()[4] + diff --git a/sci-chemistry/rosetta/files/3.0-user-settings.patch b/sci-chemistry/rosetta/files/3.0-user-settings.patch new file mode 100644 index 000000000..bb1201bd2 --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-user-settings.patch @@ -0,0 +1,26 @@ +--- tools/build/user.settings 2009-04-07 18:51:37.000000000 +0200 ++++ tools/build/user.settings.new 2009-04-07 18:51:37.000000000 +0200 +@@ -21,16 +21,22 @@ + settings = { + "user" : { + "prepends" : { ++ "program_path" : os.environ["PATH"].split(":"), ++ "include_path" : [ "/usr/include" ], ++ "library_path" : [ "/usr/GENTOO_LIBDIR" ], + }, + "appends" : { + # Uncomment the line below and the "import os" line above + # to let SCons find ICC (assuming it's on your PATH already) +- "program_path" : os.environ["PATH"].split(":"), + + # Uncomment the line below to begin building the "devel" project too. + #"projects": { "src" : [ "devel", ], }, + }, + "overrides" : { ++ "flags" : { ++ "compile" : [ GENTOO_CXXFLAGS ], ++ "link" : [ GENTOO_LDFLAGS ], ++ }, + }, + "removes" : { + }, diff --git a/sci-chemistry/rosetta/files/3.0-zlib.patch b/sci-chemistry/rosetta/files/3.0-zlib.patch new file mode 100644 index 000000000..18060add4 --- /dev/null +++ b/sci-chemistry/rosetta/files/3.0-zlib.patch @@ -0,0 +1,12 @@ +--- src/utility/io/zipstream.hpp 2009-02-03 22:47:27.000000000 +0100 ++++ src/utility/io/zipstream.hpp.new 2009-04-07 19:57:09.000000000 +0200 +@@ -36,8 +36,7 @@ + + + // Zlib headers +-#include <zlib/zlib.h> +-#include <zlib/zutil.h> ++#include <zlib.h> + + // C++ headers + #include <algorithm> diff --git a/sci-chemistry/rosetta/metadata.xml b/sci-chemistry/rosetta/metadata.xml new file mode 100644 index 000000000..fe282659e --- /dev/null +++ b/sci-chemistry/rosetta/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>sci</herd> +<maintainer> + <email>sci@gentoo.org</email> +</maintainer> +<use> + <flag name='boinc'>compile rosetta as a rosetta@home client</flag> + <flag name='boost'>compile rosetta with boost supported code</flag> +</use> +<upstream> + <bugs-to>general-support@mail.rosettacommons.org</bugs-to> +</upstream> +</pkgmetadata> + + diff --git a/sci-chemistry/rosetta/rosetta-3.0-r1.ebuild b/sci-chemistry/rosetta/rosetta-3.0-r1.ebuild new file mode 100644 index 000000000..fc740f4e7 --- /dev/null +++ b/sci-chemistry/rosetta/rosetta-3.0-r1.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# boinc support is BROKEN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +EAPI="2" + +inherit versionator eutils multilib + +MY_P="${PN}$(get_major_version)_source" + +DESCRIPTION="Prediction and design of protein structures, folding mechanisms, and protein-protein interactions" +HOMEPAGE="http://www.rosettacommons.org/" +SRC_URI="${MY_P}.tgz" + +LICENSE="|| ( rosetta-academic rosetta-commercial )" +SLOT="0" +KEYWORDS="-*" +IUSE="boinc boost X mpi debug doc" +RESTRICT="fetch" + +RDEPEND="mpi? ( virtual/mpi ) + boinc? ( sci-misc/boinc[X?] ) + boost? ( dev-libs/boost ) + sci-libs/rosetta-db" +DEPEND="${RDEPEND} + >=dev-util/scons-0.96.1 + doc? ( app-doc/doxygen ) + X? ( virtual/glut )" + +MYCONF="" + +S="${WORKDIR}/${MY_P}" + +pkg_nofetch() { + einfo "Go to ${HOMEPAGE} and get ${A}" + einfo "which must be placed in ${DISTDIR}" +} + +pkg_setup() { + use mpi && use boinc && \ + die "you can either use mpi or boinc support" +} + +src_prepare() { + local myCXXFLAGS + local myLDFLAGS + + epatch "${FILESDIR}"/${PV}-platform.patch + epatch "${FILESDIR}"/${PV}-fix-scons-warnings.patch + epatch "${FILESDIR}"/${PV}-user-settings.patch + epatch "${FILESDIR}"/${PV}-fix-valgrind.patch + epatch "${FILESDIR}"/${PV}-boinc.patch + rm bin/* -fv + + for i in ${CXXFLAGS}; do + myCXXFLAGS="${myCXXFLAGS} \"${i/-/}\"," + done + + for i in ${LDFLAGS}; do + myLDFLAGS="${myLDFLAGS} \"${i/-/}\"," + done + + sed -e "s:GENTOO_CXXFLAGS:${myCXXFLAGS}:g" \ + -e "s:GENTOO_LDFLAGS:${myCXXFLAGS} ${myLDFLAGS}:g" \ + -e "s:GENTOO_LIBDIR:$(get_libdir):g" \ + -i tools/build/user.settings + + use mpi && \ + sed -e 's:mpiCC:mpicxx:g' \ + -i tools/build/basic.settings +} + +src_configure() { + local myextras="" + local mymode="" + local mycxx="" + + use boinc && EXTRAS="boinc" + use boost && EXTRAS=$(my_list_append "${EXTRAS}" "boost") + use X && EXTRAS=$(my_list_append "${EXTRAS}" "graphics") + use mpi && EXTRAS=$(my_list_append "${EXTRAS}" "mpi") + + COMPILER=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)') + mycxx="cxx=${COMPILER}" + + test -n "${EXTRAS}" && myextras="extras=${EXTRAS}" + + if use debug; then + mymode="debug" + else + mymode="release" + fi + + MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "--load-average[=0-9.]*") + MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "-l[0-9.]*") + + MYCONF="${MAKEOPTS} mode=${mymode} ${myextras} ${mycxx}" +} + +src_compile() { + einfo "running 'scons bin cat=src ${MYCONF}' ..." + scons bin cat=src ${MYCONF} || die "scons bin cat=src ${MYCONF} failed" + + if use doc; then + einfo "running 'scons ${MYCONF} cat=doc' ..." + scons ${MYCONF} cat=doc || die "scons failed to build documentation" + fi +} + +src_install() { + local BIT + + use amd64 && BIT="64" + use x86 && BIT="32" + + dolib.so build/src/release/linux/2.6/${BIT}/x86/${COMPILER}/${EXTRAS//,/-}/*.so || \ + die "failed to install libs" + + if use doc; then + dohtml build/doc/rosetta++/docs/* || die "could not install docs" + fi + + cd bin + for BIN in *; do + newbin ${BIN} ${BIN%%.*} || die "could not install rosetta program files" + done + + mv "${D}"/usr/bin/cluster{,-${PN}} + mv "${D}"/usr/bin/benchmark{,-${PN}} +} + +my_filter_option() { + local value="$1" + local exp="$2" + local result=`echo ${value} | sed -e s/${exp}//g` + echo "${result}" + return 0; +} + +my_list_append() { + local old_value="$1" + local new_value="$2" + test -n "${old_value}" && old_value="${old_value}," + echo "${old_value}${new_value}" + return 0; +} + + diff --git a/sci-chemistry/rosetta/rosetta-3.0.ebuild b/sci-chemistry/rosetta/rosetta-3.0.ebuild new file mode 100644 index 000000000..0670f39f0 --- /dev/null +++ b/sci-chemistry/rosetta/rosetta-3.0.ebuild @@ -0,0 +1,140 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit versionator eutils multilib + +MY_P="${PN}$(get_major_version)_source" + +DESCRIPTION="Prediction and design of protein structures, folding mechanisms, and protein-protein interactions" +HOMEPAGE="http://www.rosettacommons.org/" +SRC_URI="${MY_P}.tgz" + +LICENSE="|| ( rosetta-academic rosetta-commercial )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="boost X mpi debug doc" +RESTRICT="fetch" + +RDEPEND="mpi? ( virtual/mpi ) + boost? ( dev-libs/boost ) + sci-libs/rosetta-db" +DEPEND="${RDEPEND} + >=dev-util/scons-0.96.1 + doc? ( app-doc/doxygen ) + X? ( virtual/glut )" + +MYCONF="" + +S="${WORKDIR}/${MY_P}" + +pkg_nofetch() { + einfo "Go to ${HOMEPAGE} and get ${A}" + einfo "which must be placed in ${DISTDIR}" +} + +src_prepare() { + local myCXXFLAGS + local myLDFLAGS + + epatch "${FILESDIR}"/${PV}-platform.patch + epatch "${FILESDIR}"/${PV}-fix-scons-warnings.patch + epatch "${FILESDIR}"/${PV}-user-settings.patch + epatch "${FILESDIR}"/${PV}-fix-valgrind.patch + rm bin/* -f + + for i in ${CXXFLAGS}; do + myCXXFLAGS="${myCXXFLAGS} \"${i/-/}\"," + done + + for i in ${LDFLAGS}; do + myLDFLAGS="${myLDFLAGS} \"${i/-/}\"," + done + + sed -e "s:GENTOO_CXXFLAGS:${myCXXFLAGS}:g" \ + -e "s:GENTOO_LDFLAGS:${myCXXFLAGS} ${myLDFLAGS}:g" \ + -e "s:GENTOO_LIBDIR:$(get_libdir):g" \ + -i tools/build/user.settings + + use mpi && \ + sed -e 's:mpiCC:mpicxx:g' \ + -i tools/build/basic.settings +} + +src_configure() { + local myextras="" + local mymode="" + local mycxx="" + + use boost && EXTRAS=$(my_list_append "${EXTRAS}" "boost") + use X && EXTRAS=$(my_list_append "${EXTRAS}" "graphics") + use mpi && EXTRAS=$(my_list_append "${EXTRAS}" "mpi") + + COMPILER=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)') + mycxx="cxx=${COMPILER}" + + test -n "${EXTRAS}" && myextras="extras=${EXTRAS}" + + if use debug; then + mymode="debug" + else + mymode="release" + fi + + MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "--load-average[=0-9.]*") + MAKEOPTS=$(my_filter_option "${MAKEOPTS}" "-l[0-9.]*") + + MYCONF="${MAKEOPTS} mode=${mymode} ${myextras} ${mycxx}" +} + +src_compile() { + einfo "running 'scons bin cat=src ${MYCONF}' ..." + scons bin cat=src ${MYCONF} || die "scons bin cat=src ${MYCONF} failed" + + if use doc; then + einfo "running 'scons ${MYCONF} cat=doc' ..." + scons ${MYCONF} cat=doc || die "scons failed to build documentation" + fi +} + +src_install() { + local BIT + + use amd64 && BIT="64" + use x86 && BIT="32" + + dolib.so build/src/release/linux/2.6/${BIT}/x86/${COMPILER}/${EXTRAS//,/-}/*.so || \ + die "failed to install libs" + + if use doc; then + dohtml build/doc/rosetta++/docs/* || die "could not install docs" + fi + + cd bin + for BIN in *; do + newbin ${BIN} ${BIN%%.*} || die "could not install rosetta program files" + done + + mv "${D}"/usr/bin/cluster{,-${PN}} + mv "${D}"/usr/bin/benchmark{,-${PN}} +} + +my_filter_option() { + local value="$1" + local exp="$2" + local result=`echo ${value} | sed -e s/${exp}//g` + echo "${result}" + return 0; +} + +my_list_append() { + local old_value="$1" + local new_value="$2" + test -n "${old_value}" && old_value="${old_value}," + echo "${old_value}${new_value}" + return 0; +} + + |