summaryrefslogtreecommitdiff
path: root/python-pyfai/PKGBUILD
blob: c7be89d92f67a0183618448eb76573ba29946661 (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
88
89
90
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Leonid B <leonid dot bloch at esrf dot fr>
# Upstream contact: silx at esrf dot fr
pkgbase=python-pyfai
pkgname=(python2-pyfai python-pyfai)
_pkgname=pyFAI
pkgver=0.17.0
pkgrel=1
pkgdesc="Fast Azimuthal Integration in Python."
arch=('i686' 'x86_64')
url="http://www.silx.org"
license=('GPLv3' 'BSD' 'MIT')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'cython'
  'python-fabio'
  'python-h5py'
  'python-matplotlib'
  'python-numexpr'
  'python-numpy'
  'python-scipy'
  'python-silx')
_makedepends=(
  'cython'
  'python-setuptools')
_optdepends=()
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/silx-kit/${_pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('2ab4ef0a76b1d635d80783aad6f51512e650c17e666906d1a4f49289093a6edb7d0d3a5a97cbbedf4a9ec0790987df68ab03d580e1e2033b61d97e30042f46d4')

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

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

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

  cd "${srcdir}/py-${_pkgname}-${pkgver}"
  python setup.py build
}

package_python2-pyfai() {
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]//python/python2}"
  )
  optdepends=(
    "${_optdepends[@]//python/python2}"
  )
  cd "${srcdir}/py2-${_pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}/" --optimize=1
  install -D LICENSES.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D copyright "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT"
  find "${pkgdir}/usr/bin" -maxdepth 1 -type f -printf '%f\n' | \
    while read -r f; do
      mv "${pkgdir}/usr/bin/${f}" "${pkgdir}/usr/bin/python2-${f}"
      sed -i '1 s/python/python2/' "${pkgdir}/usr/bin/python2-${f}"
    done
}

package_python-pyfai() {
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
  optdepends=(
    "${_optdepends[@]}"
  )
  cd "${srcdir}/py-${_pkgname}-${pkgver}"
  python setup.py install --root="${pkgdir}/" --optimize=1
  install -D LICENSES.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D copyright "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT"
}