Gentoo Archives: gentoo-python

From: IAN DELANEY <della5@×××××××××.au>
To: gentoo-python@l.g.o
Subject: Re: [gentoo-python] [PATCH distutils-r1] Support EXAMPLES for installing examples.
Date: Mon, 25 Feb 2013 08:31:40
Message-Id: 20130225163135.6bc19aa3@archtester.homenetwork
In Reply to: [gentoo-python] [PATCH distutils-r1] Support EXAMPLES for installing examples. by "Michał Górny"
1 On Sat, 16 Feb 2013 00:56:13 +0100
2 Michał Górny <mgorny@g.o> wrote:
3
4 > A lot of ebuilds is installing examples manually. In EAPI 4+ this
5 > additionally requires calling 'docompress' to disable compressing
6 > them.
7 >
8 > To make that simpler, introduce EXAMPLES aside to HTML_DOCS and DOCS.
9 > ---
10 > gx86/eclass/distutils-r1.eclass | 33
11 > +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4
12 > deletions(-)
13 >
14 > diff --git a/gx86/eclass/distutils-r1.eclass
15 > b/gx86/eclass/distutils-r1.eclass index e662fa2..f3f8f73 100644
16 > --- a/gx86/eclass/distutils-r1.eclass
17 > +++ b/gx86/eclass/distutils-r1.eclass
18 > @@ -151,7 +151,25 @@ fi
19 > #
20 > # Example:
21 > # @CODE
22 > -# HTML_DOCS=( doc/html/ )
23 > +# HTML_DOCS=( doc/html/. )
24 > +# @CODE
25 > +
26 > +# @ECLASS-VARIABLE: EXAMPLES
27 > +# @DEFAULT_UNSET
28 > +# @DESCRIPTION:
29 > +# An array containing examples installed into 'examples' doc
30 > +# subdirectory. The files and directories listed there must exist
31 > +# in the directory from which distutils-r1_python_install_all() is
32 > run +# (${S} by default).
33 > +#
34 > +# The 'examples' subdirectory will be marked not to be compressed
35 > +# automatically.
36 > +#
37 > +# If unset, no examples will be installed.
38 > +#
39 > +# Example:
40 > +# @CODE
41 > +# EXAMPLES=( examples/. demos/. )
42 > # @CODE
43 >
44 > # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
45 > @@ -487,7 +505,7 @@ distutils-r1_python_install_all() {
46 > if declare -p DOCS &>/dev/null; then
47 > # an empty list == don't install anything
48 > if [[ ${DOCS[@]} ]]; then
49 > - dodoc -r "${DOCS[@]}" || die "dodoc failed"
50 > + dodoc -r "${DOCS[@]}"
51 > fi
52 > else
53 > local f
54 > @@ -495,13 +513,20 @@ distutils-r1_python_install_all() {
55 > for f in README* ChangeLog AUTHORS NEWS TODO CHANGES
56 > \ THANKS BUGS FAQ CREDITS CHANGELOG; do
57 > if [[ -s ${f} ]]; then
58 > - dodoc "${f}" || die "(default) dodoc
59 > ${f} failed"
60 > + dodoc "${f}"
61 > fi
62 > done
63 > fi
64 >
65 > if declare -p HTML_DOCS &>/dev/null; then
66 > - dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
67 > + dohtml -r "${HTML_DOCS[@]}"
68 > + fi
69 > +
70 > + if declare -p EXAMPLES &>/dev/null; then
71 > + local DOCDESTTREE=examples
72 > + dodoc -r "${EXAMPLES[@]}"
73 > +
74 > + docompress -x /usr/share/doc/${PF}/examples
75 > fi
76 > }
77 >
78
79 yes good idea
80
81 --
82 kind regards
83
84 Ian Delaney