summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 52b620767a9c3abd00881cfe695eab0b2c57e4d2 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer:
# Contributor: Ke Liu <spcter119@gmail.com>

_module="efb-telegram-master"
_pkgname="python-$_module"
pkgname="$_pkgname-git"
pkgver=2.3.0.r2.g0850aeb
pkgrel=1
pkgdesc='EFB Telegram Master, a channel for EH Forwarder Bot'
url='https://github.com/blueset/efb-telegram-master'
license=('AGPL-3.0-or-later')
arch=('any')

depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  python -m build --wheel --no-isolation

  cd "build/lib/${_module//-/_}/locale/"
  for _locale in [a-z][a-z]*; do
    (cd "$_locale/LC_MESSAGES/"; msgfmt "${_module//-/_}.po" -o "${_module//-/_}.mo")
  done
}

package() {
  depends+=(
    'python-cjkwrap'
    'python-humanize'
    'python-magic'
    'python-peewee'
    'python-pillow'
    'python-python-socks'
    'python-retrying'
    'python-ruamel-yaml'
    'python-typing_extensions'

    # AUR
    'python-bullet'
    'python-ehforwarderbot'
    'python-ffmpeg-python'
    'python-language-tags'
    'python-lottie'
    'python-pydub'
    'python-telegram-bot'
  )

  cd "$_pkgsrc"
  python -m installer --destdir="$pkgdir" dist/*.whl
}