diff options
author | Mike Gilbert <floppym@gentoo.org> | 2013-06-06 05:07:45 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2013-06-06 05:07:45 +0000 |
commit | 3b68743123b4ba9251b52afe67fbe9c4773262d3 (patch) | |
tree | beb43eb2c4e6d6aa5261dab4f5dd0150e0b0ea93 /dev-python/cgkit | |
parent | Add REQUIRED_USE for python_targets flags. (diff) | |
download | gentoo-2-3b68743123b4ba9251b52afe67fbe9c4773262d3.tar.gz gentoo-2-3b68743123b4ba9251b52afe67fbe9c4773262d3.tar.bz2 gentoo-2-3b68743123b4ba9251b52afe67fbe9c4773262d3.zip |
Version bump. Convert to distutils-r1. Enable python3.
(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
Diffstat (limited to 'dev-python/cgkit')
-rw-r--r-- | dev-python/cgkit/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/cgkit/cgkit-2.0.0.ebuild | 88 | ||||
-rw-r--r-- | dev-python/cgkit/files/cgkit-py2k-pillow.patch | 82 | ||||
-rw-r--r-- | dev-python/cgkit/files/cgkit-py3k-pillow.patch | 82 |
4 files changed, 259 insertions, 1 deletions
diff --git a/dev-python/cgkit/ChangeLog b/dev-python/cgkit/ChangeLog index b3ff6504c867..e9d221c43fa6 100644 --- a/dev-python/cgkit/ChangeLog +++ b/dev-python/cgkit/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/cgkit # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/cgkit/ChangeLog,v 1.38 2013/06/05 23:49:38 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/cgkit/ChangeLog,v 1.39 2013/06/06 05:07:44 floppym Exp $ + +*cgkit-2.0.0 (06 Jun 2013) + + 06 Jun 2013; Mike Gilbert <floppym@gentoo.org> +cgkit-2.0.0.ebuild, + +files/cgkit-py2k-pillow.patch, +files/cgkit-py3k-pillow.patch: + Version bump. Convert to distutils-r1. Enable python3. 05 Jun 2013; Mike Gilbert <floppym@gentoo.org> metadata.xml: Fix encoding. diff --git a/dev-python/cgkit/cgkit-2.0.0.ebuild b/dev-python/cgkit/cgkit-2.0.0.ebuild new file mode 100644 index 000000000000..dd92977575a8 --- /dev/null +++ b/dev-python/cgkit/cgkit-2.0.0.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/cgkit/cgkit-2.0.0.ebuild,v 1.1 2013/06/06 05:07:44 floppym Exp $ + +EAPI="5" +PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} ) + +inherit distutils-r1 eutils scons-utils toolchain-funcs + +MY_P="${P/_/}" + +DESCRIPTION="Python library for creating 3D images" +HOMEPAGE="http://cgkit.sourceforge.net" +SRC_URI="$(python_gen_cond_dep mirror://sourceforge/${PN}/${PN}/${P}/${P}-py2k.tar.gz 'python2*') + $(python_gen_cond_dep mirror://sourceforge/${PN}/${PN}/${P}/${P}-py3k.tar.gz 'python3*')" + +LICENSE="LGPL-2.1 MPL-1.1 GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="3ds" + +PY2_USEDEP=$(python_gen_usedep 'python2*') +RDEPEND=">=dev-libs/boost-1.48[python,${PYTHON_USEDEP}] + $(python_gen_cond_dep dev-python/pyprotocols[${PY2_USEDEP}] 'python2*') + dev-python/pyopengl[${PYTHON_USEDEP}] + dev-python/pygame[${PYTHON_USEDEP}] + virtual/python-imaging[${PYTHON_USEDEP}] + 3ds? ( media-libs/lib3ds )" +DEPEND="${RDEPEND} + dev-util/scons" + +DISTUTILS_IN_SOURCE_BUILD=1 + +cgkit_unpack() { + local tarball + if [[ ${EPYTHON} == python3* ]]; then + tarball=${P}-py3k.tar.gz + else + tarball=${P}-py2k.tar.gz + fi + mkdir "${BUILD_DIR}" || die + tar -C "${BUILD_DIR}" -x --strip-components 1 -f "${DISTDIR}/${tarball}" || die +} + +src_unpack() { + python_parallel_foreach_impl cgkit_unpack + mkdir "${S}" || die +} + +python_prepare_all() { + return 0 +} + +python_prepare() { + if [[ ${EPYTHON} == python3* ]]; then + epatch "${FILESDIR}/${PN}-py3k-pillow.patch" + else + epatch "${FILESDIR}/${PN}-py2k-pillow.patch" + fi + [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" + + sed -e "s/fPIC/fPIC\",\"${CFLAGS// /\",\"}/" -i supportlib/SConstruct + cp config_template.cfg config.cfg + echo "BOOST_LIB = 'boost_python-${EPYTHON#python}'" >> config.cfg + echo "LIBS += ['GL', 'GLU', 'glut']" >> config.cfg + if use 3ds; then + echo "LIB3DS_AVAILABLE = True" >> config.cfg + fi + + sed -e "s:INC_DIRS = \[\]:INC_DIRS = \['/usr/include'\]:" -i setup.py + + # Remove invalid test + rm -f unittests/test_pointcloud.py || die +} + +python_compile() { + pushd supportlib > /dev/null || die + escons + popd > /dev/null || die + distutils-r1_python_compile +} + +python_test() { + pushd unittests > /dev/null || die + mkdir tmp || die + "${PYTHON}" all.py || die "Testing failed with ${EPYTHON}" + popd > /dev/null || die +} diff --git a/dev-python/cgkit/files/cgkit-py2k-pillow.patch b/dev-python/cgkit/files/cgkit-py2k-pillow.patch new file mode 100644 index 000000000000..0cddbd60b868 --- /dev/null +++ b/dev-python/cgkit/files/cgkit-py2k-pillow.patch @@ -0,0 +1,82 @@ +From 83cb693954f6f56e50a1aa90d935e94e9e8bac8e Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Wed, 5 Jun 2013 20:39:05 -0400 +Subject: [PATCH] Update PIL imports for compatibility with Pillow + +--- + cgkit/_Image.py | 2 +- + cgkit/_ImageDraw.py | 2 +- + cgkit/riutil.py | 2 +- + utilities/checkenv.py | 2 +- + utilities/postbake.py | 3 ++- + 5 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/cgkit/_Image.py b/cgkit/_Image.py +index 7266d4b..0122cd2 100644 +--- a/cgkit/_Image.py ++++ b/cgkit/_Image.py +@@ -38,7 +38,7 @@ + try: + + # Try to import the original module... +- from Image import * ++ from PIL.Image import * + + except ImportError: + +diff --git a/cgkit/_ImageDraw.py b/cgkit/_ImageDraw.py +index dfd6cf8..d1d3cff 100644 +--- a/cgkit/_ImageDraw.py ++++ b/cgkit/_ImageDraw.py +@@ -38,7 +38,7 @@ + try: + + # Try to import the original module... +- from ImageDraw import * ++ from PIL.ImageDraw import * + + except ImportError: + +diff --git a/cgkit/riutil.py b/cgkit/riutil.py +index 301e0f6..ae373c3 100644 +--- a/cgkit/riutil.py ++++ b/cgkit/riutil.py +@@ -38,7 +38,7 @@ import types, sys, getpass + from cgtypes import vec3 + from ri import * + try: +- import Image ++ from PIL import Image + _PIL_installed = 1 + except ImportError: + _PIL_installed = 0 +diff --git a/utilities/checkenv.py b/utilities/checkenv.py +index b95dbf7..c93235e 100644 +--- a/utilities/checkenv.py ++++ b/utilities/checkenv.py +@@ -96,7 +96,7 @@ visualize them. You can obtain PyOpenGL at http://pyopengl.sourceforge.net/ + # Check PIL + chkmsg("PIL") + try: +- import Image ++ from PIL import Image + print "is installed" + except: + print "missing" +diff --git a/utilities/postbake.py b/utilities/postbake.py +index cadd11d..74f894a 100644 +--- a/utilities/postbake.py ++++ b/utilities/postbake.py +@@ -34,7 +34,8 @@ + # + # ***** END LICENSE BLOCK ***** + +-import sys, optparse, Image ++import sys, optparse ++from PIL import Image + + # shift + def shift(img, dx, dy): +-- +1.8.2.1 + diff --git a/dev-python/cgkit/files/cgkit-py3k-pillow.patch b/dev-python/cgkit/files/cgkit-py3k-pillow.patch new file mode 100644 index 000000000000..734ff6eb356a --- /dev/null +++ b/dev-python/cgkit/files/cgkit-py3k-pillow.patch @@ -0,0 +1,82 @@ +From 1953081269ce1cfdf29023a8590db40312c43194 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Wed, 5 Jun 2013 20:39:05 -0400 +Subject: [PATCH] Update PIL imports for compatibility with Pillow + +--- + cgkit/_Image.py | 2 +- + cgkit/_ImageDraw.py | 2 +- + cgkit/riutil.py | 2 +- + utilities/checkenv.py | 2 +- + utilities/postbake.py | 3 ++- + 5 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/cgkit/_Image.py b/cgkit/_Image.py +index 7266d4b..0122cd2 100644 +--- a/cgkit/_Image.py ++++ b/cgkit/_Image.py +@@ -38,7 +38,7 @@ + try: + + # Try to import the original module... +- from Image import * ++ from PIL.Image import * + + except ImportError: + +diff --git a/cgkit/_ImageDraw.py b/cgkit/_ImageDraw.py +index dfd6cf8..d1d3cff 100644 +--- a/cgkit/_ImageDraw.py ++++ b/cgkit/_ImageDraw.py +@@ -38,7 +38,7 @@ + try: + + # Try to import the original module... +- from ImageDraw import * ++ from PIL.ImageDraw import * + + except ImportError: + +diff --git a/cgkit/riutil.py b/cgkit/riutil.py +index b51f192..ae0fba2 100644 +--- a/cgkit/riutil.py ++++ b/cgkit/riutil.py +@@ -38,7 +38,7 @@ import types, sys, getpass + from .cgtypes import vec3 + from .ri import * + try: +- import Image ++ from PIL import Image + _PIL_installed = 1 + except ImportError: + _PIL_installed = 0 +diff --git a/utilities/checkenv.py b/utilities/checkenv.py +index dda600f..8b6f74e 100644 +--- a/utilities/checkenv.py ++++ b/utilities/checkenv.py +@@ -96,7 +96,7 @@ visualize them. You can obtain PyOpenGL at http://pyopengl.sourceforge.net/ + # Check PIL + chkmsg("PIL") + try: +- import Image ++ from PIL import Image + print("is installed") + except: + print("missing") +diff --git a/utilities/postbake.py b/utilities/postbake.py +index 90e3140..27728c2 100644 +--- a/utilities/postbake.py ++++ b/utilities/postbake.py +@@ -34,7 +34,8 @@ + # + # ***** END LICENSE BLOCK ***** + +-import sys, optparse, Image ++import sys, optparse ++from PIL import Image + + # shift + def shift(img, dx, dy): +-- +1.8.2.1 + |