sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / sci-chemistry / psi / psi-3.4.0-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit autotools-utils fortran-2 multilib toolchain-funcs
7
8 DESCRIPTION="Suite for ab initio quantum chemistry computing various molecular properties"
9 HOMEPAGE="http://www.psicode.org/"
10 SRC_URI="mirror://sourceforge/psicode/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="static-libs test"
16 RESTRICT="!test? ( test )"
17
18 RDEPEND="
19         !sci-visualization/extrema
20         virtual/blas
21         virtual/lapack
22         >=sci-libs/libint-1.1.4:1"
23 DEPEND="${RDEPEND}
24         virtual/pkgconfig
25         dev-util/byacc
26         test? ( dev-lang/perl )"
27
28 S="${WORKDIR}/${PN}${PV:0:1}"
29
30 PATCHES=(
31         "${FILESDIR}"/${PV}-dont-build-libint.patch
32         "${FILESDIR}"/use-external-libint.patch
33         "${FILESDIR}"/${PV}-gcc-4.3.patch
34         "${FILESDIR}"/${PV}-destdir.patch
35         "${FILESDIR}"/${P}-parallel-make.patch
36         "${FILESDIR}"/${PV}-man_paths.patch
37         "${FILESDIR}"/${PV}-ldflags.patch
38         "${FILESDIR}"/${PV}-parallel_fix.patch
39         "${FILESDIR}"/${PV}-fortify.patch
40         "${FILESDIR}"/${P}-format-security.patch
41         )
42
43 src_prepare() {
44         autotools-utils_src_prepare
45         # Broken test
46         sed \
47                 -e 's:scf-mvd-opt ::g' \
48                 -e 's:scf-mvd-opt-puream ::g' \
49                 -i tests/Makefile.in || die
50
51         sed \
52                 -e "/LIBPATTERNS/d" \
53                 -i src/{bin,util,samples}/MakeVars.in || die
54         eautoreconf
55 }
56
57 src_configure() {
58         # This variable gets set sometimes to /usr/lib/src and breaks stuff
59         unset CLIBS
60
61         local myeconfargs=(
62                 --with-opt="${CXXFLAGS}"
63                 --datadir="${EPREFIX}"/usr/share/${PN}
64                 --with-blas="$($(tc-getPKG_CONFIG) blas --libs)"
65                 --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
66                 )
67         autotools-utils_src_configure
68 }
69
70 src_compile() {
71         autotools-utils_src_compile \
72                 SCRATCH="${WORKDIR}/libint" \
73                 DODEPEND="no" \
74                 YACC=byacc
75 }
76
77 src_test() {
78         emake EXECDIR="${S}"/bin TESTFLAGS="" -j1 tests
79 }
80
81 src_install() {
82         autotools-utils_src_install DODEPEND="no"
83         if ! use static-libs; then
84                 rm -f "${ED}"/usr/$(get_libdir)/*.a || die
85         fi
86 }