dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-mathematics / gfan / gfan-0.6.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic toolchain-funcs
7
8 DESCRIPTION="Compute Groebner fans and tropical varieties"
9 HOMEPAGE="https://users-math.au.dk/~jensen/software/gfan/gfan.html"
10 SRC_URI="https://users-math.au.dk/~jensen/software/${PN}/${PN}${PV}.tar.gz"
11
12 LICENSE="GPL-2+"
13 SLOT="0"
14 KEYWORDS="amd64 ~arm x86 ~amd64-linux ~x86-linux"
15 IUSE="doc"
16
17 BDEPEND="doc? ( virtual/latex-base )"
18 DEPEND="dev-libs/gmp:0=[cxx]
19         sci-libs/cddlib:0="
20 RDEPEND="${DEPEND}"
21
22 S="${WORKDIR}/${PN}${PV}"
23
24 PATCHES=(
25         "${FILESDIR}/${PN}-0.6.2-xcode9.3_compat.patch"
26         "${FILESDIR}/${PN}-0.6.2-testsuite.patch"
27         "${FILESDIR}/${PN}-0.6.2-Makefile.patch"
28         )
29
30 pkg_setup() {
31         tc-export CC CXX
32
33         # This should really go in cppflags, but that doesn't work with
34         # gfan's hand-written Makefile.
35         append-cxxflags -DNOCDDPREFIX
36 }
37
38 src_prepare() {
39         default
40
41         # This test hangs on x86, bug 717112.
42         rm -r testsuite/0602ResultantFanProjection || \
43                 die "unable to disable test 0602ResultantFanProjection"
44 }
45
46 src_configure() {
47         # The upstream Makefile says that GCC produces bad code with -O3.
48         replace-flags "-O3" "-O2"
49         default
50 }
51
52 src_compile() {
53         default
54         if use doc; then
55                 pushd doc > /dev/null || die
56                 # The LaTeX build commands need to be repeated until the
57                 # document "stops changing," which is not as easy as it
58                 # sounds to detect. Running it twice seems to work here.
59                 pdflatex manual.tex && bibtex manual && pdflatex manual.tex || die
60                 popd > /dev/null || die
61         fi
62 }
63
64 src_install() {
65         emake PREFIX="${ED}/usr" install
66         use doc && dodoc doc/manual.pdf
67 }