summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-python/pycairo/ChangeLog13
-rw-r--r--dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch126
-rw-r--r--dev-python/pycairo/files/pycairo-1.8.10-cairo.version_info.patch14
-rw-r--r--dev-python/pycairo/pycairo-1.10.0.ebuild125
4 files changed, 276 insertions, 2 deletions
diff --git a/dev-python/pycairo/ChangeLog b/dev-python/pycairo/ChangeLog
index 3ad778c86850..d5e42c0bb8a0 100644
--- a/dev-python/pycairo/ChangeLog
+++ b/dev-python/pycairo/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for dev-python/pycairo
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/pycairo/ChangeLog,v 1.98 2010/10/23 12:21:38 arfrever Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycairo/ChangeLog,v 1.99 2011/04/24 20:31:13 arfrever Exp $
+
+*pycairo-1.10.0 (24 Apr 2011)
+
+ 24 Apr 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
+ +files/pycairo-1.8.10-cairo.version_info.patch, +pycairo-1.10.0.ebuild,
+ +files/pycairo-1.10.0-svg_check.patch:
+ Version bump. This ebuild provides pycairo 1.10.0 for Python 3 and pycairo
+ 1.8.10 for Python 2. Fix cairo.version_info in pycairo 1.8.10 for Python 2
+ (bug #361781).
23 Oct 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
-pycairo-1.8.8.ebuild, -files/pycairo-1.8.8-pkgconfig_dir.patch:
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch
new file mode 100644
index 000000000000..572a5f6cc717
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch
@@ -0,0 +1,126 @@
+--- src/cairomodule.c
++++ src/cairomodule.c
+@@ -116,7 +116,7 @@
+ #else
+ 0,
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ &PycairoSVGSurface_Type,
+ #else
+ 0,
+@@ -247,7 +247,7 @@
+ if (PyType_Ready(&PycairoPSSurface_Type) < 0)
+ return NULL;
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ if (PyType_Ready(&PycairoSVGSurface_Type) < 0)
+ return NULL;
+ #endif
+@@ -337,7 +337,7 @@
+ PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type);
+ #endif
+
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ Py_INCREF(&PycairoSVGSurface_Type);
+ PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type);
+ #endif
+@@ -399,7 +399,7 @@
+ #else
+ PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0);
+ #endif
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1);
+ #else
+ PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0);
+--- src/private.h
++++ src/private.h
+@@ -75,7 +75,7 @@
+ extern PyTypeObject PycairoPSSurface_Type;
+ #endif
+
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ extern PyTypeObject PycairoSVGSurface_Type;
+ #endif
+
+--- src/py3cairo.h
++++ src/py3cairo.h
+@@ -171,7 +171,7 @@
+ #define PycairoPSSurface_Type *(Pycairo_CAPI->PSSurface_Type)
+ #endif
+
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ #define PycairoSVGSurface_Type *(Pycairo_CAPI->SVGSurface_Type)
+ #endif
+
+--- src/surface.c
++++ src/surface.c
+@@ -72,7 +72,7 @@
+ type = &PycairoPSSurface_Type;
+ break;
+ #endif
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ case CAIRO_SURFACE_TYPE_SVG:
+ type = &PycairoSVGSurface_Type;
+ break;
+@@ -1022,7 +1022,7 @@
+
+
+ /* Class SVGSurface(Surface) ----------------------------------------------- */
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ #include <cairo-svg.h>
+
+ static PyObject *
+@@ -1133,7 +1133,7 @@
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ };
+-#endif /* CAIRO_HAS_SVG_SURFACE */
++#endif /* PYCAIRO_ENABLE_SVG */
+
+
+ #if CAIRO_HAS_WIN32_SURFACE
+--- wscript
++++ wscript
+@@ -1,6 +1,7 @@
+ # -*- python -*-
+
+ import os
++import subprocess
+
+ top = '.'
+ out = 'build_directory'
+@@ -11,6 +12,17 @@
+ cairo_version_required = '1.10.0'
+
+
++def check_svg():
++ if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None:
++ return_code = subprocess.call(['pkg-config', '--exists', 'cairo-svg'])
++ if return_code == 0:
++ return True
++ else:
++ return False
++ else:
++ return False
++
++
+ def options(ctx):
+ print(' %s/options()' %d)
+ ctx.tool_options('gnu_dirs')
+@@ -39,6 +51,8 @@
+ ctx.define('PYCAIRO_VERSION_MAJOR', version[0])
+ ctx.define('PYCAIRO_VERSION_MINOR', version[1])
+ ctx.define('PYCAIRO_VERSION_MICRO', version[2])
++ if check_svg():
++ ctx.define('PYCAIRO_ENABLE_SVG', 1)
+
+ ctx.write_config_header('src/config.h')
+
diff --git a/dev-python/pycairo/files/pycairo-1.8.10-cairo.version_info.patch b/dev-python/pycairo/files/pycairo-1.8.10-cairo.version_info.patch
new file mode 100644
index 000000000000..8518f94a53d5
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.8.10-cairo.version_info.patch
@@ -0,0 +1,14 @@
+http://cgit.freedesktop.org/py2cairo/patch/?id=3953265c398ccbd600b4d788f7c8f9a8e0e644a2
+
+--- setup.py
++++ setup.py
+@@ -64,8 +64,8 @@
+ #define _CONFIG_H 1
+
+ #define PYCAIRO_VERSION_MAJOR %s
+-#define PYCAIRO_VERSION_MICRO %s
+ #define PYCAIRO_VERSION_MINOR %s
++#define PYCAIRO_VERSION_MICRO %s
+ #define VERSION "%s"
+
+ #endif // _CONFIG_H
diff --git a/dev-python/pycairo/pycairo-1.10.0.ebuild b/dev-python/pycairo/pycairo-1.10.0.ebuild
new file mode 100644
index 000000000000..286a130f8dd5
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.10.0.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycairo/pycairo-1.10.0.ebuild,v 1.1 2011/04/24 20:31:13 arfrever Exp $
+
+EAPI="3"
+PYTHON_DEPEND="2:2.6 3:3.1"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.4 2.5 3.0 *-jython"
+
+inherit eutils multilib python waf-utils
+
+PYCAIRO_PYTHON2_VERSION="1.8.10"
+PYCAIRO_PYTHON3_VERSION="${PV}"
+
+DESCRIPTION="Python bindings for the cairo library"
+HOMEPAGE="http://cairographics.org/pycairo/ http://pypi.python.org/pypi/pycairo"
+SRC_URI="http://cairographics.org/releases/py2cairo-${PYCAIRO_PYTHON2_VERSION}.tar.gz
+ http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2"
+
+# LGPL-3 for pycairo 1.10.0.
+# || ( LGPL-2.1 MPL-1.1 ) for pycairo 1.8.10.
+LICENSE="LGPL-3 || ( LGPL-2.1 MPL-1.1 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc examples +svg test"
+
+RDEPEND=">=x11-libs/cairo-1.10.0[svg?]"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ test? ( dev-python/pytest )"
+
+PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
+
+src_prepare() {
+ pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
+ epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
+ popd > /dev/null
+
+ pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
+ epatch "${FILESDIR}/${PN}-1.8.8-svg_check.patch"
+ epatch "${FILESDIR}/${PN}-1.8.10-pkgconfig_dir.patch"
+ epatch "${FILESDIR}/${PN}-1.8.10-cairo.version_info.patch"
+ popd > /dev/null
+
+ preparation() {
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${WORKDIR}/${P}-${PYTHON_ABI}"
+ else
+ cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON2_VERSION}" "${WORKDIR}/${P}-${PYTHON_ABI}"
+ fi
+ }
+ python_execute_function preparation
+}
+
+src_configure() {
+ if ! use svg; then
+ export PYCAIRO_DISABLE_SVG="1"
+ fi
+
+ configuration() {
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ waf-utils_src_configure --nopyc --nopyo
+ fi
+ }
+ python_execute_function -s configuration
+}
+
+src_compile() {
+ building() {
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ waf-utils_src_compile
+ else
+ echo ${_BOLD}"$(PYTHON)" setup.py build${_NORMAL}
+ "$(PYTHON)" setup.py build
+ fi
+ }
+ python_execute_function -s building
+}
+
+src_test() {
+ test_installation() {
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ ./waf install --destdir="${T}/tests/${PYTHON_ABI}"
+ else
+ "$(PYTHON)" setup.py install --no-compile --root="${T}/tests/${PYTHON_ABI}"
+ fi
+ }
+ python_execute_function -q -s test_installation
+
+ python_execute_py.test -P '${T}/tests/${PYTHON_ABI}${EPREFIX}$(python_get_sitedir)' -s
+}
+
+src_install() {
+ installation() {
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ waf-utils_src_install
+ else
+ echo ${_BOLD}"$(PYTHON)" setup.py install --no-compile --root="${D}"${_NORMAL}
+ PKGCONFIG_DIR="${EPREFIX}/usr/$(get_libdir)/pkgconfig" "$(PYTHON)" setup.py install --no-compile --root="${D}"
+ fi
+ }
+ python_execute_function -s installation
+
+ dodoc AUTHORS NEWS README || die "dodoc failed"
+
+ if use doc; then
+ pushd doc/_build/html > /dev/null
+ insinto /usr/share/doc/${PF}/html
+ doins -r [a-z]* _static || die "Installation of documentation failed"
+ popd > /dev/null
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/* || die "Installation of examples failed"
+ fi
+}
+
+pkg_postinst() {
+ python_mod_optimize cairo
+}
+
+pkg_postrm() {
+ python_mod_cleanup cairo
+}