summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-04-21 20:33:22 +0000
committerMichał Górny <mgorny@gentoo.org>2013-04-21 20:33:22 +0000
commitc9d9e9c501bb0f67cf307b3db6f544ee08dc802f (patch)
treeff85ba6ddf1423f701de7b6fae4de7dad201e50c /dev-python
parentIntroduce an initial ebuild for Pillow, a fork of Python Imaging Library. Req... (diff)
downloadgentoo-2-c9d9e9c501bb0f67cf307b3db6f544ee08dc802f.tar.gz
gentoo-2-c9d9e9c501bb0f67cf307b3db6f544ee08dc802f.tar.bz2
gentoo-2-c9d9e9c501bb0f67cf307b3db6f544ee08dc802f.zip
Backport the ebuild improvements from dev-python/pillow. Remove unnecessary inherits. Add a fine-grained control over features, and a simpler feature switch mechanism. Remove unused USE=X, add shebangs to all Python scripts. Use the new python_doinclude function and EXAMPLES support.
(Portage version: 2.2.0_alpha173/cvs/Linux x86_64, signed Manifest commit with key 9627F456F9DA7643!)
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/imaging/ChangeLog10
-rw-r--r--dev-python/imaging/imaging-1.1.7-r3.ebuild101
2 files changed, 110 insertions, 1 deletions
diff --git a/dev-python/imaging/ChangeLog b/dev-python/imaging/ChangeLog
index d5096f687ecb..d3a1dec9a3f6 100644
--- a/dev-python/imaging/ChangeLog
+++ b/dev-python/imaging/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-python/imaging
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/imaging/ChangeLog,v 1.81 2013/02/24 12:15:03 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/imaging/ChangeLog,v 1.82 2013/04/21 20:33:22 mgorny Exp $
+
+*imaging-1.1.7-r3 (21 Apr 2013)
+
+ 21 Apr 2013; Michał Górny <mgorny@gentoo.org> +imaging-1.1.7-r3.ebuild:
+ Backport the ebuild improvements from dev-python/pillow. Remove unnecessary
+ inherits. Add a fine-grained control over features, and a simpler feature
+ switch mechanism. Remove unused USE=X, add shebangs to all Python scripts. Use
+ the new python_doinclude function and EXAMPLES support.
24 Feb 2013; Agostino Sarubbo <ago@gentoo.org> imaging-1.1.7-r2.ebuild:
Stable for x86, wrt bug #447470
diff --git a/dev-python/imaging/imaging-1.1.7-r3.ebuild b/dev-python/imaging/imaging-1.1.7-r3.ebuild
new file mode 100644
index 000000000000..ad60d3aa87f1
--- /dev/null
+++ b/dev-python/imaging/imaging-1.1.7-r3.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/imaging/imaging-1.1.7-r3.ebuild,v 1.1 2013/04/21 20:33:22 mgorny Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python{2_5,2_6,2_7} )
+PYTHON_REQ_USE='tk?'
+
+inherit distutils-r1
+
+MY_P=Imaging-${PV}
+
+DESCRIPTION="Python Imaging Library (PIL)"
+HOMEPAGE="http://www.pythonware.com/products/pil/index.htm"
+SRC_URI="http://www.effbot.org/downloads/${MY_P}.tar.gz"
+
+LICENSE="HPND"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+IUSE="doc examples jpeg lcms scanner test tiff tk truetype zlib"
+
+RDEPEND="
+ truetype? ( media-libs/freetype:2 )
+ jpeg? ( virtual/jpeg )
+ lcms? ( media-libs/lcms:0 )
+ scanner? ( media-gfx/sane-backends )
+ tiff? ( media-libs/tiff )
+ zlib? ( sys-libs/zlib )
+ !dev-python/pillow"
+DEPEND="${RDEPEND}"
+
+# Tests don't handle missing jpeg, tiff & zlib properly.
+REQUIRED_USE="test? ( jpeg tiff zlib )"
+
+S="${WORKDIR}/${MY_P}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}/${P}-no-xv.patch"
+ "${FILESDIR}/${P}-sane.patch"
+ "${FILESDIR}/${P}-giftrans.patch"
+ "${FILESDIR}/${P}-missing-math.patch"
+ )
+
+ # Add shebangs.
+ sed -e "1i#!/usr/bin/env python" -i Scripts/*.py || die
+
+ # Disable all the stuff we don't want.
+ local f
+ for f in jpeg lcms tiff tk zlib; do
+ if ! use ${f}; then
+ sed -i -e "s:feature.${f} =:& None #:" setup.py || die
+ fi
+ done
+ if ! use truetype; then
+ sed -i -e 's:feature.freetype =:& None #:' setup.py || die
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+# XXX: split into two ebuilds?
+wrap_phase() {
+ "${@}"
+
+ if use scanner; then
+ cd Sane || die
+ "${@}"
+ fi
+}
+
+python_compile() {
+ wrap_phase distutils-r1_python_compile
+}
+
+python_test() {
+ "${PYTHON}" selftest.py || die "Tests fail with ${EPYTHON}"
+}
+
+python_install() {
+ python_doheader libImaging/{Imaging.h,ImPlatform.h}
+
+ wrap_phase distutils-r1_python_install
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/. )
+ use examples && local EXAMPLES=( Scripts/. )
+
+ distutils-r1_python_install_all
+
+ if use scanner; then
+ docinto sane
+ dodoc Sane/{CHANGES,README,sanedoc.txt}
+ fi
+
+ if use examples && use scanner; then
+ docinto examples/sane
+ doins Sane/demo_*.py
+ fi
+}