aboutsummaryrefslogtreecommitdiff
blob: a2432d7183f8fda154cff96a94cc952c35314454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit base multilib toolchain-funcs

DESCRIPTION="molecular replacement program"
HOMEPAGE="http://www.ysbl.york.ac.uk/~alexei/molrep.html"
SRC_URI="http://dev.gentooexperimental.org/~jlec/science-dist/${P}.tar.gz
	 test? ( http://dev.gentooexperimental.org/~jlec/distfiles/test-framework.tar.gz )"

LICENSE="ccp4"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test extra-test"

RDEPEND="
	>=sci-libs/ccp4-libs-6.1.1
	sci-libs/mmdb
	virtual/lapack"
DEPEND="${RDEPEND}"

S="${WORKDIR}/${PN}"

PATCHES=(
	"${FILESDIR}"/${PV}-respect-FLAGS.patch
	)

src_compile() {
	cd "${S}"/src
	emake clean || die
	emake \
		MR_FORT=$(tc-getFC) \
		FFLAGS="${FFLAGS}" \
		LDFLAGS="${LDFLAGS}" \
		MR_LIBRARY="-L/usr/$(get_libdir) -lccp4f -lccp4c -lmmdb -lccif -llapack -lstdc++ -lm" \
		|| die
}

src_test() {
	einfo "Starting tests ..."
	export PATH="${WORKDIR}/test-framework/scripts:${S}/bin:${PATH}"
	export CCP4_TEST="${WORKDIR}"/test-framework
	export CCP4_SCR="${T}"
	ccp4-run-thorough-tests -v test_molrep || die "nomal test failed"

	use extra-test && \
		cd "${S}"/molrep_check && \
			ewarn "Can take a long, long time ..." && \
			ewarn "Go, take a coffee, lunch, go to sleep and have breakfast ..." && \
				sed 's:\.\.:\.:g' -i em.bat && \
				mkdir out && \
				mkdir scr && \
				MR_TEST="${S}/bin" bash em.bat && \
				MR_TEST="${S}/bin" bash mr.bat || \
				die "extra-test failed"
}

src_install() {
	dobin bin/${PN} || die

	dodoc readme doc/${PN}.rtf || die
}