summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b130c45cd183122e01e842872900b20261b0b849 (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
# Maintainer: vantu5z <vantu5z@mail.ru>

pkgname=python-libretranslate-git
pkgver=r31.20221015
pkgrel=1
pkgdesc="Python bindings for LibreTranslate"
url="https://github.com/argosopentech/LibreTranslate-py"
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
license=('MIT')
arch=('any')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=(${pkgname}::"git+https://github.com/argosopentech/LibreTranslate-py.git")
sha256sums=('SKIP')

pkgver() {
    cd $pkgname
    # get number of last git commit
    _commitCount=$(git rev-list --count HEAD)
    # get time of last git commit
    _commitTime=$(git show -s --format="%ci" | grep -o "....-..-.." | sed "s/-//g")
    # add "r*.*" from package version
    echo "r$_commitCount.$_commitTime"
}

build() {
    cd "${srcdir}/${pkgname}"
    python -m build --wheel --no-isolation
}

package() {
    cd "${srcdir}/${pkgname}"
    python -m installer --destdir="$pkgdir" dist/*.whl
}