# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 PYTHON_COMPAT=( python{2_6,2_7,3_2} ) inherit distutils-r1 MY_PN="${PN/p/P}" DESCRIPTION="The friendly Python Imaging Library fork by Alex Clark and Contributors" HOMEPAGE="http://github.com/python-imaging/Pillow" SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.zip -> ${P}.zip" KEYWORDS="~amd64 ~x86" IUSE="doc ext examples lcms sane tiff tk webp" # ? Need to enter new PIL license LICENSE="HPND" SLOT="0" RDEPEND="virtual/jpeg media-libs/freetype:2 sys-libs/zlib lcms? ( media-libs/lcms:0 ) tiff? ( media-libs/tiff ) sane? ( media-gfx/sane-backends ) tk? ( dev-lang/tk dev-tcltk/tcllib ) webp? ( media-libs/libwebp )" DEPEND="${RDEPEND} app-arch/unzip dev-python/setuptools[${PYTHON_USEDEP}] doc? ( dev-python/sphinx )" S=${WORKDIR}/${MY_PN}-${PV} DISTUTILS_IN_SOURCE_BUILD=1 python_compile() { if use ext; then "${PYTHON}" setup.py build_ext -i fi if use sane; then pushd Sane > /dev/null PYTHONPATH=. "${PYTHON}" setup.py build popd > /dev/null fi "${PYTHON}" setup.py build } python_test() { einfo "Running tests under "${EPYTHON} # py3 wants the .so modules in . if [[ "${EPYTHON}" == python3* ]]; then ln -sf $(find . -name "*.so") . || die fi PYTHONPATH=. "${PYTHON}" selftest.py || die "selftest.py failed under ${EPYTHON}" "${PYTHON}" Tests/run.py || die "run.py failed under ${EPYTHON}" } python_install() { use doc && dohtml -r Docs/ if use sane; then # this ought mb be $(python_get_sitedir)/ insinto $(python_get_sitedir)/PIL/ doins $(find Sane -name _sane*so) doins Sane/sane.py chmod +x "${D}"$(python_get_sitedir)/PIL/_sane*so || die fi if use examples && use scanner; then docinto examples/sane doins Sane/demo_*.py fi distutils-r1_python_install }