app-shells/bash-completion: add 2.16.0
[gentoo/gentoo.git] / sci-mathematics / form / form-4.3.1.ebuild
blob8ff6283ac8b3c6b65aeb0387fcce0ae8806720f6
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit autotools flag-o-matic toolchain-funcs elisp-common
8 DESCRIPTION="Symbolic Manipulation System"
9 HOMEPAGE="https://www.nikhef.nl/~form/ https://github.com/vermaseren/form/"
10 SRC_URI="https://github.com/vermaseren/${PN}/releases/download/v${PV}/${P}.tar.gz
11         emacs? ( https://dev.gentoo.org/~grozin/form-mode.el.gz )"
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="devref doc doxygen emacs gmp mpi threads zlib"
18 RDEPEND="
19         gmp? ( dev-libs/gmp:0= )
20         mpi? ( virtual/mpi )
21         zlib? ( sys-libs/zlib )"
22 DEPEND="${RDEPEND}
23         devref? ( dev-texlive/texlive-latexrecommended )
24         doc? ( dev-texlive/texlive-latexrecommended )
25         doxygen? ( app-text/doxygen )
26         emacs? ( app-editors/emacs:* )"
28 SITEFILE="64${PN}-gentoo.el"
30 src_prepare() {
31         default
32         sed -i 's/LINKFLAGS = -s/LINKFLAGS =/' sources/Makefile.am || die
33         eautoreconf
36 src_configure() {
37         # Workaround for GCC -fchecking ICE, bug #904339
38         append-cxxflags $(test-flags-CXX -Wno-uninitialized)
40         econf \
41                 --enable-scalar \
42                 --enable-largefile \
43                 --disable-debug \
44                 --disable-static-link \
45                 --with-api=posix \
46                 $(use_with gmp ) \
47                 $(use_enable mpi parform ) \
48                 $(use_enable threads threaded ) \
49                 $(use_with zlib ) \
50                 CC="$(tc-getCC)" \
51                 CXX="$(tc-getCXX)" \
52                 CFLAGS="${CFLAGS}" \
53                 LDFLAGS="${LDFLAGS}" \
54                 CXXFLAGS="${CXXFLAGS}"
57 src_compile() {
58         default
59         if use devref; then
60                 pushd doc/devref > /dev/null || die "doc/devref does not exist"
61                 LANG=C VARTEXFONTS="${T}/fonts" emake pdf
62                 popd > /dev/null
63         fi
64         if use doc; then
65                 pushd doc/manual > /dev/null || die "doc/manual does not exist"
66                 LANG=C VARTEXFONTS="${T}/fonts" emake pdf
67                 popd > /dev/null
68         fi
69         if use doxygen; then
70                 pushd doc/doxygen > /dev/null || die "doc/doxygen does not exist"
71                 emake html
72                 popd > /dev/null
73         fi
76 src_install() {
77         default
78         if use devref; then
79                 dodoc doc/devref/devref.pdf
80         fi
81         if use doc; then
82                 dodoc doc/manual/manual.pdf
83         fi
84         if use doxygen; then
85                 docinto html
86                 dodoc -r doc/doxygen/html/.
87         fi
88         if use emacs; then
89                 elisp-install ${PN} "${WORKDIR}"/*.el
90                 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
91         fi
94 pkg_postinst() {
95         use emacs && elisp-site-regen
98 pkg_postrm() {
99         use emacs && elisp-site-regen