desktop/python-pillow/PKGBUILD

71 lines
2.3 KiB
Bash
Raw Normal View History

2014-08-28 03:05:56 +08:00
pkgbase=python-pillow
pkgname=(python3-pillow python2-pillow)
pkgver=2.5.3
pkgrel=1
_appname=Pillow
_py2basever=2.7
_py3basever=3.4m
pkgdesc="Python Imaging Library (PIL) fork. Python3 version."
arch=('x86_64')
url="http://python-pillow.github.io/"
license=('BSD')
makedepends=('python3-setuptools' 'python2-setuptools' 'lcms' 'libwebp' 'tk' 'sane')
source=("http://pypi.python.org/packages/source/P/${_appname}/${_appname}-${pkgver}.zip")
sha256sums=('62ff6c6cb88d4a1d6e856315b1691186b06cb923f18fde86d6abac9eeb9096d1')
build() {
cp -r ${_appname}-${pkgver} ${_appname}2-${pkgver}
}
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 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 ${_appname}2-${pkgver}
python2 setup.py install --root="${pkgdir}/" --optimize=0
pushd Sane
python2 setup.py install --root="${pkgdir}/" --optimize=0
popd
sed -i 's|/usr/local/bin/python$|/usr/bin/env python2|' \
"${pkgdir}/usr/lib/python${_py2basever}/site-packages/PIL/OleFileIO.py"
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
}