summaryrefslogtreecommitdiff
path: root/community/python-pillow/PKGBUILD
blob: 6ef3cd700d4b1976422e59cee4e68df9a4ee2807 (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
# $Id: PKGBUILD 98021 2013-10-04 01:35:36Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: minder

pkgbase=python-pillow
pkgname=(python-pillow python2-pillow)
_appname=Pillow
pkgver=2.2.1
pkgrel=1
pkgdesc="Python Imaging Library (PIL) fork. Python3 version."
arch=('i686' 'x86_64')
url="http://python-imaging.github.io/"
license=('BSD')
makedepends=('python-setuptools' 'python2-setuptools' 'lcms' 'libwebp' 'tk' 'sane')
source=("http://pypi.python.org/packages/source/P/$_appname/$_appname-$pkgver.zip")
md5sums=('d1d20d3db5d1ab312da0951ff061e6bf')

build() {
  cd "$srcdir"
  cp -r "$srcdir/$_appname-$pkgver" "$srcdir/${_appname}2-$pkgver"
}  

package_python-pillow() {
  depends=('python' 'lcms' 'libwebp')
  optdepends=('tk: for the ImageTK module'
              'sane: for the Sane module'
              'python-pyqt4: for the ImageQt module')
  cd "$srcdir/$_appname-$pkgver"
  python3 setup.py install --root="$pkgdir/" --optimize=0
  pushd Sane
    python3 setup.py install --root="$pkgdir/" --optimize=0
  popd
  install -Dm644 docs/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # clean up bins
  cd "$pkgdir/usr/bin"
  for f in *.py; do
    mv "$f" "${f%.py}"
  done
}

package_python2-pillow() {
  pkgdesc="Python Imaging Library (PIL) fork. Python2 version."
  depends=('python2' 'lcms' 'libwebp')
  optdepends=('tk: for the ImageTK module'
              'sane: for the Sane module'
              'python2-pyqt4: for the ImageQt module')
  provides=('python-imaging' 'python2-imaging')
  conflicts=('python-imaging' 'python2-imaging')
  replaces=('python2-imaging')
  cd "$srcdir/${_appname}2-$pkgver"
  python2 setup.py install --root="$pkgdir/" --optimize=0
  pushd Sane
    python2 setup.py install --root="$pkgdir/" --optimize=0
  popd
  install -Dm644 docs/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # clean up bins
  cd "$pkgdir/usr/bin"
  for f in *.py; do
    mv "$f" "${f%.py}2"
  done
}