summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3823368149ee8e53ab60a83a9391669c4bdb8bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=('python-jaraco.packaging' 'python-jaraco.packaging-docs')
pkgbase=python-jaraco.packaging
_name=${pkgname#python-}
pkgver=9.4.0
pkgrel=1
pkgdesc="Tools to supplement packaging Python releases"
arch=('any')
url="https://github.com/jaraco/jaraco.packaging"
license=('MIT')
depends=(
  'python-build'
  'python-jaraco.context'
)
makedepends=(
  'python-domdf-python-tools'
  'python-installer'
  'python-rst.linker'
  'python-setuptools-scm'
  'python-sphinx-furo'
  'python-sphinx-lint'
  'python-wheel'
)
checkdepends=(
  'python-pip'
  'python-pytest'
)
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
sha256sums=('2690ca1c40ea9edfd3a2aa4887f573714f8a09a484ade0578a66d52778e557b6')

build() {
  cd "$_name-$pkgver"
  python -m build --wheel --no-isolation

  # generate html docs
  # this package requires itself to build docs :/
  PYTHONPATH=./ sphinx-build docs html

  # remove the sphinx-build leftovers
  rm -rf html/.{doctrees,buildinfo}
}

check() {
  cd "$_name-$pkgver"
  pytest
}

package_python-jaraco.packaging() {
  optdepends=('python-jaraco.packaging-docs: offline docs')

  cd "$_name-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}

package_python-jaraco.packaging-docs() {
  pkgdesc+=" (docs)"
  depends=()

  cd "$_name-$pkgver"
  install -d "$pkgdir/usr/share/doc/$pkgname"
  cp -r html/* "$pkgdir/usr/share/doc/$pkgname/"
}