# Template file for 'python-sympy'
pkgname=python-sympy
version=1.3
revision=1
noarch=yes
wrksrc="sympy-${version}"
build_style=python-module
pycompile_module="sympy isympy.py"
hostmakedepends="python-setuptools python3-setuptools"
depends="python-setuptools python-mpmath"
short_desc="Computer algebra system for Python2"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://sympy.org/"
license="BSD-3-Clause"
distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
checksum=e1319b556207a3758a0efebae14e5e52c648fc1db8975953b05fff12b6871b54

alternatives="
 sympy:isympy:/usr/bin/isympy2
 sympy:isympy.1:/usr/share/man/man1/isympy2.1"

post_install() {
	# create versioned man pages
	mv ${DESTDIR}/usr/share/man/man1/isympy{,2}.1
	vman doc/man/isympy.1 isympy3.1
	vlicense LICENSE
}

python3-sympy_package() {
	alternatives="
	 sympy:isympy:/usr/bin/isympy3
	 sympy:isympy.1:/usr/share/man/man1/isympy3.1"
	noarch=yes
	pycompile_module="sympy isympy.py"
	depends="python3-setuptools python3-mpmath"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/bin/isympy3
		vmove usr/lib/python3*
		vmove usr/share/man/man1/isympy3.1
		vlicense LICENSE
	}
}
