summaryrefslogtreecommitdiff
path: root/community/python-pillow/PKGBUILD
blob: 9f270403659070971e1342a8d049840a60867267 (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
# $Id: PKGBUILD 98694 2013-10-17 06:08:29Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: minder

pkgbase=python-pillow
pkgname=(python-pillow python2-pillow)
pkgver=2.2.1
pkgrel=2
_appname=Pillow
_py2basever=2.7
_py3basever=3.3m
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"

  install -dm755 "$pkgdir/usr/include/python$_py3basever/"
  install -m644 -t "$pkgdir/usr/include/python$_py3basever/" libImaging/*.h

  # 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"

  install -dm755 "$pkgdir/usr/include/python$_py2basever/"
  install -m644 -t "$pkgdir/usr/include/python$_py2basever/" libImaging/*.h

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