summaryrefslogtreecommitdiff
path: root/python-fabio/PKGBUILD
blob: 80857eee92215ca9f62ee574ece83465d6527702 (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
# 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-fabio
pkgname=(python2-fabio python-fabio)
_pkgname=fabio
pkgver=0.7.0
pkgrel=1
pkgdesc="I/O library for images produced by 2D X-ray detectors."
arch=('i686' 'x86_64')
url="http://www.silx.org"
license=('MIT' 'LGPL' 'Apache')
_depends=(
  'python-numpy'
  'python-setuptools')
_makedepends=(
  'cython')
_optdepends=('python-pyqt4: for the fabio_viewer program')
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/silx-kit/${_pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('1ef84eb628f950d933db35335d2656c3385e07ede9bb833052661b8b6a5d39889889c9e58ddd3a5ccc3d3d0e7989c2b57942270142b6acca87d67ce7008a6fb4')

makedepends=(
  "${_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}/py-${_pkgname}-${pkgver}"
  python setup.py build

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

package_python2-fabio() {
  depends=(
    "${_depends[@]//python/python2}"
  )
  optdepends=(
    "${_optdepends[@]//python/python2}"
  )
  cd "${srcdir}/py2-${_pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}/" --optimize=1
  install -D copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  for suffix in '-convert' '_viewer'; do
    mv "${pkgdir}/usr/bin/fabio${suffix}" "${pkgdir}/usr/bin/fabio2${suffix}"
    sed -i '1 s/python/python2/' "${pkgdir}/usr/bin/fabio2${suffix}"
  done
}

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