summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fb250d6a23059b44cb2dca22cde5cfe82e3ed5aa (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="curlylint-git"
_pkgname=${pkgname%-git}
pkgver=0.13.1
pkgrel=2
pkgdesc="Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid"
arch=("any")
url="https://github.com/thibaudcolas/curlylint"
license=("MIT")
depends=("python-parsy-git" "python-attrs" "python-click" "python-toml" "python-pathspec")
makedepends=("git" "python-setuptools")
checkdepends=("python-pytest")
source=("${pkgname}::git+${url}#branch=main")
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
}

check() {
    pytest "${pkgname}"
}

package() {
    cd "${pkgname}"

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

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