summaryrefslogtreecommitdiff
path: root/python-scikit-image/PKGBUILD
blob: b22e90f575e183d85083de6b8cab8857e7e203e7 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>

pkgbase=python-scikit-image
pkgname=('python2-scikit-image' 'python-scikit-image')
pkgver=0.13.1
pkgrel=1
pkgdesc="Image processing routines for SciPy"
arch=('i686' 'x86_64')
url="http://scikit-image.org/"
license=('BSD')
_depends=('python-scipy' 'python-matplotlib' 'python-networkx'
          'python-pillow' 'python-pywavelets')
makedepends=('cython2' 'cython' 'python2-six' 'python-six' "${_depends[@]}" "${_depends[@]/python-/python2-}")
options=('!emptydirs')
source=(https://pypi.python.org/packages/83/2a/c5a39c12c196c19a443fa4d17c0768a24231e46ae952930a9d66bad45557/scikit-image-${pkgver}.tar.gz)
sha512sums=('fba2700743486e1c556c697ec307ed972b8a70d7829a6fab3360f91542322a250d2f0fd32c5ec442409f5ebbec01b0550bfce037d8bb0667ff2286731b7a6263')

prepare() {
  cd "${srcdir}"
  cp -a scikit-image-$pkgver scikit-image-py2-$pkgver
  cd scikit-image-py2-$pkgver

  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() {
  msg "Building Python2"
  cd "${srcdir}"/scikit-image-py2-$pkgver
  python2 setup.py build

  msg "Building Python3"
  cd "${srcdir}"/scikit-image-$pkgver
  python setup.py build
}

package_python2-scikit-image() {
  depends=("${_depends[@]/python-/python2-}")
  optdepends=('python2-pyqt4: for imshow(x, fancy=True) and skivi'
              'freeimage: for reading various types of image file formats')
  cd "${srcdir}"/scikit-image-py2-$pkgver

  python2 setup.py install --root="${pkgdir}"/ --optimize=1
  mv "${pkgdir}"/usr/bin/skivi "${pkgdir}"/usr/bin/skivi2
  install -D LICENSE.txt "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
}

package_python-scikit-image() {
  depends=("${_depends[@]}")
  optdepends=('python-pyqt4: for imshow(x, fancy=True) and skivi'
              'freeimage: for reading various types of image file formats'
              'python-pyamg: fast cg_mg mode of random walker segmentation')
  cd "${srcdir}"/scikit-image-$pkgver

  python setup.py install --root="${pkgdir}"/ --optimize=1
  install -D LICENSE.txt "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
}