summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 358ae68475bb1fa2a1d2fe149f8a30fc5c267ecb (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
# Maintainer: Sam L. Yes <samlukeyes123 at gmail dot com>
# Contributor: Mufeed Ali <fushinari@protonmail.com>

pkgname=python-googletrans-git
_author=ssut
_gitname=py-googletrans
pkgver=r116.d15c94f
pkgrel=1
pkgdesc="Free Google Translate API for Python. Git version."
arch=('any')
license=('MIT')
url="https://github.com/ssut/py-googletrans"
depends=(
  python-httpx
  python-h2
)
makedepends=(
  python-setuptools
  git
)
provides=('python-googletrans')
conflicts=('python-googletrans')
source=("git+https://github.com/$_author/$_gitname.git")
sha512sums=('SKIP')

prepare() {
  cd ${srcdir}/$_gitname
  sed -i 's|httpx==|httpx>=|' setup.py
}

pkgver() {
  cd "$_gitname"
  printf 'r%s.%s' \
      "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$_gitname"
  python setup.py build
}

package() {
  cd "$_gitname"
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}