diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-python/sphinx | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-python/sphinx')
-rw-r--r-- | dev-python/sphinx/Manifest | 4 | ||||
-rw-r--r-- | dev-python/sphinx/files/sphinx-1.1.3-docutils-manpage.patch | 35 | ||||
-rw-r--r-- | dev-python/sphinx/files/sphinx-1.1.3-python3.patch | 45 | ||||
-rw-r--r-- | dev-python/sphinx/metadata.xml | 10 | ||||
-rw-r--r-- | dev-python/sphinx/sphinx-1.1.3-r7.ebuild | 127 | ||||
-rw-r--r-- | dev-python/sphinx/sphinx-1.2.2.ebuild | 123 | ||||
-rw-r--r-- | dev-python/sphinx/sphinx-1.2.3.ebuild | 125 | ||||
-rw-r--r-- | dev-python/sphinx/sphinx-1.3.1.ebuild | 130 |
8 files changed, 599 insertions, 0 deletions
diff --git a/dev-python/sphinx/Manifest b/dev-python/sphinx/Manifest new file mode 100644 index 000000000000..f2db4fd8877f --- /dev/null +++ b/dev-python/sphinx/Manifest @@ -0,0 +1,4 @@ +DIST Sphinx-1.1.3.tar.gz 2632059 SHA256 34dc95b70a2b07a61b5d61034c34b05f82514aab54ad27adedb49cee911bb8e9 SHA512 b8312140d752bf557c8e41728513812aff3e5d0a89af88dea9da0df21bf09c8315f13305d7a724a5596d0192b167d613065ea564c6d92e4ffb23f1f246dbf052 WHIRLPOOL a40c4d0f5c32cf1d4b9b662b0fb2b2b0956e0455abbc88d6b5f95c54f93cc2baae25e8b9196dd0b64090d30a1a796c336ca4b6866243be4198ccdf67a7e18b48 +DIST Sphinx-1.2.2.tar.gz 3143671 SHA256 2d3415f5b3e6b7535877f4c84fe228bdb802a8993c239b2d02c23169d67349bd SHA512 44073c215f9d0e7f6c7bc91cb85b0508a96e5cfff5f940fef86e2fc6f11281d03b54e87e51e5a99a23e96b470a93f3af86a6a3ab7c317c747406c55b4c37791c WHIRLPOOL c5ed15b51682d3be9f8349ab838c6758cb4e25023b6ad13622d748b771594ed75f786709a25fb2d61ad245ecef0925e5bcc1aafb93fc355a0f0ea50df63efcd7 +DIST Sphinx-1.2.3.tar.gz 3200548 SHA256 94933b64e2fe0807da0612c574a021c0dac28c7bd3c4a23723ae5a39ea8f3d04 SHA512 00346516e826a65145a3a7fd25ef7cee569ae7fdcc0c1bec3a7301fc08d5d8730d02eee792c3efedfcac17e712ea7e2ad70ea1fcdedc11720ad54f6bcb51ad05 WHIRLPOOL 0c0e2e21a52829893857939f977e8312c4eac11f5d2aec3b8e4f9c8ffdbf14c4aa46a6c26dac0ad4abfe92b3bdad72a3468e6d2ff2485df6efaf3fccd17ae69b +DIST Sphinx-1.3.1.tar.gz 3469782 SHA256 1a6e5130c2b42d2de301693c299f78cc4bd3501e78b610c08e45efc70e2b5114 SHA512 8b92b69c4ced242c5e608ea03a7a061b0d2908f34f3150048ff4ce08b5d56be4a642a6aec13fa249ff8208fa8dd2d38d8a10d37ebbcc68385ee51f527ede0b94 WHIRLPOOL f3e442fd1f1c260b21f3e2381f028884b6247758448439e7be4cf784f50ec12494e384c77a0c4ccac473f25d7bb88f5424be937d72bb3fac1b6f6387a5746f66 diff --git a/dev-python/sphinx/files/sphinx-1.1.3-docutils-manpage.patch b/dev-python/sphinx/files/sphinx-1.1.3-docutils-manpage.patch new file mode 100644 index 000000000000..82609f4afdca --- /dev/null +++ b/dev-python/sphinx/files/sphinx-1.1.3-docutils-manpage.patch @@ -0,0 +1,35 @@ +# HG changeset patch +# User Georg Brandl <georg@python.org> +# Date 1351590528 -3600 +# Node ID ffb145b7884fc926d6a68f4aaeede1d4964f727c +# Parent 2c107bc997e8817c451ba24089766eefb6e60fc3 +Closes #998: fix manpage writer in expectation of docutils 0.10 API change + +diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py +--- a/sphinx/writers/manpage.py ++++ b/sphinx/writers/manpage.py +@@ -72,6 +72,11 @@ + # since self.append_header() is never called, need to do this here + self.body.append(MACRO_DEF) + ++ # Overwrite admonition label translations with our own ++ for label, translation in admonitionlabels.items(): ++ self.language.labels[label] = self.deunicode(translation) ++ ++ + # overwritten -- added quotes around all .TH arguments + def header(self): + tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\"" +@@ -193,12 +198,6 @@ + def depart_seealso(self, node): + self.depart_admonition(node) + +- # overwritten -- use our own label translations +- def visit_admonition(self, node, name=None): +- if name: +- self.body.append('.IP %s\n' % +- self.deunicode(admonitionlabels.get(name, name))) +- + def visit_productionlist(self, node): + self.ensure_eol() + names = [] diff --git a/dev-python/sphinx/files/sphinx-1.1.3-python3.patch b/dev-python/sphinx/files/sphinx-1.1.3-python3.patch new file mode 100644 index 000000000000..4817034eb683 --- /dev/null +++ b/dev-python/sphinx/files/sphinx-1.1.3-python3.patch @@ -0,0 +1,45 @@ +# HG changeset patch +# User Rob Reilink <r.reilink@science-applied.nl> +# Date 1331657734 -3600 +# Node ID 8aba132b1337fc351fe1464f3a4b61f21f55e64e +# Parent 4a6d33249418befdf587603fc31db58fb863fee4 +fixed encoding for hashing functions for Python 3 + +diff -r 4a6d33249418befdf587603fc31db58fb863fee4 -r 8aba132b1337fc351fe1464f3a4b61f21f55e64e sphinx/ext/graphviz.py +--- a/sphinx/ext/graphviz.py Sat Mar 10 22:24:59 2012 +0100 ++++ b/sphinx/ext/graphviz.py Tue Mar 13 17:55:34 2012 +0100 +@@ -121,9 +121,11 @@ + + def render_dot(self, code, options, format, prefix='graphviz'): + """Render graphviz code into a PNG or PDF output file.""" +- hashkey = code.encode('utf-8') + str(options) + \ ++ hashkey = (code + str(options) + \ + str(self.builder.config.graphviz_dot) + \ + str(self.builder.config.graphviz_dot_args) ++ ).encode('utf-8') ++ + fname = '%s-%s.%s' % (prefix, sha(hashkey).hexdigest(), format) + if hasattr(self.builder, 'imgpath'): + # HTML +diff -r 4a6d33249418befdf587603fc31db58fb863fee4 -r 8aba132b1337fc351fe1464f3a4b61f21f55e64e sphinx/ext/inheritance_diagram.py +--- a/sphinx/ext/inheritance_diagram.py Sat Mar 10 22:24:59 2012 +0100 ++++ b/sphinx/ext/inheritance_diagram.py Tue Mar 13 17:55:34 2012 +0100 +@@ -39,7 +39,7 @@ + import re + import sys + import inspect +-import __builtin__ ++import __builtin__ as __builtin__ # as __builtin__ is for lib2to3 compatibility + try: + from hashlib import md5 + except ImportError: +@@ -314,7 +314,8 @@ + + + def get_graph_hash(node): +- return md5(node['content'] + str(node['parts'])).hexdigest()[-10:] ++ encoded = (node['content'] + str(node['parts'])).encode('utf-8') ++ return md5(encoded).hexdigest()[-10:] + + + def html_visit_inheritance_diagram(self, node): diff --git a/dev-python/sphinx/metadata.xml b/dev-python/sphinx/metadata.xml new file mode 100644 index 000000000000..647e8ec840ab --- /dev/null +++ b/dev-python/sphinx/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>python</herd> + <longdescription lang="en">Sphinx is a tool to create documentation for Python projects (or + other documents consisting of multiple reStructuredText sources).</longdescription> + <upstream> + <remote-id type="pypi">Sphinx</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/sphinx/sphinx-1.1.3-r7.ebuild b/dev-python/sphinx/sphinx-1.1.3-r7.ebuild new file mode 100644 index 000000000000..0c93ef42d270 --- /dev/null +++ b/dev-python/sphinx/sphinx-1.1.3-r7.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3} pypy ) + +inherit distutils-r1 eutils versionator + +MY_PN="Sphinx" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Python documentation generator" +HOMEPAGE="http://sphinx.pocoo.org/ http://pypi.python.org/pypi/Sphinx" +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 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc latex test" + +# Split the jinja dep to allow different slots to satisfy it +RDEPEND=">=dev-python/docutils-0.7[${PYTHON_USEDEP}] + >=dev-python/jinja-2.3[${PYTHON_USEDEP}] + >=dev-python/pygments-1.2[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + latex? ( + dev-texlive/texlive-latexextra + app-text/dvipng + )" +DEPEND="${DEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] )" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${P}-python3.patch + "${FILESDIR}"/${P}-docutils-manpage.patch +) + +python_compile() { + distutils-r1_python_compile + + # Generate the grammar. It will be caught by install somehow. + # Note that the tests usually do it for us. However, I don't want + # to trust USE=test really running all the tests, especially + # with FEATURES=test-fail-continue. + cd "${BUILD_DIR}"/lib || die + "${PYTHON}" -m sphinx.pycode.__init__ \ + || die "Grammar generation failed." +} + +python_compile_all() { + use doc && emake -C doc SPHINXBUILD="${PYTHON} -m sphinx.__init__" html +} + +python_test() { + cp -r -l tests "${BUILD_DIR}"/ || die + + if [[ ${EPYTHON} == python3* ]]; then + 2to3 -w --no-diffs "${BUILD_DIR}"/tests || die + fi + + nosetests -w "${BUILD_DIR}"/tests \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/_build/html/. ) + + distutils-r1_python_install_all +} + +replacing_python_eclass() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ! version_is_at_least 1.1.3-r4 ${pv}; then + return 0 + fi + done + + return 1 +} + +pkg_preinst() { + if replacing_python_eclass; then + # the old python.eclass ebuild will want to remove our pickles... + backup_pickle() { + # array to enable filename expansion + local pickle_name=( + "${D}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle + ) + + local dest=${ROOT}${pickle_name[0]#${D}}.backup + + eumask_push 022 + mkdir -p "${dest%/*}" || die + eumask_pop + + cp -p -v "${pickle_name[0]}" "${dest}" \ + || die "Unable to backup grammar pickle from overwriting" + } + + python_foreach_impl backup_pickle + fi +} + +pkg_postinst() { + if replacing_python_eclass; then + local warned + + restore_pickle() { + local backup_name=( + "${ROOT}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle.backup + ) + local dest=${backup_name[0]%.backup} + + mv -v "${backup_name[0]}" "${dest}" \ + || die "Unable to restore grammar pickle backup" + } + + python_foreach_impl restore_pickle + + [[ ${warned} ]] && ewarn "Please try rebuilding the package." + fi +} diff --git a/dev-python/sphinx/sphinx-1.2.2.ebuild b/dev-python/sphinx/sphinx-1.2.2.ebuild new file mode 100644 index 000000000000..d5ddf6c88984 --- /dev/null +++ b/dev-python/sphinx/sphinx-1.2.2.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy ) + +inherit distutils-r1 eutils versionator + +MY_PN="Sphinx" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Python documentation generator" +HOMEPAGE="http://sphinx.pocoo.org/ http://pypi.python.org/pypi/Sphinx" +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 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc latex test" + +# Split the jinja dep to allow different slots to satisfy it +RDEPEND=" + >=dev-python/docutils-0.7[${PYTHON_USEDEP}] + >=dev-python/jinja-2.3[${PYTHON_USEDEP}] + >=dev-python/pygments-1.2[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + latex? ( + dev-texlive/texlive-latexextra + app-text/dvipng + )" +DEPEND="${DEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] )" + +S="${WORKDIR}/${MY_P}" + +python_compile() { + distutils-r1_python_compile + + # Generate the grammar. It will be caught by install somehow. + # Note that the tests usually do it for us. However, I don't want + # to trust USE=test really running all the tests, especially + # with FEATURES=test-fail-continue. + pushd "${BUILD_DIR}"/lib > /dev/null || die + "${PYTHON}" -m sphinx.pycode.__init__ || die "Grammar generation failed." + popd > /dev/null || die +} + +python_compile_all() { + use doc && emake -C doc SPHINXBUILD='"${PYTHON}" "${S}/sphinx-build.py"' html +} + +python_test() { + cp -r -l tests "${BUILD_DIR}"/ || die + + if $(python_is_python3); then + 2to3 -w --no-diffs "${BUILD_DIR}"/tests || die + fi + + nosetests -w "${BUILD_DIR}"/tests -v \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/_build/html/. ) + + distutils-r1_python_install_all +} + +replacing_python_eclass() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ! version_is_at_least 1.1.3-r4 ${pv}; then + return 0 + fi + done + + return 1 +} + +pkg_preinst() { + if replacing_python_eclass; then + # the old python.eclass ebuild will want to remove our pickles... + backup_pickle() { + # array to enable filename expansion + local pickle_name=( + "${D}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle + ) + + local dest=${ROOT}${pickle_name[0]#${D}}.backup + + eumask_push 022 + mkdir -p "${dest%/*}" || die + eumask_pop + + cp -p -v "${pickle_name[0]}" "${dest}" \ + || die "Unable to backup grammar pickle from overwriting" + } + + python_foreach_impl backup_pickle + fi +} + +pkg_postinst() { + if replacing_python_eclass; then + local warned + + restore_pickle() { + local backup_name=( + "${ROOT}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle.backup + ) + local dest=${backup_name[0]%.backup} + + mv -v "${backup_name[0]}" "${dest}" \ + || die "Unable to restore grammar pickle backup" + } + + python_foreach_impl restore_pickle + + [[ ${warned} ]] && ewarn "Please try rebuilding the package." + fi +} diff --git a/dev-python/sphinx/sphinx-1.2.3.ebuild b/dev-python/sphinx/sphinx-1.2.3.ebuild new file mode 100644 index 000000000000..5079b677613b --- /dev/null +++ b/dev-python/sphinx/sphinx-1.2.3.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy pypy3 ) + +inherit distutils-r1 eutils versionator + +MY_PN="Sphinx" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Python documentation generator" +HOMEPAGE="http://sphinx.pocoo.org/ http://pypi.python.org/pypi/Sphinx" +SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc latex test" + +# Portage has only >= minimum required versions of all rdeps making +# setting of version borders unnecessary +RDEPEND=" + dev-python/docutils[${PYTHON_USEDEP}] + dev-python/jinja[${PYTHON_USEDEP}] + dev-python/pygments[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + latex? ( + dev-texlive/texlive-latexextra + app-text/dvipng + )" +DEPEND="${DEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] )" + +S="${WORKDIR}/${MY_P}" + +python_compile() { + distutils-r1_python_compile + + # Generate the grammar. It will be caught by install somehow. + # Note that the tests usually do it for us. However, I don't want + # to trust USE=test really running all the tests, especially + # with FEATURES=test-fail-continue. + pushd "${BUILD_DIR}"/lib > /dev/null || die + "${PYTHON}" -m sphinx.pycode.__init__ \ + || die "Grammar generation failed." + popd > /dev/null || die +} + +python_compile_all() { + use doc && emake -C doc SPHINXBUILD='"${PYTHON}" "${S}/sphinx-build.py"' html +} + +python_test() { + cp -r -l tests "${BUILD_DIR}"/ || die + + if $(python_is_python3); then + 2to3 -w --no-diffs "${BUILD_DIR}"/tests || die + fi + + nosetests -w "${BUILD_DIR}"/tests -v \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/_build/html/. ) + + distutils-r1_python_install_all +} + +replacing_python_eclass() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ! version_is_at_least 1.1.3-r4 ${pv}; then + return 0 + fi + done + + return 1 +} + +pkg_preinst() { + if replacing_python_eclass; then + # the old python.eclass ebuild will want to remove our pickles... + backup_pickle() { + # array to enable filename expansion + local pickle_name=( + "${D}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle + ) + + local dest=${ROOT}${pickle_name[0]#${D}}.backup + + eumask_push 022 + mkdir -p "${dest%/*}" || die + eumask_pop + + cp -p -v "${pickle_name[0]}" "${dest}" \ + || die "Unable to backup grammar pickle from overwriting" + } + + python_foreach_impl backup_pickle + fi +} + +pkg_postinst() { + if replacing_python_eclass; then + local warned + + restore_pickle() { + local backup_name=( + "${ROOT}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle.backup + ) + local dest=${backup_name[0]%.backup} + + mv -v "${backup_name[0]}" "${dest}" \ + || die "Unable to restore grammar pickle backup" + } + + python_foreach_impl restore_pickle + + [[ ${warned} ]] && ewarn "Please try rebuilding the package." + fi +} diff --git a/dev-python/sphinx/sphinx-1.3.1.ebuild b/dev-python/sphinx/sphinx-1.3.1.ebuild new file mode 100644 index 000000000000..c576038fbde0 --- /dev/null +++ b/dev-python/sphinx/sphinx-1.3.1.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy ) + +inherit distutils-r1 eutils versionator + +MY_PN="Sphinx" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="Python documentation generator" +HOMEPAGE="http://sphinx.pocoo.org/ http://pypi.python.org/pypi/Sphinx" +SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~hppa ~ppc64 ~x86" +IUSE="doc latex test" + +RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}] + >=dev-python/docutils-0.11[${PYTHON_USEDEP}] + >=dev-python/jinja-2.3[${PYTHON_USEDEP}] + >=dev-python/pygments-2.0.1-r1[${PYTHON_USEDEP}] + >=dev-python/six-1.4[${PYTHON_USEDEP}] + >=dev-python/Babel-1.3[${PYTHON_USEDEP}] + =dev-python/alabaster-0.7*[${PYTHON_USEDEP}] + =dev-python/sphinx_rtd_theme-0.1*[${PYTHON_USEDEP}] + >=dev-python/snowballstemmer-1.1[${PYTHON_USEDEP}] + latex? ( + dev-texlive/texlive-latexextra + app-text/dvipng + )" +DEPEND="${DEPEND} + test? ( dev-python/nose[${PYTHON_USEDEP}] + $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy) )" + +S="${WORKDIR}/${MY_P}" + +python_compile() { + distutils-r1_python_compile + + # Generate the grammar. It will be caught by install somehow. + # Note that the tests usually do it for us. However, I don't want + # to trust USE=test really running all the tests, especially + # with FEATURES=test-fail-continue. + pushd "${BUILD_DIR}"/lib > /dev/null || die + "${PYTHON}" -m sphinx.pycode.__init__ \ + || die "Grammar generation failed." + popd > /dev/null || die +} + +python_compile_all() { + use doc && emake -C doc SPHINXBUILD='"${PYTHON}" "${S}/sphinx-build.py"' html +} + +python_test() { + mkdir -p "${BUILD_DIR}/sphinx_tempdir" + export SPHINX_TEST_TEMPDIR="${BUILD_DIR}/sphinx_tempdir" + cp -r -l tests "${BUILD_DIR}"/ || die + + if $(python_is_python3); then + 2to3 -w --no-diffs "${BUILD_DIR}"/tests || die + fi + + nosetests -w "${BUILD_DIR}"/tests -v \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/_build/html/. ) + + distutils-r1_python_install_all +} + +replacing_python_eclass() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ! version_is_at_least 1.1.3-r4 ${pv}; then + return 0 + fi + done + + return 1 +} + +pkg_preinst() { + if replacing_python_eclass; then + # the old python.eclass ebuild will want to remove our pickles... + backup_pickle() { + # array to enable filename expansion + local pickle_name=( + "${D}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle + ) + + local dest=${ROOT}${pickle_name[0]#${D}}.backup + + eumask_push 022 + mkdir -p "${dest%/*}" || die + eumask_pop + + cp -p -v "${pickle_name[0]}" "${dest}" \ + || die "Unable to backup grammar pickle from overwriting" + } + + python_foreach_impl backup_pickle + fi +} + +pkg_postinst() { + if replacing_python_eclass; then + local warned + + restore_pickle() { + local backup_name=( + "${ROOT}$(python_get_sitedir)"/sphinx/pycode/Grammar*.pickle.backup + ) + local dest=${backup_name[0]%.backup} + + mv -v "${backup_name[0]}" "${dest}" \ + || die "Unable to restore grammar pickle backup" + } + + python_foreach_impl restore_pickle + + [[ ${warned} ]] && ewarn "Please try rebuilding the package." + fi +} |