summaryrefslogtreecommitdiff
blob: 112b2f24b6d8451a9a17eb17ca58ade613b6de77 (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
66
67
68
69
70
71
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/psi/psi-3.4.0-r1.ebuild,v 1.2 2011/06/21 09:11:41 jlec Exp $

EAPI="3"

inherit autotools fortran-2 eutils

DESCRIPTION="Suite of ab initio quantum chemistry programs to compute various molecular properties"
HOMEPAGE="http://www.psicode.org/"
SRC_URI="mirror://sourceforge/psicode/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"

# File collision, see bug #249423
RDEPEND="
	!sci-visualization/extrema
	virtual/blas
	virtual/lapack
	>=sci-libs/libint-1.1.4"
DEPEND="${RDEPEND}
	test? ( dev-lang/perl )"

S="${WORKDIR}/${PN}${PV:0:1}"

src_prepare() {
	epatch "${FILESDIR}"/${PV}-dont-build-libint.patch \
		"${FILESDIR}"/use-external-libint.patch \
		"${FILESDIR}"/${PV}-gcc-4.3.patch \
		"${FILESDIR}"/${PV}-destdir.patch \
		"${FILESDIR}"/${P}-parallel-make.patch \
		"${FILESDIR}"/${PV}-man_paths.patch \
		"${FILESDIR}"/${PV}-ldflags.patch \
		"${FILESDIR}"/${PV}-parallel_fix.patch

	# Broken test
	sed \
		-e 's:scf-mvd-opt ::g' \
		-e 's:scf-mvd-opt-puream ::g' \
		-i tests/Makefile.in || die

	sed \
		-e "/LIBPATTERNS/d" \
		-i src/{bin,util,samples}/MakeVars.in || die
	eautoreconf
}

src_configure() {
	# This variable gets set sometimes to /usr/lib/src and breaks stuff
	unset CLIBS

	econf \
		--with-opt="${CXXFLAGS}" \
		--datadir="${EPREFIX}"/usr/share/${PN} \
		--with-blas="$(pkg-config blas --libs)"
}

src_compile() {
	emake SCRATCH="${WORKDIR}/libint" DODEPEND="no" || die
}

src_test() {
	emake EXECDIR="${S}"/bin TESTFLAGS="" -j1 tests || die
}

src_install() {
	emake DESTDIR="${D}" DODEPEND="no" install || die
}