desktop/python-pillow/PKGBUILD

79 lines
2.6 KiB
Bash
Raw Normal View History

2014-08-28 03:05:56 +08:00
pkgbase=python-pillow
pkgname=(python3-pillow python2-pillow)
2016-11-12 21:54:52 +08:00
pkgver=3.4.2
2014-08-28 03:05:56 +08:00
pkgrel=1
# consider splitting out sane if this gets weird enough
_sanever=2.8.2
2014-08-28 03:05:56 +08:00
_appname=Pillow
_py2basever=2.7
_py3basever=3.5m
2014-08-28 03:05:56 +08:00
pkgdesc="Python Imaging Library (PIL) fork. Python3 version."
arch=('x86_64')
url="http://python-pillow.github.io/"
license=('BSD')
2016-11-12 21:54:52 +08:00
makedepends=('python3-setuptools' 'python3' 'python2-setuptools' 'python2' 'lcms' 'libwebp' 'tk' 'sane')
source=("https://files.pythonhosted.org/packages/source/P/$_appname/$_appname-$pkgver.tar.gz"
"Sane-$_sanever.tar.gz::https://github.com/python-pillow/Sane/archive/v$_sanever.tar.gz")
2016-11-12 21:54:52 +08:00
md5sums=('09ebb92ec5cbba13ff1acf139caf6b66'
'295f1c745ab4da6a34b524019b181978')
2014-08-28 03:05:56 +08:00
2015-03-14 03:46:13 +08:00
prepare() {
cd "$srcdir"
# allow sane to build
sed -i "s|os.path.join|'../libImaging', &|" "$srcdir/Sane-$_sanever/setup.py"
cp -r "$srcdir/Sane-$_sanever" "$srcdir/$_appname-$pkgver/Sane"
2015-03-14 03:46:13 +08:00
# py2 and py3
cp -r "$srcdir/$_appname-$pkgver" "$srcdir/${_appname}2-$pkgver"
2014-08-28 03:05:56 +08:00
}
package_python3-pillow() {
depends=('python3' 'lcms' 'libwebp')
optdepends=('tk: for the ImageTK module'
'sane: for the Sane module'
'python-pyqt4: for the ImageQt module')
cd ${_appname}-${pkgver}
python3 setup.py install --root="${pkgdir}/" --optimize=0
pushd Sane
python3 setup.py install --root="${pkgdir}/" --optimize=0
popd
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
2014-08-28 03:05:56 +08:00
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 ${_appname}2-${pkgver}
2015-03-14 03:46:13 +08:00
sed -i 's|/usr/local/bin/python$|/usr/bin/env python2|' PIL/OleFileIO.py
2014-08-28 03:05:56 +08:00
python2 setup.py install --root="${pkgdir}/" --optimize=0
pushd Sane
python2 setup.py install --root="${pkgdir}/" --optimize=0
popd
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
2014-08-28 03:05:56 +08:00
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
}