# Maintainer: Astro Benzene pkgbase=python-sphinx-gallery _pyname=${pkgbase#python-} pkgname=("python-${_pyname}" "python2-${_pyname}") #"python-${_pyname}-doc") pkgver=0.4.0 pkgrel=1 pkgdesc="Sphinx extension to automatically generate an examples gallery" arch=('i686' 'x86_64') url="http://sphinx-gallery.readthedocs.io/" license=('BSD') makedepends=('python-setuptools' 'python2-setuptools') #'python-sphinx' 'python-pillow' 'python-scipy' 'python-seaborn') checkdepends=('python-pytest-cov' 'python2-pytest-cov' 'python-matplotlib' 'python2-matplotlib' 'python-pillow' 'python2-pillow' 'python-sphinx' 'python2-sphinx') source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz") md5sums=('1f3e578107ca253a184889733a4fbcea') prepare() { cp -a ${srcdir}/${_pyname}-${pkgver}{,-py2} } build() { msg "Building Python2" cd ${srcdir}/${_pyname}-${pkgver}-py2 python2 setup.py build msg "Building Python3" cd ${srcdir}/${_pyname}-${pkgver} python setup.py build # msg "Building Docs" # python setup.py build_sphinx } check() { cd ${srcdir}/${_pyname}-${pkgver} msg "Checking Python3" python setup.py test msg "Checking Python2" cd ${srcdir}/${_pyname}-${pkgver}-py2 python2 setup.py test } package_python2-sphinx-gallery() { depends=('python2-sphinx' 'python2-matplotlib' 'python2-pillow') optdepends=('python2-seaborn' 'mayavi') # 'python-sphinx-gallery-doc: Documentation of Sphinx-Gallery') cd ${srcdir}/${_pyname}-${pkgver}-py2 install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" install -D -m644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}" python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1 mv ${pkgdir}/usr/bin/copy_sphinxgallery{,2}.sh mv ${pkgdir}/usr/bin/sphx_glr_python_to_jupyter{,2}.py } package_python-sphinx-gallery() { depends=('python-sphinx' 'python-matplotlib' 'python-pillow') optdepends=('python-seaborn' 'mayavi-py3') # 'python-sphinx-gallery-doc: Documentation of Sphinx-Gallery') cd ${srcdir}/${_pyname}-${pkgver} install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" install -D -m644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}" python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1 } #package_python-sphinx-gallery-doc() { # pkgdesc="Documentation for Sphinx-Gallery extension" # cd ${srcdir}/${_pyname}-${pkgver}/doc/_build # # install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}" # cp -a html "${pkgdir}/usr/share/doc/${pkgbase}" #}