Gentoo Archives: gentoo-pms

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-pms@l.g.o
Subject: [gentoo-pms] [PATCH 3/3] Move listings of ebuild functions into listing environments.
Date: Tue, 03 Nov 2015 20:03:05
Message-Id: 22073.4853.263187.901435@a1i15.kph.uni-mainz.de
In Reply to: [gentoo-pms] Some formatting changes for algorithms and listings by "Ulrich Müller"
1 ---
2 ebuild-functions.tex | 18 ++++++++++++++++++
3 1 file changed, 18 insertions(+)
4
5 diff --git a/ebuild-functions.tex b/ebuild-functions.tex
6 index 480ccda..084e866 100644
7 --- a/ebuild-functions.tex
8 +++ b/ebuild-functions.tex
9 @@ -115,6 +115,8 @@ apply patches and set up the package's build system for further use.
10 The initial working directory must be \t{WORKDIR}, and the default implementation used when
11 the ebuild lacks the \t{src\_unpack} function shall behave as:
12
13 +\begin{listing}[H]
14 +\caption{src\_unpack} \label{lst:src-unpack}
15 \begin{verbatim}
16 src_unpack() {
17 if [[ -n ${A} ]]; then
18 @@ -122,6 +124,7 @@ src_unpack() {
19 fi
20 }
21 \end{verbatim}
22 +\end{listing}
23
24 \subsection{src\_prepare}
25 \label{sec:src-prepare-function}
26 @@ -164,6 +167,8 @@ section~\ref{sec:s-to-workdir-fallback}.
27 The \t{src\_configure} function configures the package's build environment. The default
28 implementation used when the ebuild lacks the \t{src\_configure} function shall behave as:
29
30 +\begin{listing}[H]
31 +\caption{src\_configure} \label{lst:src-configure}
32 \begin{verbatim}
33 src_configure() {
34 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
35 @@ -171,6 +176,7 @@ src_configure() {
36 fi
37 }
38 \end{verbatim}
39 +\end{listing}
40
41 \ChangeWhenAddingAnEAPI{5}
42 \begin{centertable}{EAPIs supporting \t{src\_configure}} \label{tab:src-configure-table}
43 @@ -202,6 +208,8 @@ section~\ref{sec:s-to-workdir-fallback}.
44 0, the default implementation used when the ebuild lacks the \t{src\_compile} function shall behave
45 as:
46
47 +\begin{listing}[H]
48 +\caption{src\_compile, format~0} \label{lst:src-compile-0}
49 \begin{verbatim}
50 src_compile() {
51 if [[ -x ./configure ]]; then
52 @@ -212,11 +220,14 @@ src_compile() {
53 fi
54 }
55 \end{verbatim}
56 +\end{listing}
57
58 \featurelabel{src-compile-1} For EAPIs listed in table~\ref{tab:src-compile-table} as using format
59 1, the default implementation used when the ebuild lacks the \t{src\_compile} function shall behave
60 as:
61
62 +\begin{listing}[H]
63 +\caption{src\_compile, format~1} \label{lst:src-compile-1}
64 \begin{verbatim}
65 src_compile() {
66 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
67 @@ -227,11 +238,14 @@ src_compile() {
68 fi
69 }
70 \end{verbatim}
71 +\end{listing}
72
73 \featurelabel{src-compile-2} For EAPIs listed in table~\ref{tab:src-compile-table} as using format
74 2, the default implementation used when the ebuild lacks the \t{src\_compile} function shall behave
75 as:
76
77 +\begin{listing}[H]
78 +\caption{src\_compile, format~2} \label{lst:src-compile-2}
79 \begin{verbatim}
80 src_compile() {
81 if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
82 @@ -239,6 +253,7 @@ src_compile() {
83 fi
84 }
85 \end{verbatim}
86 +\end{listing}
87
88 \ChangeWhenAddingAnEAPI{5}
89 \begin{centertable}{\t{src\_compile} behaviour for EAPIs} \label{tab:src-compile-table}
90 @@ -305,6 +320,8 @@ section~\ref{sec:s-to-workdir-fallback}.
91 4, the default implementation used when the ebuild lacks the \t{src\_install} function shall behave
92 as:
93
94 +\begin{listing}[H]
95 +\caption{src\_install, format~4} \label{lst:src-install-4}
96 \begin{verbatim}
97 src_install() {
98 if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
99 @@ -324,6 +341,7 @@ src_install() {
100 fi
101 }
102 \end{verbatim}
103 +\end{listing}
104
105 For other EAPIs, the default implementation used when the ebuild lacks the \t{src\_install} function
106 is a no-op.
107 --
108 2.6.2