summaryrefslogtreecommitdiff
path: root/python-lmfit/PKGBUILD
blob: a16a8b7648f99abc6075952bb4d5cfab3a1be6b9 (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
81
82
83
84
85
86
87
# Contributor: Francois Boulogne <fboulogne at april dot org>
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgbase=python-lmfit
_pkgname=lmfit-py
pkgname=('python-lmfit' 'python2-lmfit')
pkgver=0.9.12
pkgrel=1
pkgdesc="Least-Squares Minimization with Constraints for Python"
arch=('any')
url="http://lmfit.github.io/lmfit-py/"
license=('BSD')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'python-asteval>=0.9.12'
  'python-numpy>=1.10'
  'python-scipy>=0.17'
  'python-six>1.10'
  'python-uncertainties>=3.0'
)
_makedepends=(
  'python-setuptools'
)
_checkdepends=(
  'python-nose'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
  "${_makedepends[@]}"
  "${_makedepends[@]/python/python2}"
)
checkdepends=(
  "${_checkdepends[@]}"
  "${_checkdepends[@]/python/python2}"
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/lmfit/lmfit-py/archive/${pkgver}.tar.gz")
sha512sums=('f3b08888f96f7db5c9a14b2555c35d739b0a73e04da8496252c5e4f23757839d103e90c3e926ca0b5cfbf09a97b84d83abfa4bf71bbd1ac2d7cd6a32f41fd724')

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

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

check() {
  cd "$srcdir/lmfit-py-$pkgver"
  nosetests3 tests || echo 'WARNING: python3 tests failed'

  cd "$srcdir/lmfit-py2-$pkgver"
  nosetests2 tests || echo 'WARNING: python2 tests failed'
}

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

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

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