summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-pillow/PKGBUILD
blob: 461c4a7d813c50446877e6ef75db6e232de2c888 (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
# $Id$
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: minder

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

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"
  sed -i 's|/usr/local/bin/python$|/usr/bin/env python2|' PIL/OleFileIO.py
  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
}