aboutsummaryrefslogtreecommitdiff
blob: 216ef3a61fdeadebc833893f721a55005e07e7a0 (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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit autotools-utils eutils fortran-2 multilib toolchain-funcs

DESCRIPTION="PAW atomic data generator"
HOMEPAGE="http://www.wfu.edu/~natalie/papers/pwpaw/man.html"
SRC_URI="
	http://www.wfu.edu/~natalie/papers/pwpaw/${P}.tar.gz
	doc? (
		http://www.wfu.edu/~natalie/papers/pwpaw/atompaw.pdf
		http://www.wfu.edu/~natalie/papers/pwpaw/notes/atompaw/atompawEqns.pdf )"

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

RDEPEND="
	virtual/blas
	virtual/lapack
	libxc? ( >=sci-libs/libxc-2.0.1[fortran] )"
DEPEND="${RDEPEND}
	virtual/pkgconfig"

DOCS=( README )

FORTRAN_STANDARD=90

src_unpack() {
	unpack ${P}.tar.gz
	if use doc; then
		cp "${DISTDIR}"/atompaw.pdf "${DISTDIR}"/atompawEqns.pdf "${S}"/doc/ || die
	fi
}

src_prepare() {
	use longplot && epatch "${FILESDIR}"/4.0-longplot.patch
}

src_configure() {
	local myeconfargs=(
		$(use_enable libxc)
		--with-linalg-flavor=atlas
		--with-linalg-libs="$($(tc-getPKG_CONFIG) --libs lapack)"
		--with-libxc-incs="-I/usr/include $($(tc-getPKG_CONFIG) --cflags libxc)"
		--with-libxc-libs="$($(tc-getPKG_CONFIG) --libs libxc)"
		FC="$(tc-getFC)" FCFLAGS="${FCFLAGS:- ${FFLAGS:- -O2}}"
		CC="$(tc-getCC)" LDFLAGS="${LDFLAGS:- ${CFLAGS:- -O2}}"
	)
	autotools-utils_src_configure
}

src_compile() {
	autotools-utils_src_compile -j1
}

src_test() {
	use test && autotools-utils_src_test
}

src_install() {
	autotools-utils_src_install

	use doc && dodoc doc/atompaw.pdf doc/atompawEqns.pdf
}