sci-libs/cantera: Fix site-packages install paths
[gentoo.git] / sci-libs / arprec / arprec-2.2.19.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 FORTRAN_NEEDED=fortran
7 FORTRAN_STANDARD=90
8
9 inherit autotools fortran-2
10
11 DESCRIPTION="Arbitrary precision float arithmetics and functions"
12 HOMEPAGE="https://crd-legacy.lbl.gov/~dhbailey/mpdist/"
13 SRC_URI="https://crd.lbl.gov/~dhbailey/mpdist/${P}.tar.gz"
14
15 SLOT="0"
16 LICENSE="BSD"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
18 IUSE="cpu_flags_x86_fma3 cpu_flags_x86_fma4 doc fortran qd static-libs"
19
20 DEPEND="qd? ( sci-libs/qd[fortran=] )"
21 RDEPEND="${DEPEND}"
22
23 PATCHES=(
24         "${FILESDIR}"/${P}-gold.patch
25 )
26
27 S="${WORKDIR}/${PN}"
28
29 src_prepare() {
30         default
31         eautoreconf
32 }
33
34 src_configure() {
35         econf \
36                 --enable-shared \
37                 $(use_enable static-libs static) \
38                 $(use_enable cpu_flags_x86_fma$(usex cpu_flags_x86_fma3 3 4) fma) \
39                 $(use_enable fortran) \
40                 $(use_enable qd)
41 }
42
43 src_compile() {
44         default
45
46         if use fortran; then
47                 emake toolkit
48                 cd toolkit || die
49                 ./mathinit || die "mathinit failed"
50         fi
51 }
52
53 src_install() {
54         default
55
56         if use fortran; then
57                 cd toolkit || die
58
59                 exeinto /usr/libexec/${PN}
60                 doexe mathtool
61
62                 exeinto /usr/libexec/${PN}/.libs
63                 doexe .libs/mathtool
64
65                 insinto /usr/libexec/${PN}
66                 doins *.dat
67
68                 cat > mathtool.exe <<- _EOF_ || die
69                         #!/usr/bin/env sh
70                         cd "${EPREFIX}/usr/libexec/${PN}" && exec ./mathtool
71                 _EOF_
72
73                 newbin mathtool.exe mathtool
74                 newdoc README README.mathtool
75         fi
76
77         if ! use doc; then
78                 rm "${ED%/}"/usr/share/doc/${PF}/*.pdf || die
79         fi
80
81         if ! use static-libs; then
82                 find "${D}" -name '*.la' -delete || die
83         fi
84 }