From 7783c6e1a62d076519c6685374e7a3f7d588b4da Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Fri, 23 Mar 2018 18:32:31 +0000
Subject: python-pillow: update to 5.0.0

---
 abs/core/python_modules/python-pillow/PKGBUILD    | 110 ++++++++++++----------
 abs/core/python_modules/python-pillow/__changelog |   2 -
 2 files changed, 59 insertions(+), 53 deletions(-)
 delete mode 100644 abs/core/python_modules/python-pillow/__changelog

diff --git a/abs/core/python_modules/python-pillow/PKGBUILD b/abs/core/python_modules/python-pillow/PKGBUILD
index 461c4a7..ad443c6 100644
--- a/abs/core/python_modules/python-pillow/PKGBUILD
+++ b/abs/core/python_modules/python-pillow/PKGBUILD
@@ -3,72 +3,80 @@
 # Contributor: minder
 
 pkgbase=python-pillow
-pkgname=(python2-pillow)
-pkgver=2.6.1
+pkgname=(python-pillow python2-pillow)
+pkgver=5.0.0
 pkgrel=1
 _appname=Pillow
 _py2basever=2.7
-_py3basever=3.4m
+_py3basever=3.6m
 pkgdesc="Python Imaging Library (PIL) fork. Python3 version."
-arch=('i686' 'x86_64')
-url="http://python-pillow.github.io/"
+arch=('x86_64')
+url="https://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')
+depends=('lcms2' 'libtiff' 'openjpeg2')
+optdepends=('freetype2: for the ImageFont module'
+            'libraqm: for complex text scripts'
+            'libwebp: for webp images'
+            'tk: for the ImageTK module')
+makedepends=('python-setuptools' 'python2-setuptools' 'freetype2' 'libraqm' 'libwebp' 'tk')
+checkdepends=('python-pytest' 'python2-pytest')
+source=("https://files.pythonhosted.org/packages/source/P/$_appname/$_appname-$pkgver.tar.gz"
+        "freetype-2.9-testfailure.patch::https://github.com/python-pillow/Pillow/commit/4afed260dc8a2b926a8dccfeed45b085d67425ca.patch")
+md5sums=('08094bc48aae6877c94f8db4b8ee8e52'
+         '04e168f81a434e76dab09456ad7930f9')
+
+# future optional things:
+# libimagequant
+
+prepare() {
+  cd "$srcdir/${_appname}-$pkgver"
+  patch -p1 < ../freetype-2.9-testfailure.patch
+}
 
 build() {
-  cd "$srcdir"
-  cp -r "$srcdir/$_appname-$pkgver" "$srcdir/${_appname}2-$pkgver"
-}  
+  cd "$srcdir/${_appname}-$pkgver"
+  python setup.py build
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir/${_appname}-$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"
+  export PYTHONPATH="$PWD/build/lib.linux-$CARCH-${_py3basever%m}"
+  python selftest.py
+  pytest
+  export PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_py2basever"
+  python2 selftest.py
+  pytest2
+}
 
-#  install -dm755 "$pkgdir/usr/include/python$_py3basever/"
-#  install -m644 -t "$pkgdir/usr/include/python$_py3basever/" libImaging/*.h
+package_python-pillow() {
+  depends+=('python')
+  optdepends+=('python-olefile: OLE2 file support'
+               'python-pyqt4: for the ImageQt module'
+               'python-pyqt5: for the ImageQt module'
+               'python-pyside: for the ImageQt module')
+  cd "$srcdir/$_appname-$pkgver"
+  python3 setup.py install --root="$pkgdir/" --optimize=1
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 
-#  # clean up bins
-#  cd "$pkgdir/usr/bin"
-#  for f in *.py; do
-#    mv "$f" "${f%.py}"
-#  done
-#}
+  install -dm755 "$pkgdir/usr/include/python$_py3basever/"
+  install -m644 -t "$pkgdir/usr/include/python$_py3basever/" src/libImaging/*.h
+}
 
 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')
+  depends+=('python2')
+  optdepends+=('python2-olefile: OLE2 file support'
+               'python2-pyqt5: for the ImageQt module'
+               'python2-pyqt4: for the ImageQt module'
+               'python2-pyside: 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"
+  cd "$srcdir/${_appname}-$pkgver"
+  python2 setup.py install --root="$pkgdir/" --optimize=1
+  install -Dm644 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
+  install -m644 -t "$pkgdir/usr/include/python$_py2basever/" src/libImaging/*.h
 }
-
diff --git a/abs/core/python_modules/python-pillow/__changelog b/abs/core/python_modules/python-pillow/__changelog
deleted file mode 100644
index 8e7b951..0000000
--- a/abs/core/python_modules/python-pillow/__changelog
+++ /dev/null
@@ -1,2 +0,0 @@
-PKGBUILD - comment out all python 3 stuff and only build for py 2
-PKGBUILD - rm sane dep
-- 
cgit v0.12