Gentoo Archives: gentoo-commits

From: Virgil Dupras <vdupras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pygments/, dev-python/pygments/files/
Date: Wed, 31 Oct 2018 02:22:29
Message-Id: 1540952306.af40b12d48b507c99b68cd41aa0bd936cbd299f0.vdupras@gentoo
1 commit: af40b12d48b507c99b68cd41aa0bd936cbd299f0
2 Author: Virgil Dupras <vdupras <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 31 02:18:26 2018 +0000
4 Commit: Virgil Dupras <vdupras <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 31 02:18:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af40b12d
7
8 dev-python/pygments: fix build with USE="doc"
9
10 Closes: https://bugs.gentoo.org/662640
11 Signed-off-by: Virgil Dupras <vdupras <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 .../pygments/files/pygments-2.2.0-sphinx17.patch | 22 +++++++++
15 dev-python/pygments/pygments-2.2.0-r1.ebuild | 55 ++++++++++++++++++++++
16 2 files changed, 77 insertions(+)
17
18 diff --git a/dev-python/pygments/files/pygments-2.2.0-sphinx17.patch b/dev-python/pygments/files/pygments-2.2.0-sphinx17.patch
19 new file mode 100644
20 index 00000000000..bb7c6074ff9
21 --- /dev/null
22 +++ b/dev-python/pygments/files/pygments-2.2.0-sphinx17.patch
23 @@ -0,0 +1,22 @@
24 +# HG changeset patch
25 +# User WAKAYAMA Shirou <shirou.faw@×××××.com>
26 +# Date 1500298269 -32400
27 +# Node ID 1a78f58afb5066cf35b04676d0d5ffbb18d5d540
28 +# Parent 7941677dc77d4f2bf0bbd6140ade85a9454b8b80
29 +Change to docutils.parsers in sphinxext.
30 +
31 +From Sphinx 1.7, sphinx.utils.compat will be removed.
32 +
33 +diff --git a/pygments/sphinxext.py b/pygments/sphinxext.py
34 +--- a/pygments/sphinxext.py
35 ++++ b/pygments/sphinxext.py
36 +@@ -16,7 +16,7 @@
37 +
38 + from docutils import nodes
39 + from docutils.statemachine import ViewList
40 +-from sphinx.util.compat import Directive
41 ++from docutils.parsers.rst import Directive
42 + from sphinx.util.nodes import nested_parse_with_titles
43 +
44 +
45 +
46
47 diff --git a/dev-python/pygments/pygments-2.2.0-r1.ebuild b/dev-python/pygments/pygments-2.2.0-r1.ebuild
48 new file mode 100644
49 index 00000000000..617820a1b61
50 --- /dev/null
51 +++ b/dev-python/pygments/pygments-2.2.0-r1.ebuild
52 @@ -0,0 +1,55 @@
53 +# Copyright 1999-2018 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=7
57 +
58 +PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy pypy3 )
59 +
60 +inherit distutils-r1 bash-completion-r1
61 +
62 +MY_PN="Pygments"
63 +MY_P="${MY_PN}-${PV}"
64 +
65 +DESCRIPTION="Pygments is a syntax highlighting package written in Python"
66 +HOMEPAGE="http://pygments.org/ https://pypi.org/project/Pygments/"
67 +SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
68 +
69 +LICENSE="BSD"
70 +SLOT="0"
71 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
72 +IUSE="doc test"
73 +
74 +RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
75 +DEPEND="${RDEPEND}
76 + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
77 + test? (
78 + dev-python/nose[${PYTHON_USEDEP}]
79 + virtual/ttf-fonts )"
80 +
81 +S="${WORKDIR}/${MY_P}"
82 +
83 +PATCHES=(
84 + # fix generators for python3.7+
85 + "${FILESDIR}"/pygments-2.2.0-pep479.patch
86 + # Fixing USE="doc" with sphinx1.7+. bug #662640
87 + "${FILESDIR}"/pygments-2.2.0-sphinx17.patch
88 +)
89 +
90 +python_compile_all() {
91 + use doc && emake -C doc html
92 +}
93 +
94 +python_test() {
95 + cp -r -l tests "${BUILD_DIR}"/ || die
96 + # With pypy3 there is 1 error out of 1556 tests when run as is and
97 + # (SKIP=8, errors=1, failures=1) when run with 2to3; meh
98 + nosetests --verbosity=3 -w "${BUILD_DIR}"/tests \
99 + || die "Tests fail with ${EPYTHON}"
100 +}
101 +
102 +python_install_all() {
103 + use doc && local HTML_DOCS=( doc/_build/html/. )
104 +
105 + distutils-r1_python_install_all
106 + newbashcomp external/pygments.bashcomp pygmentize
107 +}