summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12a900de00ef04f5d0a2ea65053874e7dfce2f87 (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
# 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')

prepare() {
    cd "${pkgname}"

    git reset --hard "$(git describe --tags --abbrev=0 --match 'v*')"
}

pkgver() {
    cd "${pkgname}"
    git describe --tags --abbrev=0 --match 'v*' | 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"
}