/[gentoo-x86]/dev-python/imaging/imaging-1.1.7-r1.ebuild
Gentoo

Contents of /dev-python/imaging/imaging-1.1.7-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Tue May 28 22:47:40 2013 UTC (16 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +3 -2 lines
Remove imaging-2.0.0, add blocker for dev-python/pillow.

(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/imaging/imaging-1.1.7-r1.ebuild,v 1.12 2012/12/01 02:02:19 radhermit Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="2"
7 PYTHON_USE_WITH="tk"
8 PYTHON_USE_WITH_OPT="tk"
9 SUPPORT_PYTHON_ABIS="1"
10 RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
11
12 inherit eutils multilib distutils
13
14 MY_P=Imaging-${PV}
15
16 DESCRIPTION="Python Imaging Library (PIL)"
17 HOMEPAGE="http://www.pythonware.com/products/pil/index.htm"
18 SRC_URI="http://www.effbot.org/downloads/${MY_P}.tar.gz"
19
20 LICENSE="HPND"
21 SLOT="0"
22 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
23 IUSE="doc examples lcms scanner tk X"
24
25 DEPEND="virtual/jpeg
26 media-libs/freetype:2
27 lcms? ( media-libs/lcms:0 )
28 scanner? ( media-gfx/sane-backends )
29 X? ( x11-misc/xdg-utils )"
30 RDEPEND="${DEPEND}"
31 RDEPEND+=" !dev-python/pillow"
32
33 S="${WORKDIR}/${MY_P}"
34
35 DOCS="CHANGES CONTENTS"
36
37 pkg_setup() {
38 PYTHON_MODNAME="PIL $(use scanner && echo sane.py)"
39 python_pkg_setup
40 }
41
42 src_prepare() {
43 distutils_src_prepare
44
45 epatch "${FILESDIR}/${P}-no-xv.patch"
46 epatch "${FILESDIR}/${P}-sane.patch"
47 epatch "${FILESDIR}/${P}-giftrans.patch"
48 epatch "${FILESDIR}/${P}-missing-math.patch"
49 if ! use lcms; then
50 epatch "${FILESDIR}/${P}-nolcms.patch"
51 fi
52
53 # Add shebang.
54 sed -e "1i#!/usr/bin/python" -i Scripts/pilfont.py \
55 || die "sed failed adding shebang"
56
57 sed -i \
58 -e "s:/usr/lib\":/usr/$(get_libdir)\":" \
59 -e "s:\"lib\":\"$(get_libdir)\":g" \
60 setup.py || die "sed failed"
61
62 if ! use tk; then
63 # Make the test always fail
64 sed -i \
65 -e 's/import _tkinter/raise ImportError/' \
66 setup.py || die "sed failed"
67 fi
68 }
69
70 src_compile() {
71 distutils_src_compile
72
73 if use scanner; then
74 pushd Sane > /dev/null
75 distutils_src_compile
76 popd > /dev/null
77 fi
78 }
79
80 src_test() {
81 tests() {
82 PYTHONPATH="$(ls -d build-${PYTHON_ABI}/lib.*)" "$(PYTHON)" selftest.py
83 }
84 python_execute_function tests
85 }
86
87 src_install() {
88 distutils_src_install
89
90 if use doc; then
91 dohtml Docs/* || die "dohtml failed"
92 fi
93
94 if use scanner; then
95 pushd Sane > /dev/null
96 docinto sane
97 DOCS="CHANGES sanedoc.txt" distutils_src_install
98 popd > /dev/null
99 fi
100
101 # Install headers required by media-gfx/sketch.
102 install_headers() {
103 insinto "$(python_get_includedir)"
104 doins libImaging/Imaging.h
105 doins libImaging/ImPlatform.h
106 }
107 python_execute_function install_headers
108
109 if use examples; then
110 insinto /usr/share/doc/${PF}/examples
111 doins Scripts/* || die "doins failed"
112
113 if use scanner; then
114 insinto /usr/share/doc/${PF}/examples/sane
115 doins Sane/demo_*.py || die "doins failed"
116 fi
117 fi
118 }

  ViewVC Help
Powered by ViewVC 1.1.20