# $Id$
EAPI=5
+
PYTHON_COMPAT=( python2_7 )
inherit distutils-r1 virtualx flag-o-matic
DESCRIPTION="Enthought Tool Suite: Drawing and interaction packages"
-HOMEPAGE="http://code.enthought.com/projects/enable/ https://pypi.python.org/pypi/enable"
-SRC_URI="https://github.com/enthought/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+HOMEPAGE="http://code.enthought.com/projects/enable/ https://pypi.python.org/pypi/enable https://github.com/enthought/enable"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
IUSE="doc examples test"
-DISTUTILS_IN_SOURCE_BUILD=1
-RDEPEND="dev-python/numpy[${PYTHON_USEDEP}]
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
dev-python/reportlab[${PYTHON_USEDEP}]
>=dev-python/traitsui-4[${PYTHON_USEDEP}]
>=media-libs/freetype-2
media-fonts/font-misc-misc
)"
+DISTUTILS_IN_SOURCE_BUILD=1
+
+PATCHES=( "${FILESDIR}"/${P}-swig.patch )
+
python_prepare_all() {
append-cflags -fno-strict-aliasing
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 virtualx flag-o-matic
+
+DESCRIPTION="Enthought Tool Suite: Drawing and interaction packages"
+HOMEPAGE="http://code.enthought.com/projects/enable/ https://pypi.python.org/pypi/enable https://github.com/enthought/enable"
+#SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+SRC_URI="https://github.com/enthought/enable/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+RDEPEND="
+ dev-python/apptools[${PYTHON_USEDEP}]
+ dev-python/kiwisolver[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/reportlab[${PYTHON_USEDEP}]
+ >=dev-python/traitsui-4[${PYTHON_USEDEP}]
+ >=media-libs/freetype-2
+ virtual/opengl
+ virtual/glu
+ x11-libs/libX11"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-lang/swig:0
+ dev-python/cython[${PYTHON_USEDEP}]
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ media-fonts/font-cursor-misc
+ media-fonts/font-misc-misc
+ )"
+
+DISTUTILS_IN_SOURCE_BUILD=1
+
+PATCHES=( "${FILESDIR}"/${PN}-4.4.1-swig.patch )
+
+python_prepare_all() {
+ append-cflags -fno-strict-aliasing
+
+ sed -e 's:html_favicon = "et.ico":html_favicon = "_static/et.ico":' \
+ -i docs/source/conf.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs html
+}
+
+python_test() {
+ pushd "${BUILD_DIR}"/lib > /dev/null
+ # https://github.com/enthought/enable/issues/158
+ PYTHONPATH=.:kiva \
+ VIRTUALX_COMMAND="nosetests" virtualmake --verbose
+ popd > /dev/null
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+
+ use examples && local EXAMPLES=( examples/. )
+ distutils-r1_python_install_all
+}
--- /dev/null
+From f0e399174c5f55eb3a72860c620fdd5193ad57da Mon Sep 17 00:00:00 2001
+From: Jonathan Stickel <jjstickel@gmail.com>
+Date: Wed, 25 Mar 2015 14:05:01 -0600
+Subject: [PATCH] fixes for recent swig
+
+---
+ kiva/agg/src/affine_matrix.i | 4 ++--
+ kiva/agg/src/constants.i | 4 ++--
+ kiva/agg/src/hit_test.i | 4 ++--
+ kiva/agg/src/rgba.i | 4 ++--
+ 4 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/kiva/agg/src/affine_matrix.i b/kiva/agg/src/affine_matrix.i
+index 2f30e51..7c05a6a 100644
+--- a/kiva/agg/src/affine_matrix.i
++++ b/kiva/agg/src/affine_matrix.i
+@@ -157,7 +157,7 @@ namespace agg24
+ };
+ };
+
+-%pythoncode {
++%pythoncode %{
+ def is_sequence(arg):
+ try:
+ len(arg)
+@@ -184,7 +184,7 @@ class AffineMatrix(_AffineMatrix):
+ """
+ self.multiply(other)
+ return self
+-}
++%}
+
+ %extend agg24::trans_affine
+ {
+diff --git a/kiva/agg/src/constants.i b/kiva/agg/src/constants.i
+index b680cae..78f9d0c 100644
+--- a/kiva/agg/src/constants.i
++++ b/kiva/agg/src/constants.i
+@@ -44,7 +44,7 @@
+ unsigned path_cmd(unsigned c);
+ unsigned path_flags(unsigned c);
+
+-%pythoncode {
++%pythoncode %{
+
+ #----------------------------------------------------------------------------
+ #
+@@ -141,4 +141,4 @@ interp_enum_map = {}
+ for key,value in interp_string_map.items():
+ interp_enum_map[value] = key
+
+-}
++%}
+diff --git a/kiva/agg/src/hit_test.i b/kiva/agg/src/hit_test.i
+index 76de0c9..2cfb1cf 100644
+--- a/kiva/agg/src/hit_test.i
++++ b/kiva/agg/src/hit_test.i
+@@ -22,7 +22,7 @@ namespace kiva
+ }
+
+ %pythoncode
+-{
++%{
+ from numpy import shape, transpose, zeros, rank, reshape, int32
+
+ def points_in_polygon(pts, poly_pts, use_winding=False):
+@@ -92,4 +92,4 @@ def points_in_polygon(pts, poly_pts, use_winding=False):
+ else:
+ _agg.points_in_polygon(pts, poly_pts, results)
+ return results
+-}
++%}
+diff --git a/kiva/agg/src/rgba.i b/kiva/agg/src/rgba.i
+index f7624b8..183014f 100644
+--- a/kiva/agg/src/rgba.i
++++ b/kiva/agg/src/rgba.i
+@@ -74,7 +74,7 @@ namespace agg24
+ }
+
+
+-%pythoncode {
++%pythoncode %{
+ def is_sequence(arg):
+ try:
+ len(arg)
+@@ -90,6 +90,6 @@ class Rgba(_Rgba):
+ if len(args) not in [3,4]:
+ raise ValueError, "array argument must be 1x3 or 1x4"
+ _Rgba.__init__(self,*args)
+-}
++%}
+
+ %clear double r, double g, double b, double a;