From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 039711381F3 for ; Sat, 17 Nov 2012 10:54:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 88A68E05CB; Sat, 17 Nov 2012 10:53:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E409CE05CB for ; Sat, 17 Nov 2012 10:53:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B1B4333D96B for ; Sat, 17 Nov 2012 10:53:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1053EE5436 for ; Sat, 17 Nov 2012 10:53:55 +0000 (UTC) From: "Thomas Sachau" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Sachau" Message-ID: <1353149623.ed136c30885f04206779942e1f9e5420b5ceda9f.tommy@gentoo> Subject: [gentoo-commits] proj/multilib-portage:master commit in: dev-python/pycairo/, dev-python/pycairo/files/ X-VCS-Repository: proj/multilib-portage X-VCS-Files: dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch dev-python/pycairo/pycairo-1.10.0-r3.ebuild X-VCS-Directories: dev-python/pycairo/ dev-python/pycairo/files/ X-VCS-Committer: tommy X-VCS-Committer-Name: Thomas Sachau X-VCS-Revision: ed136c30885f04206779942e1f9e5420b5ceda9f X-VCS-Branch: master Date: Sat, 17 Nov 2012 10:53:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6d0d01d8-2b40-4475-8ec6-ef8d8d0f6a35 X-Archives-Hash: 088e89c0cbafc22a6a57c90d310da782 commit: ed136c30885f04206779942e1f9e5420b5ceda9f Author: Thomas Sachau gentoo org> AuthorDate: Sat Nov 17 10:53:43 2012 +0000 Commit: Thomas Sachau gentoo 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: [] +# @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 +}