summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 272976aa0ebd3f1260a5171b6519b6bc2b90f1c8 (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
# Maintainer: zer0-x < Matrix: "@zer0-x:kde.org" >

pkgname="python-parsy-git"
_pkgname=${pkgname%-git}
pkgver=2.1
pkgrel=1
pkgdesc="Easy and elegant parser combinators for Python. With awesome docs"
arch=('any')
url="https://github.com/python-parsy/parsy"
license=('MIT')
depends=("python")
makedepends=('python-setuptools')
# checkdepends=("python-pytest")
source=("${pkgname}::git+${url}#branch=master")
sha512sums=('SKIP')

_get_tag() {
    git tag --list | grep '^v' --color=never | tail -n1
}

prepare() {
    cd "${pkgname}"

    git reset --hard "$(_get_tag)"
}

pkgver() {
    cd "${pkgname}"
    _get_tag | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${pkgname}"

    python3 setup.py build
}

# https://github.com/python-parsy/parsy/pull/73
# check() {
#     pytest "${pkgname}"
# }

package() {
    cd "${pkgname}"

    python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build

    install -Dm644 "README.rst" "${pkgdir}/usr/share/doc/${_pkgname}/README.rst"
    install -Dm755 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE-MIT"
}