summaryrefslogtreecommitdiff
path: root/python-pywavelets/PKGBUILD
blob: 8b263c7497f2c1e893ddbdc0f928d3b156b15961 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Francois Boulogne <fboulogne at april dot org>
# Contributor: Jingbei Li <i@jingbei.li>
pkgbase=python-pywavelets
pkgname=(python-pywavelets python2-pywavelets)
_pkgname=pywt
pkgver=1.0.2
pkgrel='2'
pkgdesc="Discrete Wavelet Transforms in Python"
arch=('x86_64' 'i686')
url="https://github.com/PyWavelets/pywt"
license=('MIT')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'cython'
  'python-matplotlib'
  'python-nose'
  'python-numpy'
  'python-wheel')
_makedepends=(
  'cython>=0.20.2'
  'python-setuptools')
source=("$_pkgname-$pkgver.tar.gz::https://github.com/PyWavelets/pywt/archive/v$pkgver.tar.gz")
sha512sums=('3bdd25350442ee2200ff14c1aaad4ab7f5cf7388a9234b7026eb992a134b29932ed49a93a712091f08e6a05e5009e15a7f240bcf167f53f6e0357fa7d819954a')

makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_makedepends[@]}"
  "${_makedepends[@]/ython/ython2}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
)

prepare() {
  cd "$srcdir/"
  cp -a "${_pkgname}-${pkgver}" "${_pkgname}-${pkgver}-py2"
  cd "${_pkgname}-${pkgver}-py2"
  sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
    -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
    -i $(find . -name '*.py')
}

build() {
  echo "Building Python 2"
  cd "$srcdir/${_pkgname}-${pkgver}-py2"
  python2 setup.py build

  echo "Building Python 3"
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py build
}

package_python2-pywavelets(){
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python/python2}"
  )
  cd "$srcdir/$_pkgname-$pkgver-py2"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python-pywavelets(){
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
  cd "$srcdir/$_pkgname-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

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