contrib/python-pillow/Pkgfile
2017-11-04 19:13:19 +11:00

39 lines
1.1 KiB
Plaintext

# Description: Python Imaging Library (PIL) fork.
# URL: http://python-pillow.github.io/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: lcms2 libwebp python-setuptools
# Optional: sane
name=python-pillow
version=4.3.0
_saneversion=2.8.3
release=1
source=(https://github.com/python-pillow/Pillow/archive/$version/Pillow-$version.tar.gz
https://github.com/python-pillow/Sane/archive/v$_saneversion/Sane-v$_saneversion.tar.gz)
build() {
# allow sane to build
sed -i -e "s|os.path.join|'../libImaging', &|" "$SRC/Sane-$_saneversion/setup.py"
cp -r "$SRC/Sane-$_saneversion" "$SRC/Pillow-$version/Sane"
cd Pillow-$version
/usr/bin/python setup.py build
/usr/bin/python setup.py install --root=$PKG --optimize=0
if pkg-config --exists sane-backends; then
cd Sane
/usr/bin/python setup.py build
/usr/bin/python setup.py install --root=$PKG --optimize=0
cd -
install -d -m 0755 "$PKG/usr/include/python2.7/"
install -m 0644 -t "$PKG/usr/include/python2.7/" libImaging/*.h
fi
# clean up bins
cd $PKG/usr/bin
for f in *.py; do
mv "$f" "${f%.py}"
done
}