summaryrefslogtreecommitdiff
path: root/python-scikit-image/PKGBUILD
blob: 2a62d634a7fe12cdb60a87e57739127b3c4f527e (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
91
92
93
94
95
96
# 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="${pkgbase#*-}"
pkgname=('python2-scikit-image' 'python-scikit-image')
pkgver=0.14.2
pkgrel='3'
pkgdesc="Image processing routines for SciPy"
arch=('i686' 'x86_64')
url="http://scikit-image.org/"
license=('BSD')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'python-scipy'
  'python-matplotlib'
  'python-networkx'
  'python-pillow'
  'python-pywavelets'
)
_makedepends=(
  'cython>=0.23')
_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'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}"
  "${_depends[@]/python-/python2-}"
  "${_makedepends[@]}"
  "${_makedepends[@]/ython/ython2}"
)
options=('!emptydirs')
source=(https://pypi.python.org/packages/7f/bd/74ed9add17c3c7529c18693c17846753649c6cf2e674e7482fbf85d636cb/scikit-image-${pkgver}.tar.gz)
sha512sums=('ab31fdb5b1d16b794ccc4d673f6c8bce0a8a54b81c0e43c9a4cdd5eb0465ef69ac184a06e395a1d27da51c2e0911db9afa2be4e740f44bceab952428eb7f599a')

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

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

package_python2-scikit-image() {
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python-/python2-}"
  )
  optdepends=(
    "${_optdepends[@]/python-/python2-}"
  )
  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=(
    "${_deppy2[@]}"
    "${_depends[@]}"
  )
  optdepends=(
    "${_optdepends[@]}"
  )
  cd "${srcdir}"/scikit-image-$pkgver

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