1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs
8 DESCRIPTION="Computer-aided number theory C library and tools"
9 HOMEPAGE="https://pari.math.u-bordeaux.fr/"
10 SRC_URI="https://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz"
14 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
15 IUSE="data doc fltk gmp test threads X"
16 RESTRICT="!test? ( test )"
18 BDEPEND="doc? ( virtual/latex-base )"
21 data? ( sci-mathematics/pari-data )
22 doc? ( X? ( x11-misc/xdg-utils ) )
23 fltk? ( x11-libs/fltk:1= )
24 gmp? ( dev-libs/gmp:0= )
25 X? ( x11-libs/libX11:0= )"
29 "${FILESDIR}/${PN}"-2.9.4-strip.patch
30 "${FILESDIR}/${PN}"-2.9.4-ppc.patch
31 "${FILESDIR}/${PN}"-2.11.2-no-automagic.patch
32 "${FILESDIR}/${PN}"-2.9.4-fltk-detection.patch
33 "${FILESDIR}/${PN}"-2.11.2-Makefile-LDFLAGS.patch
34 "${FILESDIR}/${PN}"-2.11.2-Makefile-docinstall.patch
40 # move doc dir to a gentoo doc dir and replace acroread by xdg-open
42 -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \
43 -e 's:"acroread":"xdg-open":' \
44 doc/gphelp.in || die "Failed to fix doc dir"
50 # Workaraound to "asm operand has impossible constraints" as
51 # suggested in bug #499996.
52 use x86 && append-cflags $(test-flags-CC -fno-stack-check)
54 # need to force optimization here, as it breaks without
57 elif ! is-flag -O?; then
61 # sysdatadir installs a pari.cfg stuff which is informative only.
62 # It is supposed to be for "architecture-dependent" data.
63 # It needs to be easily discoverable for downstream packages such as gp2c.
65 --prefix="${EPREFIX}"/usr \
66 --datadir="${EPREFIX}/usr/share/${PN}" \
67 --libdir="${EPREFIX}/usr/$(get_libdir)" \
68 --sysdatadir="${EPREFIX}"/usr/share/pari \
69 --mandir="${EPREFIX}"/usr/share/man/man1 \
70 --with-readline="${EPREFIX}"/usr \
71 --with-readline-lib="${EPREFIX}/usr/$(get_libdir)" \
72 --with-ncurses-lib="${EPREFIX}/usr/$(get_libdir)" \
76 $(usex threads "--mt=pthread" "" "" "") \
77 || die "./Configure failed"
83 mymake=DLLD\="${EPREFIX}"/usr/bin/gcc\ DLLDFLAGS\=-shared\ -Wl,-soname=\$\(LIBPARI_SONAME\)\ -lm
88 # To prevent sandbox violations by metafont
89 VARTEXFONTS="${T}/fonts" emake docpdf
94 # Welcome to the jungle, where the tests fail if you make your
96 emake COLUMNS=80 test-all
103 docompress -x "/usr/share/doc/${PF}"
106 EXDIR="${ED}/usr/share/doc/${PF}/examples" \
107 DOCDIR="${ED}/usr/share/doc/${PF}" \