summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2013-04-28 16:14:34 +0000
committerPatrick McLean <chutzpah@gentoo.org>2013-04-28 16:14:34 +0000
commit7137947e817d851c7414a7b75763f90eee727478 (patch)
tree04142f899f4d0e57003b0e4f543c02ec69d2d3be /dev-python/jinja
parentFixing info regarding running with non-root flag, fixing bug #461652 (diff)
downloadgentoo-2-7137947e817d851c7414a7b75763f90eee727478.tar.gz
gentoo-2-7137947e817d851c7414a7b75763f90eee727478.tar.bz2
gentoo-2-7137947e817d851c7414a7b75763f90eee727478.zip
Revision bump, add patch to improve python 3.3 support (fixes bug #451928).
(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key 0xE3F69979BB4B8928DA78E3D17CBF44EF)
Diffstat (limited to 'dev-python/jinja')
-rw-r--r--dev-python/jinja/ChangeLog8
-rw-r--r--dev-python/jinja/files/jinja-2.6-python3.3.patch74
-rw-r--r--dev-python/jinja/jinja-2.6-r2.ebuild85
3 files changed, 166 insertions, 1 deletions
diff --git a/dev-python/jinja/ChangeLog b/dev-python/jinja/ChangeLog
index 0cd711cfbda8..e91243aed35e 100644
--- a/dev-python/jinja/ChangeLog
+++ b/dev-python/jinja/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-python/jinja
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/jinja/ChangeLog,v 1.63 2013/02/02 22:01:27 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/jinja/ChangeLog,v 1.64 2013/04/28 16:14:34 chutzpah Exp $
+
+*jinja-2.6-r2 (28 Apr 2013)
+
+ 28 Apr 2013; Patrick McLean <chutzpah@gentoo.org> +jinja-2.6-r2.ebuild,
+ +files/jinja-2.6-python3.3.patch:
+ Revision bump, add patch to improve python 3.3 support (fixes bug #451928).
02 Feb 2013; Agostino Sarubbo <ago@gentoo.org> jinja-2.6-r1.ebuild:
Stable for x86, wrt bug #454314
diff --git a/dev-python/jinja/files/jinja-2.6-python3.3.patch b/dev-python/jinja/files/jinja-2.6-python3.3.patch
new file mode 100644
index 000000000000..08155f670cd3
--- /dev/null
+++ b/dev-python/jinja/files/jinja-2.6-python3.3.patch
@@ -0,0 +1,74 @@
+diff --git a/docs/jinjaext.py b/docs/jinjaext.py
+index 12b5447..8395a55 100644
+--- a/docs/jinjaext.py
++++ b/docs/jinjaext.py
+@@ -8,6 +8,7 @@
+ :copyright: Copyright 2008 by Armin Ronacher.
+ :license: BSD.
+ """
++import collections
+ import os
+ import re
+ import inspect
+@@ -22,6 +23,7 @@ from pygments.style import Style
+ from pygments.token import Keyword, Name, Comment, String, Error, \
+ Number, Operator, Generic
+ from jinja2 import Environment, FileSystemLoader
++from jinja2.utils import next
+
+
+ def parse_rst(state, content_offset, doc):
+@@ -110,10 +112,10 @@ def dump_functions(mapping):
+ def directive(dirname, arguments, options, content, lineno,
+ content_offset, block_text, state, state_machine):
+ reverse_mapping = {}
+- for name, func in mapping.iteritems():
++ for name, func in mapping.items():
+ reverse_mapping.setdefault(func, []).append(name)
+ filters = []
+- for func, names in reverse_mapping.iteritems():
++ for func, names in reverse_mapping.items():
+ aliases = sorted(names, key=lambda x: len(x))
+ name = aliases.pop()
+ filters.append((name, aliases, func))
+@@ -145,9 +147,9 @@ def jinja_nodes(dirname, arguments, options, content, lineno,
+ doc.append(p + '.. autoclass:: %s(%s)' % (node.__name__, sig), '')
+ if node.abstract:
+ members = []
+- for key, name in node.__dict__.iteritems():
++ for key, name in node.__dict__.items():
+ if not key.startswith('_') and \
+- not hasattr(node.__base__, key) and callable(name):
++ not hasattr(node.__base__, key) and isinstance(name, collections.Callable):
+ members.append(key)
+ if members:
+ members.sort()
+@@ -169,10 +171,10 @@ def inject_toc(app, doctree, docname):
+ titleiter = iter(doctree.traverse(nodes.title))
+ try:
+ # skip first title, we are not interested in that one
+- titleiter.next()
+- title = titleiter.next()
++ next(titleiter)
++ title = next(titleiter)
+ # and check if there is at least another title
+- titleiter.next()
++ next(titleiter)
+ except StopIteration:
+ return
+ tocnode = nodes.section('')
+diff --git a/jinja2/environment.py b/jinja2/environment.py
+index ebb5454..1b5dc40 100644
+--- a/jinja2/environment.py
++++ b/jinja2/environment.py
+@@ -570,6 +570,10 @@ class Environment(object):
+ py_header = imp.get_magic() + \
+ u'\xff\xff\xff\xff'.encode('iso-8859-15')
+
++ # Python 3.3 added a source filesize to the header
++ if sys.version_info >= (3, 3):
++ py_header += u'\x00\x00\x00\x00'.encode('iso-8859-15')
++
+ def write_file(filename, data, mode):
+ if zip:
+ info = ZipInfo(filename)
diff --git a/dev-python/jinja/jinja-2.6-r2.ebuild b/dev-python/jinja/jinja-2.6-r2.ebuild
new file mode 100644
index 000000000000..fa48b01f1249
--- /dev/null
+++ b/dev-python/jinja/jinja-2.6-r2.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/jinja/jinja-2.6-r2.ebuild,v 1.1 2013/04/28 16:14:34 chutzpah Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} pypy{1_9,2_0} )
+
+inherit eutils distutils-r1
+
+MY_PN=Jinja2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="A small but fast and easy to use stand-alone template engine written in pure Python"
+HOMEPAGE="http://jinja.pocoo.org/ http://pypi.python.org/pypi/Jinja2"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris"
+IUSE="doc examples"
+
+RDEPEND="dev-python/markupsafe[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ doc? ( >=dev-python/sphinx-0.6 )"
+
+# XXX: handle Babel better?
+
+S=${WORKDIR}/${MY_P}
+
+wrap_opts() {
+ local mydistutilsargs=()
+
+ if [[ ${EPYTHON} == python* ]]; then
+ mydistutilargs+=( --with-debugsupport )
+ fi
+
+ "${@}"
+}
+
+python_prepare() {
+ epatch "${FILESDIR}"/${P}-python3.3.patch
+}
+
+python_compile() {
+ wrap_opts distutils-r1_python_compile
+}
+
+python_compile_all() {
+ if use doc; then
+ cd docs || die
+
+ if [[ ${EPYTHON} == python3* ]]; then
+ # https://github.com/mitsuhiko/jinja2/issues/115
+ 2to3 -n -w --no-diffs jinjaext.py || die
+ fi
+
+ emake html
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/_build/html/. )
+
+ distutils-r1_python_install_all
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins ext/Vim/*
+}
+
+pkg_postinst() {
+ if ! has_version dev-python/Babel; then
+ elog "For i18n support, please emerge dev-python/Babel."
+ fi
+}