git » python-sphinx.git » main » tree

[main] / PKGBUILD

# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: SĂ©bastien Luttringer
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Fabio Volpe <volpefabio@gmail.com>

pkgname=python-sphinx
_name=${pkgname#python-}
pkgver=7.3.7
pkgrel=2
pkgdesc='Python documentation generator'
arch=('any')
url=http://www.sphinx-doc.org/
license=('BSD-2-Clause')
depends=(
  'python-babel'
  'python-docutils'
  'python-imagesize'
  #'python-jinja'
  'python-packaging'
  'python-pygments'
  'python-requests'
  'python-snowballstemmer'
  'python-sphinx-alabaster-theme'
  'python-sphinxcontrib-'{{apple,dev,html}help,jsmath,qthelp,serializinghtml}
)
makedepends=('git' 'python-build' 'python-flit-core' 'python-installer')
#checkdepends=(
#  'cython'
#  'imagemagick' 'librsvg'
#  'python-defusedxml'
#  'python-pytest'
#  'python-setuptools'
#  'texlive-'{fontsextra,fontsrecommended,latexextra,luatex,xetex}
#)
optdepends=(
  'imagemagick: for ext.imgconverter'
  'texlive-latexextra: for generation of PDF documentation'
)
source=("git+https://github.com/$_name-doc/$_name.git#tag=v$pkgver")
b2sums=('7a891990ff6b21599ac398ed5d2979ead6fa9884e06d9ea3f6ee0bd7ea3fe5729af502b26b71f2fea610299e2679bf9c8ee68a16137037e8b89c76da7dc156c1')

prepare() {
  cd "$_name"
  # Lazy import defusedxml only when necessary
  git cherry-pick -n ce86026f3b667949ef39f7fdab9a40941d99c5ca
}

build() {
  cd "$_name"
  python -m build --wheel --skip-dependency-check --no-isolation

  mkdir -p tempinstall
  bsdtar -xf dist/*.whl -C tempinstall
  PYTHONPATH="$PWD/tempinstall" make -C doc man
}

#check() {
#  cd "$_name"
#  LC_ALL="en_US.UTF-8" python -X dev -X warn_default_encoding -m pytest -vx
#}

package() {
  cd "$_name"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dt "$pkgdir"/usr/share/man/man1 doc/_build/man/"$_name"-*.1

  # Symlink license file
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  install -d "$pkgdir"/usr/share/licenses/$pkgname
  ln -s "$site_packages"/"$_name"-$pkgver.dist-info/LICENSE.rst \
    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.rst
}

# vim:set ts=2 sw=2 et: