summaryrefslogtreecommitdiff
path: root/python-asteval/PKGBUILD
blob: d6001146f4b37c1c5a556a2e86c791b96c8fdc2f (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
71
72
73
74
75
76
77
78
79
80
# Contributor: Francois Boulogne <fboulogne at april dot org>
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgbase=python-asteval
pkgname=('python-asteval' 'python2-asteval')
_pkgname="${pkgbase#*-}"
pkgver=0.9.14
pkgrel=1
pkgdesc='Minimal Python AST Evaluator'
arch=('any')
url='https://newville.github.io/asteval/'
license=('MIT')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'python-numpy>=1.6'
  'python-six')
_makedepends=(
  'python-setuptools')
_checkdepends=(
  'python-nose'
  'python-pytest')
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}" "${_depends[@]/python/python2}"
  "${_makedepends[@]}" "${_makedepends[@]/python/python2}"
  )
checkdepends=(
  "${_checkdepends[@]}" "${_checkdepends[@]/python/python2}"
  )
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/newville/${_pkgname}/archive/${pkgver}.tar.gz")
sha512sums=('8033646da18511f44a4d7803b939c328225f8fe5fe52a23a3a7946c36c250117dc1440affaaebe81d814f6cd9e9d55a91d3a78426bc04fc7577a8e50ec7acf0c')

prepare() {
  mv "${_pkgname}-${pkgver}" "${_pkgname}-py-${pkgver}"
  cp -a "${_pkgname}-py-${pkgver}" "${_pkgname}-py2-${pkgver}"
}

build() {
  cd "$srcdir/${_pkgname}-py-$pkgver"
  python setup.py build
  
  cd "$srcdir/${_pkgname}-py2-$pkgver"
  python2 setup.py build
}

check() {
  cd "$srcdir/${_pkgname}-py-$pkgver"
  nosetests3 tests

  cd "$srcdir/${_pkgname}-py2-$pkgver"
  nosetests2 tests
}

package_python-asteval(){
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
  cd "$srcdir/${_pkgname}-py-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1
}

package_python2-asteval(){
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python/python2}"
  )
  cd "$srcdir/${_pkgname}-py2-$pkgver"
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

# vim:ts=2:sw=2:et: