1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_6,3_7} )
8 inherit distutils-r1 eutils virtualx
10 DESCRIPTION="Computer Algebra System in pure Python"
11 HOMEPAGE="https://sympy.org"
12 SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
17 IUSE="doc examples gtk imaging ipython latex mathml opengl pdf png pyglet symengine test texmacs theano"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}
20 doc? ( || ( $(python_gen_useflags 'python2*') ) )
21 ipython? ( || ( $(python_gen_useflags -3) ) )"
24 # All tests actually pass, except a bunch of tests related to the deprecated pygletplot
25 # It is a non-trivial work to wipe out all such tests :-(
27 RDEPEND="dev-python/mpmath[${PYTHON_USEDEP}]
28 dev-python/pexpect[${PYTHON_USEDEP}]
29 imaging? ( dev-python/pillow[${PYTHON_USEDEP}] )
30 ipython? ( $(python_gen_cond_dep 'dev-python/ipython[${PYTHON_USEDEP}]' -3) )
33 dev-texlive/texlive-fontsextra
34 png? ( app-text/dvipng )
35 pdf? ( app-text/ghostscript-gpl )
38 dev-libs/libxml2:2[${PYTHON_USEDEP}]
39 $(python_gen_cond_dep 'dev-libs/libxslt[${PYTHON_USEDEP}]' python2_7)
40 gtk? ( x11-libs/gtkmathview[gtk] )
42 opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] )
43 pyglet? ( dev-python/pyglet[${PYTHON_USEDEP}] )
44 symengine? ( dev-python/symengine[${PYTHON_USEDEP}] )
45 texmacs? ( app-office/texmacs )
46 theano? ( dev-python/theano[${PYTHON_USEDEP}] )
50 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] app-text/docbook2X )
51 test? ( ${RDEPEND} dev-python/pytest[${PYTHON_USEDEP}] )"
54 use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
57 python_compile_all() {
59 export XDG_CONFIG_HOME="${T}/config-dir"
60 mkdir "${XDG_CONFIG_HOME}" || die
61 chmod 0700 "${XDG_CONFIG_HOME}" || die
62 emake -j1 -C doc html info man cheatsheet
67 virtx "${PYTHON}" setup.py test
70 python_install_all() {
71 local DOCS=( AUTHORS README.rst )
73 DOCS+=( doc/_build/cheatsheet/cheatsheet.pdf \
74 doc/_build/cheatsheet/combinatoric_cheatsheet.pdf )
75 local HTML_DOCS=( doc/_build/html/. )
76 doinfo doc/_build/texinfo/${PN}.info
80 docompress -x /usr/share/doc/${PF}/examples
82 distutils-r1_python_install_all
85 exeinto /usr/libexec/TeXmacs/bin/
86 doexe data/TeXmacs/bin/tm_sympy
87 insinto /usr/share/TeXmacs/plugins/sympy/
88 doins -r data/TeXmacs/progs