* [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/
@ 2012-02-20 3:51 Nathan Phillip Brink
0 siblings, 0 replies; 4+ messages in thread
From: Nathan Phillip Brink @ 2012-02-20 3:51 UTC (permalink / raw
To: gentoo-commits
commit: 16e3674d231ae99cf389246384659f28c0b19b21
Author: Nathan Phillip Brink <binki <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 20 03:51:16 2012 +0000
Commit: Nathan Phillip Brink <binki <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 03:51:16 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/multilib-portage.git;a=commit;h=16e3674d
dev-python/pycairo: Fix bug #367293 for portage-multilib users by hackily patching waflib.
(Portage version: 2.2.0_alpha84-r1/git/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 6BA81050)
---
dev-python/pycairo/Manifest | 27 +++
.../pycairo/files/py2cairo-1.10.0-svg_check.patch | 126 +++++++++++++++
.../pycairo/files/pycairo-1.10.0-svg_check.patch | 126 +++++++++++++++
dev-python/pycairo/metadata.xml | 8 +
dev-python/pycairo/pycairo-1.10.0-r2.ebuild | 167 ++++++++++++++++++++
5 files changed, 454 insertions(+), 0 deletions(-)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
new file mode 100644
index 0000000..7c26183
--- /dev/null
+++ b/dev-python/pycairo/Manifest
@@ -0,0 +1,27 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+AUX py2cairo-1.10.0-svg_check.patch 2912 RMD160 79cbae6b38baeb1a55309aa41cb40bd0bb2ad1b2 SHA1 fdd5a4f9b9f17aa0f48e62ef97359f57046da46e SHA256 c35d96be5be571c2f4c3415e4016a7e70a5edd6164818af80d16855e4e4efe72
+AUX pycairo-1.10.0-svg_check.patch 2924 RMD160 e0a01e9587ad47dc00a0d449fb3d00fcfbacfe7a SHA1 3969a610e8431938605c7eae5a86b43ef0c9881c SHA256 f9d2bac70bcca57c523e69403cb7332bf4ade0427998b6a3dc16730bcc17b6c7
+DIST py2cairo-1.10.0.tar.bz2 402070 RMD160 ce75db9af32ef1a3e90f6aaa649cbb2493a941a4 SHA1 2efa8dfafbd6b8e492adaab07231556fec52d6eb SHA256 d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431
+DIST pycairo-1.10.0-waf-multilib.patch 761 RMD160 1e2210e0a7c7ec2fc19245d512c0d762ca9aed1f SHA1 bbaef5a3699a53023efb659a86a97180e34dee56 SHA256 8e9e081bf7b4beced282a8de265b6e8901b113df7fbe892d7f0f93c63c771e5b
+DIST pycairo-1.10.0.tar.bz2 246556 RMD160 7d1c1c05113e5bbad32dbe96c65c918b170cac33 SHA1 b4283aa1cc9aafd12fd72ad371303a486da1d014 SHA256 9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be
+EBUILD pycairo-1.10.0-r2.ebuild 4956 RMD160 8b647aaf910d5614800c9f8971b76be108a7437d SHA1 a97b1ce6799116e06a0da9936dc1abb04bd66af8 SHA256 2ed5dfce4549fdb69c3dd6c2a64dd5d5b48f538bfef69c8858bb0820ac2f80db
+MISC metadata.xml 244 RMD160 763839a53ccf1e2a58d249cfa2d94feeaa69e29c SHA1 fe85b5f10031620b8d1da84d695ec3080df29d82 SHA256 f5bde347c36c74889cbb32d29f06766c08eb3df6e0c468f00295681382c48457
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.14 (GNU/Linux)
+
+iQIcBAEBCgAGBQJPQcM0AAoJEHQ6UuhrqBBQ//8P/Rorh+75shJuPQXl9G06/v/F
+yAmTi3VIDxh6+hzGnYs40+78Q5maCXfUnA7i66PdsYvwidceNxl3mddo2dTLtlPm
+uEKrXlaMHC1A3wTjKj0Zh+LtlWMU8/x83HV5jKOQy0E/45XnccvhIKnaADUXzatb
+z486ITlx4V0V1Kg/sCdqWkVT0EfJ5GdreXqcdOwqbEWVoVcvv15des5hSAwKM5ON
+1IJ5IJwln2ivI68cYA6nLrhHz6tieqqA4cie/G61z9Wapz8ZMXCEGiE3139sTQQi
+8+A2Yf/nkvT3AKLqVoxbsnbVf5qgHiE2m+zzTWw8/58ZbdpghS9wFHroSLIxDxX9
+M9Pld7XFj1zWjbINvItgE5Y7H1B9HHofx01xB8Xbq0hrTOQpK5pTknDTXTwVMJgu
+ktro/yL4B4Erhuc0l/m2NiSG/x+oHDUzWG06+wXjAlXXP8T4oGJMIDy6qvNhHP6z
+FgXDs8HEjJFmPo10WtZ/Izbcqs7//t4wWFCm41efGfHUK6T1HX5skaesKL7qxOSK
+PiP36IXImfBMvDN4hqI4mWGcEQHgz+z/abGu0igbooCZOkycTShVxoqFszlLjRkv
+wU4TVGGAEc5GrMpgnWNj8cMZiEpKasvkF3BU36fEJEXbZSZQTbYqmWxCh6IxossX
+RsAQNTKPLXnZhWEw5jXa
+=tF88
+-----END PGP SIGNATURE-----
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch
new file mode 100644
index 0000000..4cd755c
--- /dev/null
+++ b/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch
@@ -0,0 +1,126 @@
+--- src/cairomodule.c
++++ src/cairomodule.c
+@@ -127,7 +127,7 @@
+ #else
+ 0,
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ &PycairoSVGSurface_Type,
+ #else
+ 0,
+@@ -223,7 +223,7 @@
+ if (PyType_Ready(&PycairoPSSurface_Type) < 0)
+ return;
+ #endif
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ if (PyType_Ready(&PycairoSVGSurface_Type) < 0)
+ return;
+ #endif
+@@ -305,7 +305,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
+@@ -379,7 +379,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
+@@ -86,7 +86,7 @@
+ extern PyTypeObject PycairoPSSurface_Type;
+ #endif
+
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ extern PyTypeObject PycairoSVGSurface_Type;
+ #endif
+
+--- src/pycairo.h
++++ src/pycairo.h
+@@ -182,7 +182,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
+@@ -83,7 +83,7 @@
+ type = &PycairoPSSurface_Type;
+ break;
+ #endif
+-#if CAIRO_HAS_SVG_SURFACE
++#if PYCAIRO_ENABLE_SVG
+ case CAIRO_SURFACE_TYPE_SVG:
+ type = &PycairoSVGSurface_Type;
+ break;
+@@ -1015,7 +1015,7 @@
+
+
+ /* Class SVGSurface(Surface) ----------------------------------------------- */
+-#ifdef CAIRO_HAS_SVG_SURFACE
++#ifdef PYCAIRO_ENABLE_SVG
+ #include <cairo-svg.h>
+
+ static PyObject *
+@@ -1125,7 +1125,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.10.0-svg_check.patch b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch
new file mode 100644
index 0000000..572a5f6
--- /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/metadata.xml b/dev-python/pycairo/metadata.xml
new file mode 100644
index 0000000..5484483
--- /dev/null
+++ b/dev-python/pycairo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>binki@gentoo.org</email>
+ <name>Nathan Phillip Brink</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-python/pycairo/pycairo-1.10.0-r2.ebuild b/dev-python/pycairo/pycairo-1.10.0-r2.ebuild
new file mode 100644
index 0000000..d6c42a7
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.10.0-r2.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2012 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-r2.ebuild,v 1.7 2012/02/13 19:35:24 xarthisius 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 python waf-utils
+
+PYCAIRO_PYTHON2_VERSION="${PV}"
+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.bz2
+ http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
+ http://dev.gentoo.org/~binki/distfiles/dev-python/${PN}/${P}-waf-multilib.patch"
+
+# 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")
+
+# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
+# a function.
+unset waf-utils_waflibdir 2>/dev/null
+
+# @FUNCTION: waf-utils_waflibdir
+# @USAGE: [<waf-binary>]
+# @DESCRIPTION:
+# Echoes the absolute path to the directory containing waf-based
+# project's waflib python module. Ensures that the waflib shipped with a
+# project is unpacked if it isn't already. This waflib may be safely
+# patched because waf-lite will not touch the waflib directory when it
+# is run if it already exists. Uses the waf binary in WAF_BINARY or the
+# first argument.
+#
+# @EXAMPLE
+# @CODE
+# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# @CODE
+#
+# Note that if you are using the python eclass, you must either call
+# python_set_active_version or call waf-utils_waflibdir() from within a
+# function run by python_execute().
+#
+# @CODE
+# SUPPORT_PYTHON_ABIS=1
+# inherit python
+#
+# src_prepare() {
+# python_copy_sources
+#
+# myprepare() {
+# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch
+#
+# pushd "$(waf-utils_saflibdir "$(PYTHON)" waf)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# }
+# python_execute_function -s myprepare
+# }
+# @CODE
+waf-utils_waflibdir() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # @ECLASS-VARIABLE: WAF_BINARY
+ # @DESCRIPTION:
+ # Eclass can use different waf executable. Usually it is located in "${S}/waf".
+ : ${WAF_BINARY:="${S}/waf"}
+
+ local waf_binary=${WAF_BINARY}
+ [[ -n ${1} ]] && waf_binary=${1}
+
+ python -c "import imp, sys; sys.argv[0] = '${waf_binary}'; waflite = imp.load_source('waflite', '${waf_binary}'); print(waflite.find_lib());" \
+ || die "Unable to locate or unpack waflib module from the waf script at ${waf_binary}"
+}
+
+# When moving between the different build dirs, we want to use the waf
+# associated with each build dir.
+WAF_BINARY=./waf
+
+src_prepare() {
+
+ pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
+ popd > /dev/null
+
+ pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch"
+ popd > /dev/null
+
+ preparation() {
+ local srcdir=${WORKDIR}/${P}-${PYTHON_ABI}
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${srcdir}"
+ else
+ cp -r "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${srcdir}"
+ fi
+
+ cd "$(waf-utils_waflibdir ${srcdir}/waf)" || die "Unable to patch waflib"
+ epatch "${DISTDIR}"/${P}-waf-multilib.patch
+ }
+ python_execute_function preparation
+}
+
+src_configure() {
+ if ! use svg; then
+ export PYCAIRO_DISABLE_SVG="1"
+ fi
+
+ python_execute_function -s waf-utils_src_configure --nopyc --nopyo
+}
+
+src_compile() {
+ python_execute_function -s waf-utils_src_compile
+}
+
+src_test() {
+ test_installation() {
+ ./waf install --destdir="${T}/tests/${PYTHON_ABI}"
+ }
+ python_execute_function -q -s test_installation
+
+ python_execute_py.test -P '${T}/tests/${PYTHON_ABI}${EPREFIX}$(python_get_sitedir)' -s
+}
+
+src_install() {
+ python_execute_function -s waf-utils_src_install
+
+ 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
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/
@ 2012-11-17 10:53 Thomas Sachau
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Sachau @ 2012-11-17 10:53 UTC (permalink / raw
To: gentoo-commits
commit: ed136c30885f04206779942e1f9e5420b5ceda9f
Author: Thomas Sachau <tommy <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 17 10:53:43 2012 +0000
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Sat Nov 17 10:53:43 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/multilib-portage.git;a=commit;h=ed136c30
Sync with main tree
---
.../pycairo/files/py2cairo-1.10.0-xpyb.patch | 38 +++++
dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch | 41 +++++
dev-python/pycairo/pycairo-1.10.0-r3.ebuild | 174 ++++++++++++++++++++
3 files changed, 253 insertions(+), 0 deletions(-)
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch
new file mode 100644
index 0000000..c136cb0
--- /dev/null
+++ b/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch
@@ -0,0 +1,38 @@
+--- py2cairo-1.10.0/wscript
++++ py2cairo-1.10.0/wscript
+@@ -10,6 +10,7 @@
+ APPNAME='py2cairo'
+ VERSION='1.10.0'
+ cairo_version_required = '1.10.0'
++xpyb_version_required = '1.3'
+
+
+ def check_svg():
+@@ -23,6 +24,17 @@
+ return False
+
+
++def check_xpyb():
++ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None:
++ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb'])
++ if return_code == 0:
++ return True
++ else:
++ return False
++ else:
++ return False
++
++
+ def options(ctx):
+ print(' %s/options()' %d)
+ ctx.tool_options('gnu_dirs')
+@@ -41,6 +53,9 @@
+ ctx.check_python_headers()
+ ctx.check_cfg(package='cairo', atleast_version=cairo_version_required,
+ args='--cflags --libs')
++ if check_xpyb():
++ ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required,
++ args='--cflags --libs', mandatory=False)
+
+ # add gcc options
+ if env['CC_NAME'] == 'gcc':
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch
new file mode 100644
index 0000000..33de269
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch
@@ -0,0 +1,41 @@
+--- pycairo-1.10.0/wscript
++++ pycairo-1.10.0/wscript
+@@ -10,6 +10,7 @@
+ APPNAME='pycairo'
+ VERSION='1.10.0'
+ cairo_version_required = '1.10.0'
++xpyb_version_required = '1.3' # optional
+
+
+ def check_svg():
+@@ -23,6 +24,17 @@
+ return False
+
+
++def check_xpyb():
++ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None:
++ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb'])
++ if return_code == 0:
++ return True
++ else:
++ return False
++ else:
++ return False
++
++
+ def options(ctx):
+ print(' %s/options()' %d)
+ ctx.tool_options('gnu_dirs')
+@@ -42,6 +54,12 @@
+ ctx.check_cfg(package='cairo', atleast_version=cairo_version_required,
+ args='--cflags --libs')
+
++# xpyb for Python 3 is not available yet.
++# the Python 3 version should probably have a different name than 'xpyb'
++# if check_xpyb():
++# ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required,
++# args='--cflags --libs', mandatory=False)
++
+ # add gcc options
+ if env['CC_NAME'] == 'gcc':
+ env.append_unique('CCFLAGS', ['-std=c99', '-Wall'])
diff --git a/dev-python/pycairo/pycairo-1.10.0-r3.ebuild b/dev-python/pycairo/pycairo-1.10.0-r3.ebuild
new file mode 100644
index 0000000..5c42604
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.10.0-r3.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2012 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-r2.ebuild,v 1.7 2012/02/13 19:35:24 xarthisius Exp $
+
+EAPI="4"
+PYTHON_DEPEND="2:2.6 3:3.1"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.4 2.5 3.0 *-jython"
+
+inherit eutils python waf-utils
+
+PYCAIRO_PYTHON2_VERSION="${PV}"
+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.bz2
+ http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
+ http://dev.gentoo.org/~binki/distfiles/dev-python/${PN}/${P}-waf-multilib.patch"
+
+# 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 xcb"
+
+RDEPEND=">=x11-libs/cairo-1.10.0[svg?,xcb?]
+ xcb? ( x11-libs/xpyb )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-python/pytest )"
+
+PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
+
+# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
+# a function.
+unset waf-utils_waflibdir 2>/dev/null
+
+# @FUNCTION: waf-utils_waflibdir
+# @USAGE: [<waf-binary>]
+# @DESCRIPTION:
+# Echoes the absolute path to the directory containing waf-based
+# project's waflib python module. Ensures that the waflib shipped with a
+# project is unpacked if it isn't already. This waflib may be safely
+# patched because waf-lite will not touch the waflib directory when it
+# is run if it already exists. Uses the waf binary in WAF_BINARY or the
+# first argument.
+#
+# @EXAMPLE
+# @CODE
+# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# @CODE
+#
+# Note that if you are using the python eclass, you must either call
+# python_set_active_version or call waf-utils_waflibdir() from within a
+# function run by python_execute().
+#
+# @CODE
+# SUPPORT_PYTHON_ABIS=1
+# inherit python
+#
+# src_prepare() {
+# python_copy_sources
+#
+# myprepare() {
+# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch
+#
+# pushd "$(waf-utils_saflibdir "$(PYTHON)" waf)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# }
+# python_execute_function -s myprepare
+# }
+# @CODE
+waf-utils_waflibdir() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # @ECLASS-VARIABLE: WAF_BINARY
+ # @DESCRIPTION:
+ # Eclass can use different waf executable. Usually it is located in "${S}/waf".
+ : ${WAF_BINARY:="${S}/waf"}
+
+ local waf_binary=${WAF_BINARY}
+ [[ -n ${1} ]] && waf_binary=${1}
+
+ python -c "import imp, sys; sys.argv[0] = '${waf_binary}'; waflite = imp.load_source('waflite', '${waf_binary}'); print(waflite.find_lib());" \
+ || die "Unable to locate or unpack waflib module from the waf script at ${waf_binary}"
+}
+
+# When moving between the different build dirs, we want to use the waf
+# associated with each build dir.
+WAF_BINARY=./waf
+
+src_prepare() {
+
+ pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
+ epatch "${FILESDIR}/${PN}-1.10.0-xpyb.patch"
+ popd > /dev/null
+
+ pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch"
+ epatch "${FILESDIR}/py2cairo-1.10.0-xpyb.patch"
+ popd > /dev/null
+
+ preparation() {
+ local srcdir=${WORKDIR}/${P}-${PYTHON_ABI}
+ if [[ "${PYTHON_ABI}" == 3.* ]]; then
+ cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${srcdir}"
+ else
+ cp -r "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${srcdir}"
+ fi
+
+ cd "$(waf-utils_waflibdir ${srcdir}/waf)" || die "Unable to patch waflib"
+ epatch "${DISTDIR}"/${P}-waf-multilib.patch
+ }
+ python_execute_function preparation
+}
+
+src_configure() {
+ if ! use svg; then
+ export PYCAIRO_DISABLE_SVG=1
+ fi
+
+ if ! use xcb; then
+ export PYCAIRO_DISABLE_XPYB=1
+ fi
+
+ python_execute_function -s waf-utils_src_configure --nopyc --nopyo
+}
+
+src_compile() {
+ python_execute_function -s waf-utils_src_compile
+}
+
+src_test() {
+ test_installation() {
+ ./waf install --destdir="${T}/tests/${PYTHON_ABI}"
+ }
+ python_execute_function -q -s test_installation
+
+ python_execute_py.test -P '${T}/tests/${PYTHON_ABI}${EPREFIX}$(python_get_sitedir)' -s
+}
+
+src_install() {
+ python_execute_function -s waf-utils_src_install
+
+ 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
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/
@ 2013-02-02 16:21 Thomas Sachau
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Sachau @ 2013-02-02 16:21 UTC (permalink / raw
To: gentoo-commits
commit: 03e973d15caed0979641409ea4a72a9a7e82c5ee
Author: Thomas Sachau <tommy <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 2 16:21:17 2013 +0000
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Sat Feb 2 16:21:17 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/multilib-portage.git;a=commit;h=03e973d1
Sync pycairo with main tree
---
dev-python/pycairo/Manifest | 2 +
.../pycairo/files/py2cairo-1.10.0-ppc-darwin.patch | 18 ++
dev-python/pycairo/pycairo-1.10.0-r4.ebuild | 193 ++++++++++++++++++++
3 files changed, 213 insertions(+), 0 deletions(-)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
index 81ec4c5..d62fdad 100644
--- a/dev-python/pycairo/Manifest
+++ b/dev-python/pycairo/Manifest
@@ -1,3 +1,4 @@
+AUX py2cairo-1.10.0-ppc-darwin.patch 446 SHA256 c957cd14eb2c3fce0169a54b13665522fe1ada1af61a865903aad595afa309b1 SHA512 003e3266542242d349baa522552392aa448738f91a37ef0e6c8dedc3e0c179ca98167ab2ea7d75bd7d708f24f286099440a7a6a784767530eca161486403b033 WHIRLPOOL 0695123f4c9b3e82c22f1ba632243226d1dfe50442ea515abe440632221984c10aff233b8407a0e8dd4f594a1464c4fb7f121e43cfd0d03a2529ed1163e1a649
AUX py2cairo-1.10.0-svg_check.patch 2912 SHA256 c35d96be5be571c2f4c3415e4016a7e70a5edd6164818af80d16855e4e4efe72 SHA512 e0069738659db0fa3c0532efa7e53fed5f088ee4ce276fd6ddcfcd0ee1e8b4861a09330afe8a30bb45b912c7a93cf6e42dd6057ad7f5adabfdddeb58bc10bbe8 WHIRLPOOL 90ccae77f2641c1f9f4ad6f6497fd7912a952b7b948fe64845e8c60629d4f70c590fd33dd276c54cbc8251d45e8bd201841d7bc3fa04a37a314f1f375b8250c7
AUX py2cairo-1.10.0-xpyb.patch 952 SHA256 d6809bf00608d007f866040025392174e0cf3efe3ac03277436e00bacdcef54a SHA512 45fa1d32a8a4fc79b10e9221af286eef3f9d2c2b4991c066b1e18bd329feb764d07c4ebc58e1926ae86c4cb4a2ed0fd172f75f7479cec0be51ec5c5da6d4f13d WHIRLPOOL f8818581d471735748b546ffa0f4ac42bc5f623ae0ab383a70cf5977727ba933509497d3071aeb572e764c5e164680c16f8d476b0d8f1b7659dda7190b226cda
AUX pycairo-1.10.0-svg_check.patch 2924 SHA256 f9d2bac70bcca57c523e69403cb7332bf4ade0427998b6a3dc16730bcc17b6c7 SHA512 a05fc725c9c8ac48b262795c6c6e56b3a432f73d69657565763292f74cbd8b3d4eaabc1a5dd5db0b74cad297cc330caed271c40fbb16d459019b4c75ab33ccef WHIRLPOOL ceaf8bf26f9783bd017fbfb6b81f00ece0122d1f57ad6ae3d87f40b39d7a4bbb47bab89891f3f12357f44f26039a6c63bf46b25765fac2412bd079c6e17dd6cf
@@ -7,4 +8,5 @@ DIST pycairo-1.10.0-waf-multilib.patch 761 SHA256 8e9e081bf7b4beced282a8de265b6e
DIST pycairo-1.10.0.tar.bz2 246556 SHA256 9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be SHA512 a03db6f04cea504985f390b0734042390f491f32ae2bee1299dabbafd369fde36bb506ebb941d22bbc11b0d008c4f758baeacf309a7336880529455092db829f WHIRLPOOL e779d56d67ef18bbd052d81acb38d8b610ca4bbf787f4b0e3982633de55ff54d6dfa3e5ce1957321fba09f0ec2d12ce12057335de9d5ff3f84c2bc0530415e76
EBUILD pycairo-1.10.0-r2.ebuild 4956 SHA256 2ed5dfce4549fdb69c3dd6c2a64dd5d5b48f538bfef69c8858bb0820ac2f80db SHA512 d23987921a54ed7cd040c71b59bf51da0df4fae67dacd49bdb078770cf0021578c605a7ee6f6848560181d3701f3ac95a9b8185981180d020bd3b63d526b0572 WHIRLPOOL 862c8fd620f27c1c59d641a90ed89f96963713457b66be3dd9b9ccfb57b1ab987914419c405b3cd20ecdddd10dd01e98b9e277cb7cbccdc2555ea2fa9d22b64f
EBUILD pycairo-1.10.0-r3.ebuild 5148 SHA256 0baedcb92b4622cad90300fff428e495eec9f1cf8be6c5a6c1b70928a5f6e8a0 SHA512 47cd2e04f412c178a80a68c2c89922bf35802247857004d550fc6f349f0eec497f3b8accac6e22cc26ce57fa51c3b93d4c447d926bf8d2bf845b6eb2104587a7 WHIRLPOOL be2c40ff1f8281c725e18cee33df9ffe86e696b596b0c4c267ff9da919a8241f23945d098fbf9f6ec1ef47acb0cee31b6979bc67c01e3a92393701b62b65ff92
+EBUILD pycairo-1.10.0-r4.ebuild 5903 SHA256 4abbd80068bc96d7066718b68d738fda21f6de50af1cc01de68f96b479cca656 SHA512 506fcfde0c93c478a91797020a10fcc1508fa4dd080fb9064d3961db8b408df87589a41bbcc2c18fc274ea9bcd1e798c586798efc206f6802a9e34f8e5652422 WHIRLPOOL 7dd8ce2bf6089510c1a68ff4b3f3e302f10b66d26afc7d290ae875df8efc760acfacff7d97850677fd0477dd30f5c338d4dc20febb8b94ee8d9d01a508e3268c
MISC metadata.xml 244 SHA256 f5bde347c36c74889cbb32d29f06766c08eb3df6e0c468f00295681382c48457 SHA512 100f9b2326c73dff673bda4c5dfc0dd28bc756d80a039c1d3ac19124599a99e18b841ab28da191a79c6498c2dc157c0fed7639c855e2520cc3933f03e3de8a21 WHIRLPOOL 409c270895ffd477768bc9c329c9297c106d3f9572b84051ae66757f4d87c6f0a0b7d71aff602ff41b14400fc0afbf3990cbf1768a63f01fda6854043b66a35b
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch b/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch
new file mode 100644
index 0000000..e921ac3
--- /dev/null
+++ b/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch
@@ -0,0 +1,18 @@
+inspired by:
+http://groups.google.com/group/waf-users/browse_thread/thread/2bd6774056c850bc/
+27bfdcac2fb9ec05?lnk=gst#27bfdcac2fb9ec05
+
+we cannot "fix" the buildsystem, since it's bzip2-tarred *sigh*
+
+
+--- waf
++++ waf
+@@ -154,6 +154,8 @@
+
+ wafdir = find_lib()
+ sys.path.insert(0, wafdir)
++from waflib.Tools.c_config import MACRO_TO_DESTOS
++MACRO_TO_DESTOS['__POWERPC__'] = 'darwin'
+
+ if __name__ == '__main__':
+ import waflib.extras.compat15
diff --git a/dev-python/pycairo/pycairo-1.10.0-r4.ebuild b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild
new file mode 100644
index 0000000..cab7674
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild
@@ -0,0 +1,193 @@
+# Copyright 1999-2013 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-r4.ebuild,v 1.4 2013/01/14 17:29:27 bicatali Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python2_{6,7} python3_{1,2,3} )
+
+inherit eutils python-r1 waf-utils
+
+PYCAIRO_PYTHON2_VERSION="${PV}"
+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.bz2
+ http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
+ http://dev.gentoo.org/~binki/distfiles/dev-python/${PN}/${P}-waf-multilib.patch"
+
+# 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 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-fbsd ~ppc-macos ~x64-macos ~x86-linux ~x86-macos"
+IUSE="doc examples +svg test xcb"
+
+RDEPEND="
+ >=x11-libs/cairo-1.10.0[svg?,xcb?]
+ xcb? ( x11-libs/xpyb )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )
+"
+
+PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
+
+# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
+# a function.
+unset waf-utils_waflibdir 2>/dev/null
+
+# @FUNCTION: waf-utils_waflibdir
+# @USAGE: [<waf-binary>]
+# @DESCRIPTION:
+# Echoes the absolute path to the directory containing waf-based
+# project's waflib python module. Ensures that the waflib shipped with a
+# project is unpacked if it isn't already. This waflib may be safely
+# patched because waf-lite will not touch the waflib directory when it
+# is run if it already exists. Uses the waf binary in WAF_BINARY or the
+# first argument.
+#
+# @EXAMPLE
+# @CODE
+# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# @CODE
+#
+# Note that if you are using the python eclass, you must either call
+# python_set_active_version or call waf-utils_waflibdir() from within a
+# function run by python_execute().
+#
+# @CODE
+# SUPPORT_PYTHON_ABIS=1
+# inherit python
+#
+# src_prepare() {
+# python_copy_sources
+#
+# myprepare() {
+# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch
+#
+# pushd "$(waf-utils_saflibdir "$(PYTHON)" waf)" || die "Unable to patch waflib"
+# epatch "${FILESDIR}"/${P}-waf-fix.patch
+# popd
+# }
+# python_execute_function -s myprepare
+# }
+# @CODE
+waf-utils_waflibdir() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # @ECLASS-VARIABLE: WAF_BINARY
+ # @DESCRIPTION:
+ # Eclass can use different waf executable. Usually it is located in "${S}/waf".
+ : ${WAF_BINARY:="${S}/waf"}
+
+ local waf_binary=${WAF_BINARY}
+ [[ -n ${1} ]] && waf_binary=${1}
+
+ python -c "import imp, sys; sys.argv[0] = '${waf_binary}'; waflite = imp.load_source('waflite', '${waf_binary}'); print(waflite.find_lib());" \
+ || die "Unable to locate or unpack waflib module from the waf script at ${waf_binary}"
+}
+
+# When moving between the different build dirs, we want to use the waf
+# associated with each build dir.
+WAF_BINARY=./waf
+
+src_prepare() {
+
+ pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
+ epatch "${FILESDIR}/${PN}-1.10.0-xpyb.patch"
+ epatch "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch
+ cd "$(waf-utils_waflibdir waf)" || die "Unable to patch waflib"
+ epatch "${DISTDIR}"/${P}-waf-multilib.patch
+ popd > /dev/null
+
+ pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
+ rm -f src/config.h || die
+ epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch"
+ epatch "${FILESDIR}/py2cairo-1.10.0-xpyb.patch"
+ epatch "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch
+ cd "$(waf-utils_waflibdir waf)" || die "Unable to patch waflib"
+ epatch "${DISTDIR}"/${P}-waf-multilib.patch
+ popd > /dev/null
+
+ preparation() {
+ if [[ ${EPYTHON} == python3.* ]]; then
+ cp -r -l "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${BUILD_DIR}" || die
+ else
+ cp -r -l "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${BUILD_DIR}" || die
+ fi
+
+ }
+ python_foreach_impl preparation
+}
+
+src_configure() {
+ if ! use svg; then
+ export PYCAIRO_DISABLE_SVG=1
+ fi
+
+ if ! use xcb; then
+ export PYCAIRO_DISABLE_XPYB=1
+ fi
+
+ # Added by grobian:
+ # If WAF_BINARY is an absolute path, the configure is different and fails to
+ # find Python.h due to a compiler misconfiguration. If WAF_BINARY is just
+ # ./waf or python waf, it works fine. Hooray for reinvented buildsystems
+
+ # floppym:
+ # pycairo and py2cairo bundle different versions of waf (bug 447856)
+ WAF_BINARY="./waf"
+ python_foreach_impl run_in_build_dir waf-utils_src_configure --nopyc --nopyo
+}
+
+src_compile() {
+ python_foreach_impl run_in_build_dir waf-utils_src_compile
+}
+
+src_test() {
+ test_installation() {
+ ./waf install --destdir="${T}/tests/${BUILD_DIR}"
+ PYTHONPATH="${T}/tests/${BUILD_DIR}$(python_get_sitedir)" py.test -v
+ }
+ python_foreach_impl run_in_build_dir test_installation
+}
+
+src_install() {
+ python_foreach_impl run_in_build_dir waf-utils_src_install
+
+ dodoc AUTHORS NEWS README
+
+ if use doc; then
+ pushd doc/_build/html > /dev/null || die
+ dohtml -r [a-z]* _static
+ popd > /dev/null || die
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/*
+ fi
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names; next to waf producing dylibs (not bundles) and
+ # calling them .bundle, it also has no idea what it should do to create
+ # proper ones (dylibs)
+ fix_darwin_install_names() {
+ local x="$(python_get_sitedir)/cairo/_cairo.bundle"
+ install_name_tool -id "${x}" "${ED}${x}"
+ }
+ python_foreach_impl fix_darwin_install_names
+ fi
+}
+
+run_in_build_dir() {
+ pushd "${BUILD_DIR}" > /dev/null || die
+ "$@"
+ popd > /dev/null || die
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/
@ 2015-04-26 21:16 Thomas Sachau
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Sachau @ 2015-04-26 21:16 UTC (permalink / raw
To: gentoo-commits
commit: ee67ea8a9daea840351a640688dbfd9b5c476fc6
Author: Thomas Sachau <tommy <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 26 21:18:32 2015 +0000
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Sun Apr 26 21:18:32 2015 +0000
URL: https://gitweb.gentoo.org/proj/multilib-portage.git/commit/?id=ee67ea8a
Update pycairo, initial patch by vloo via irc
.../pycairo/files/pycairo-1.10.0-waf-unpack.patch | 12 ++
dev-python/pycairo/pycairo-1.10.0-r2.ebuild | 167 --------------------
dev-python/pycairo/pycairo-1.10.0-r3.ebuild | 174 ---------------------
dev-python/pycairo/pycairo-1.10.0-r4.ebuild | 19 ++-
4 files changed, 25 insertions(+), 347 deletions(-)
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch b/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch
new file mode 100644
index 0000000..7d54ba1
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch
@@ -0,0 +1,12 @@
+--- a/waf
++++ b/waf
+@@ -153,6 +153,9 @@
+ return dir
+
+ wafdir = find_lib()
++if sys.argv[1:] == ['unpack']:
++ print(wafdir)
++ exit()
+ sys.path.insert(0, wafdir)
+ from waflib.Tools.c_config import MACRO_TO_DESTOS
+ MACRO_TO_DESTOS['__POWERPC__'] = 'darwin'
diff --git a/dev-python/pycairo/pycairo-1.10.0-r2.ebuild b/dev-python/pycairo/pycairo-1.10.0-r2.ebuild
deleted file mode 100644
index d6c42a7..0000000
--- a/dev-python/pycairo/pycairo-1.10.0-r2.ebuild
+++ /dev/null
@@ -1,167 +0,0 @@
-# Copyright 1999-2012 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-r2.ebuild,v 1.7 2012/02/13 19:35:24 xarthisius 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 python waf-utils
-
-PYCAIRO_PYTHON2_VERSION="${PV}"
-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.bz2
- http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
- http://dev.gentoo.org/~binki/distfiles/dev-python/${PN}/${P}-waf-multilib.patch"
-
-# 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")
-
-# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
-# a function.
-unset waf-utils_waflibdir 2>/dev/null
-
-# @FUNCTION: waf-utils_waflibdir
-# @USAGE: [<waf-binary>]
-# @DESCRIPTION:
-# Echoes the absolute path to the directory containing waf-based
-# project's waflib python module. Ensures that the waflib shipped with a
-# project is unpacked if it isn't already. This waflib may be safely
-# patched because waf-lite will not touch the waflib directory when it
-# is run if it already exists. Uses the waf binary in WAF_BINARY or the
-# first argument.
-#
-# @EXAMPLE
-# @CODE
-# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib"
-# epatch "${FILESDIR}"/${P}-waf-fix.patch
-# popd
-# @CODE
-#
-# Note that if you are using the python eclass, you must either call
-# python_set_active_version or call waf-utils_waflibdir() from within a
-# function run by python_execute().
-#
-# @CODE
-# SUPPORT_PYTHON_ABIS=1
-# inherit python
-#
-# src_prepare() {
-# python_copy_sources
-#
-# myprepare() {
-# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch
-#
-# pushd "$(waf-utils_saflibdir "$(PYTHON)" waf)" || die "Unable to patch waflib"
-# epatch "${FILESDIR}"/${P}-waf-fix.patch
-# popd
-# }
-# python_execute_function -s myprepare
-# }
-# @CODE
-waf-utils_waflibdir() {
- debug-print-function ${FUNCNAME} "$@"
-
- # @ECLASS-VARIABLE: WAF_BINARY
- # @DESCRIPTION:
- # Eclass can use different waf executable. Usually it is located in "${S}/waf".
- : ${WAF_BINARY:="${S}/waf"}
-
- local waf_binary=${WAF_BINARY}
- [[ -n ${1} ]] && waf_binary=${1}
-
- python -c "import imp, sys; sys.argv[0] = '${waf_binary}'; waflite = imp.load_source('waflite', '${waf_binary}'); print(waflite.find_lib());" \
- || die "Unable to locate or unpack waflib module from the waf script at ${waf_binary}"
-}
-
-# When moving between the different build dirs, we want to use the waf
-# associated with each build dir.
-WAF_BINARY=./waf
-
-src_prepare() {
-
- pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
- rm -f src/config.h || die
- epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
- popd > /dev/null
-
- pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
- rm -f src/config.h || die
- epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch"
- popd > /dev/null
-
- preparation() {
- local srcdir=${WORKDIR}/${P}-${PYTHON_ABI}
- if [[ "${PYTHON_ABI}" == 3.* ]]; then
- cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${srcdir}"
- else
- cp -r "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${srcdir}"
- fi
-
- cd "$(waf-utils_waflibdir ${srcdir}/waf)" || die "Unable to patch waflib"
- epatch "${DISTDIR}"/${P}-waf-multilib.patch
- }
- python_execute_function preparation
-}
-
-src_configure() {
- if ! use svg; then
- export PYCAIRO_DISABLE_SVG="1"
- fi
-
- python_execute_function -s waf-utils_src_configure --nopyc --nopyo
-}
-
-src_compile() {
- python_execute_function -s waf-utils_src_compile
-}
-
-src_test() {
- test_installation() {
- ./waf install --destdir="${T}/tests/${PYTHON_ABI}"
- }
- python_execute_function -q -s test_installation
-
- python_execute_py.test -P '${T}/tests/${PYTHON_ABI}${EPREFIX}$(python_get_sitedir)' -s
-}
-
-src_install() {
- python_execute_function -s waf-utils_src_install
-
- 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
-}
diff --git a/dev-python/pycairo/pycairo-1.10.0-r3.ebuild b/dev-python/pycairo/pycairo-1.10.0-r3.ebuild
deleted file mode 100644
index 5ebe57a..0000000
--- a/dev-python/pycairo/pycairo-1.10.0-r3.ebuild
+++ /dev/null
@@ -1,174 +0,0 @@
-# Copyright 1999-2012 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-r2.ebuild,v 1.7 2012/02/13 19:35:24 xarthisius Exp $
-
-EAPI="4"
-PYTHON_DEPEND="2:2.6 3:3.1"
-SUPPORT_PYTHON_ABIS="1"
-RESTRICT_PYTHON_ABIS="2.4 2.5 3.0 *-jython"
-
-inherit eutils python waf-utils
-
-PYCAIRO_PYTHON2_VERSION="${PV}"
-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.bz2
- http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
- http://dev.gentoo.org/~binki/distfiles/dev-python/${PN}/${P}-waf-multilib.patch"
-
-# 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 xcb"
-
-RDEPEND=">=x11-libs/cairo-1.10.0[svg?,xcb?]
- xcb? ( x11-libs/xpyb )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- test? ( dev-python/pytest )"
-
-PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
-
-# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
-# a function.
-unset waf-utils_waflibdir 2>/dev/null
-
-# @FUNCTION: waf-utils_waflibdir
-# @USAGE: [<waf-binary>]
-# @DESCRIPTION:
-# Echoes the absolute path to the directory containing waf-based
-# project's waflib python module. Ensures that the waflib shipped with a
-# project is unpacked if it isn't already. This waflib may be safely
-# patched because waf-lite will not touch the waflib directory when it
-# is run if it already exists. Uses the waf binary in WAF_BINARY or the
-# first argument.
-#
-# @EXAMPLE
-# @CODE
-# pushd "$(waf-utils_waflibdir)" || die "Unable to patch waflib"
-# epatch "${FILESDIR}"/${P}-waf-fix.patch
-# popd
-# @CODE
-#
-# Note that if you are using the python eclass, you must either call
-# python_set_active_version or call waf-utils_waflibdir() from within a
-# function run by python_execute().
-#
-# @CODE
-# SUPPORT_PYTHON_ABIS=1
-# inherit python
-#
-# src_prepare() {
-# python_copy_sources
-#
-# myprepare() {
-# epatch "${FILESDIR}"/${P}-sourcecode-fix.patch
-#
-# pushd "$(waf-utils_saflibdir "$(PYTHON)" waf)" || die "Unable to patch waflib"
-# epatch "${FILESDIR}"/${P}-waf-fix.patch
-# popd
-# }
-# python_execute_function -s myprepare
-# }
-# @CODE
-waf-utils_waflibdir() {
- debug-print-function ${FUNCNAME} "$@"
-
- # @ECLASS-VARIABLE: WAF_BINARY
- # @DESCRIPTION:
- # Eclass can use different waf executable. Usually it is located in "${S}/waf".
- : ${WAF_BINARY:="${S}/waf"}
-
- local waf_binary=${WAF_BINARY}
- [[ -n ${1} ]] && waf_binary=${1}
-
- python -c "import imp, sys; sys.argv[0] = '${waf_binary}'; waflite = imp.load_source('waflite', '${waf_binary}'); print(waflite.find_lib());" \
- || die "Unable to locate or unpack waflib module from the waf script at ${waf_binary}"
-}
-
-# When moving between the different build dirs, we want to use the waf
-# associated with each build dir.
-WAF_BINARY=./waf
-
-src_prepare() {
-
- pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null
- rm -f src/config.h || die
- epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
- epatch "${FILESDIR}/${PN}-1.10.0-xpyb.patch"
- popd > /dev/null
-
- pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null
- rm -f src/config.h || die
- epatch "${FILESDIR}/py2cairo-1.10.0-svg_check.patch"
- epatch "${FILESDIR}/py2cairo-1.10.0-xpyb.patch"
- popd > /dev/null
-
- preparation() {
- local srcdir=${WORKDIR}/${P}-${PYTHON_ABI}
- if [[ "${PYTHON_ABI}" == 3.* ]]; then
- cp -r "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${srcdir}"
- else
- cp -r "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${srcdir}"
- fi
-
- cd "$(waf-utils_waflibdir ${srcdir}/waf)" || die "Unable to patch waflib"
- epatch "${DISTDIR}"/${P}-waf-multilib.patch
- }
- python_execute_function preparation
-}
-
-src_configure() {
- if ! use svg; then
- export PYCAIRO_DISABLE_SVG=1
- fi
-
- if ! use xcb; then
- export PYCAIRO_DISABLE_XPYB=1
- fi
-
- python_execute_function -s waf-utils_src_configure --nopyc --nopyo
-}
-
-src_compile() {
- python_execute_function -s waf-utils_src_compile
-}
-
-src_test() {
- test_installation() {
- ./waf install --destdir="${T}/tests/${PYTHON_ABI}"
- }
- python_execute_function -q -s test_installation
-
- python_execute_py.test -P '${T}/tests/${PYTHON_ABI}${EPREFIX}$(python_get_sitedir)' -s
-}
-
-src_install() {
- python_execute_function -s waf-utils_src_install
-
- 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
-}
diff --git a/dev-python/pycairo/pycairo-1.10.0-r4.ebuild b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild
index be59836..06b1311 100644
--- a/dev-python/pycairo/pycairo-1.10.0-r4.ebuild
+++ b/dev-python/pycairo/pycairo-1.10.0-r4.ebuild
@@ -1,9 +1,10 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 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-r4.ebuild,v 1.4 2013/01/14 17:29:27 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pycairo/pycairo-1.10.0-r4.ebuild,v 1.21 2015/04/08 08:05:21 mgorny Exp $
EAPI="5"
-PYTHON_COMPAT=( python2_{6,7} python3_{1,2,3} )
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+PYTHON_REQ_USE='threads(+)'
inherit eutils python-r1 waf-utils
@@ -35,8 +36,6 @@ DEPEND="${RDEPEND}
test? ( dev-python/pytest[${PYTHON_USEDEP}] )
"
-PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
-
# In case if waf-utils.eclass actually accepts waf-utils_waflibdir() as
# a function.
unset waf-utils_waflibdir 2>/dev/null
@@ -104,6 +103,7 @@ src_prepare() {
rm -f src/config.h || die
epatch "${FILESDIR}/${PN}-1.10.0-svg_check.patch"
epatch "${FILESDIR}/${PN}-1.10.0-xpyb.patch"
+ epatch "${FILESDIR}/${PN}-1.10.0-waf-unpack.patch"
epatch "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch
cd "$(waf-utils_waflibdir waf)" || die "Unable to patch waflib"
epatch "${DISTDIR}"/${P}-waf-multilib.patch
@@ -119,8 +119,14 @@ src_prepare() {
popd > /dev/null
preparation() {
- if [[ ${EPYTHON} == python3.* ]]; then
+ if python_is_python3; then
cp -r -l "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" "${BUILD_DIR}" || die
+ pushd "${BUILD_DIR}" > /dev/null
+ wafdir="$(./waf unpack)"
+ pushd "${wafdir}" > /dev/null
+ epatch "${FILESDIR}/${PN}-1.10.0-waf-py3_4.patch"
+ popd > /dev/null
+ popd > /dev/null
else
cp -r -l "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" "${BUILD_DIR}" || die
fi
@@ -149,6 +155,7 @@ src_configure() {
}
src_compile() {
+ MAKEOPTS="$MAKEOPTS -j1"
python_foreach_impl run_in_build_dir waf-utils_src_compile
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-26 21:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02 16:21 [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/ Thomas Sachau
-- strict thread matches above, loose matches on Subject: below --
2015-04-26 21:16 Thomas Sachau
2012-11-17 10:53 Thomas Sachau
2012-02-20 3:51 Nathan Phillip Brink
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox