summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 70028783b8454433e6747bca44c4717e48e22e3b (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
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
_base=m2r2
pkgname=python-${_base}
pkgver=0.3.3.post2
pkgrel=1
pkgdesc="Markdown and reStructuredText in a single file"
arch=(any)
url="https://github.com/crossnox/${_base}"
license=(MIT)
depends=(python-mistune1 python-docutils)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest python-six python-sphinx)
changelog=CHANGES.md
source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz
  setuptools_compatibility.patch::${url}/pull/22.patch)
sha512sums=('066dcbd63fcf3b1ca2319e11fe3af59010b8937f9b4a17e451212b6c7a43488ef20d1f8944b49295cdddaed57c8a27fe08b0159f26a345ae457cd87af8526c21'
  '3686b8b8bf21f9e7c905e215766ded8aa66b14c7e20a4844ef21c926efabae0b56cc27e946ae626799c060c7d5323c9915198601a81d818a62ae57ce5be8cc95')

prepare() {
  cd ${_base}-${pkgver}
  # https://github.com/CrossNox/m2r2/issues/38
  patch -p1 -i ../setuptools_compatibility.patch
}

build() {
  cd ${_base}-${pkgver}
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd ${_base}-${pkgver}
  pytest -x --disable-warnings
}

package() {
  cd ${_base}-${pkgver}
  PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}