# 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 sane examples" LICENSE="HPND" SLOT="0" RDEPEND=">=media-libs/jpeg-6a >=media-libs/freetype-2.4.9 >=media-libs/lcms-1.1.5 sane? ( media-gfx/sane-backends ) media-libs/libwebp" DEPEND="${RDEPEND} app-arch/unzip dev-python/setuptools[${PYTHON_USEDEP}]" 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} # if [[ "${EPYTHON} == 'python3.2' ]]; then; # ln -sf $(find build/dir/ -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; then insinto use/share/doc/${P}/demo doins Sane/demo*.py fi distutils-r1_python_install }