summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2beb334431f3411203aad7c5378f50505d5411f6 (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: Klaus Alexander Seistrup <klaus@seistrup.dk>
# -*- sh -*-

pkgname='python-calcpy-git'
_pkgname="${pkgname/-git/}"
_srcname="${_pkgname/python-/}"
pkgver=0.1.r242.gd57a728
pkgrel=2
pkgdesc='Terminal calculator and advanced math solver using Python, IPython and SymPy (built from latest commit)'
arch=('any')
url="https://github.com/idanpa/$_srcname"
license=('MIT')  # SPDX-License-Identifier: MIT
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
)
depends=(
  'ipython'
  'python'
  'python-antlr4'
  'python-dateparser'
  'python-matplotlib'
  'python-numpy'
  'python-pickleshare'
  'python-prompt_toolkit'
  'python-pyperclip'
  'python-requests'
  'python-sympy'
  'python-traitlets'
  'python-tzlocal'
)
source=("git+$url.git")
provides=("$_srcname" "$_pkgname" 'python-previewer')
conflicts=("$_srcname" "$_pkgname" 'python-previewer')
sha256sums=('SKIP')

prepare() {
  cd "$_srcname"

  sed -i 's/antlr4-python3-runtime==4.11/antlr4-python3-runtime==4.13/g' setup.py
}

pkgver() {
  cd "$_srcname"

  # There are no tags yet,
  # so let's use number of revisions since beginning of history
  printf '0.1.r%s.g%s' \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short=7 HEAD)"
}

build() {
  cd "$_srcname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_srcname"

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

  install -Dm0644 LICENSE   "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm0644 README.md "$pkgdir/usr/share/$pkgname/doc/README.md"
}

# eof