sci-mathematics/gmp-ecm: new EAPI=7 revision.
[gentoo.git] / sci-mathematics / form / form-4.2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit autotools toolchain-funcs
7
8 DESCRIPTION="Symbolic Manipulation System"
9 HOMEPAGE="https://www.nikhef.nl/~form/"
10 SRC_URI="https://github.com/vermaseren/${PN}/releases/download/v${PV}/${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="devref doc doxygen gmp mpi threads zlib"
16
17 RDEPEND="
18         gmp? ( dev-libs/gmp:0= )
19         mpi? ( virtual/mpi )
20         zlib? ( sys-libs/zlib )"
21 DEPEND="${RDEPEND}
22         devref? ( dev-texlive/texlive-latex )
23         doc? ( dev-texlive/texlive-latex )
24         doxygen? ( app-doc/doxygen )"
25
26 src_prepare() {
27         sed -i 's/LINKFLAGS = -s/LINKFLAGS =/' sources/Makefile.am || die
28         eautoreconf
29 }
30
31 src_configure() {
32         econf \
33                 --enable-scalar \
34                 --enable-largefile \
35                 --disable-debug \
36                 --disable-static-link \
37                 --with-api=posix \
38                 $(use_with gmp ) \
39                 $(use_enable mpi parform ) \
40                 $(use_enable threads threaded ) \
41                 $(use_with zlib ) \
42                 CC="$(tc-getCC)" \
43                 CXX="$(tc-getCXX)" \
44                 CFLAGS="${CFLAGS}" \
45                 LDFLAGS="${LDFLAGS}" \
46                 CXXFLAGS="${CXXFLAGS}"
47 }
48
49 src_compile() {
50         default
51         if use devref; then
52                 pushd doc/devref > /dev/null || die "doc/devref does not exist"
53                 LANG=C emake pdf
54                 popd > /dev/null
55         fi
56         if use doc; then
57                 pushd doc/manual > /dev/null || die "doc/manual does not exist"
58                 LANG=C emake pdf
59                 popd > /dev/null
60         fi
61         if use doxygen; then
62                 pushd doc/doxygen > /dev/null || die "doc/doxygen does not exist"
63                 emake html
64                 popd > /dev/null
65         fi
66 }
67
68 src_install() {
69         default
70         if use devref; then
71                 insinto /usr/share/doc/${PF}
72                 doins doc/devref/devref.pdf
73         fi
74         if use doc; then
75                 insinto /usr/share/doc/${PF}
76                 doins doc/manual/manual.pdf
77         fi
78         if use doxygen; then
79                 dohtml -r doc/doxygen/html/*
80         fi
81 }