/[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.10 - (hide annotations) (download)
Tue Apr 17 21:57:44 2012 UTC (2 years, 4 months ago) by ranger
Branch: MAIN
Changes since 1.9: +2 -2 lines
Marking imaging-1.1.7-r1 ppc64 for bug 410075

(Portage version: 2.1.10.11/cvs/Linux ppc64)

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

  ViewVC Help
Powered by ViewVC 1.1.20