1 |
commit: 65170e5755b44601f725d6c04e25ec2af3d6aba6 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 17 06:57:22 2022 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 17 06:57:22 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=65170e57 |
7 |
|
8 |
ebuild-writing/variables: Demote single variable sections to subsections |
9 |
|
10 |
Reorder subsections to follow the ordering of the tables. |
11 |
|
12 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
13 |
|
14 |
ebuild-writing/variables/text.xml | 340 +++++++++++++++++++------------------- |
15 |
1 file changed, 170 insertions(+), 170 deletions(-) |
16 |
|
17 |
diff --git a/ebuild-writing/variables/text.xml b/ebuild-writing/variables/text.xml |
18 |
index f07832e..4c7df4f 100644 |
19 |
--- a/ebuild-writing/variables/text.xml |
20 |
+++ b/ebuild-writing/variables/text.xml |
21 |
@@ -185,6 +185,57 @@ for these variables when writing ebuilds. |
22 |
</table> |
23 |
|
24 |
</body> |
25 |
+ |
26 |
+<subsection> |
27 |
+<title>ROOT</title> |
28 |
+<body> |
29 |
+ |
30 |
+<p> |
31 |
+The idea behind <c>ROOT</c> is that one can build a system with |
32 |
+<c>ROOT=/somewhere</c> and then chroot into it or tar up |
33 |
+<c>/somewhere</c> as a system image. It is not designed to allow the |
34 |
+user to run <c>/somewhere/usr/bin/foo</c>. |
35 |
+</p> |
36 |
+ |
37 |
+<p> |
38 |
+Ebuilds may reference <c>ROOT</c> only during <c>pkg_*</c> phases. It |
39 |
+can't be used correctly in <c>src_*</c> phases, since <c>ROOT</c> may |
40 |
+be different when merging a binary package. For example, a binary |
41 |
+package may be built with <c>ROOT=/</c> and then installed onto a |
42 |
+system using <c>ROOT=/somewhere</c>. |
43 |
+</p> |
44 |
+ |
45 |
+<p> |
46 |
+When building a package, <c>ROOT</c> should not be used to satisfy the |
47 |
+required dependencies on libraries, headers files etc. Instead, the |
48 |
+files on the build system should be specified using <c>/</c>. |
49 |
+</p> |
50 |
+ |
51 |
+<p> |
52 |
+In a cross compiling environment, ebuilds must not call any of the |
53 |
+binaries inside <c>ROOT</c> since they may not be executable on the |
54 |
+build system. |
55 |
+</p> |
56 |
+ |
57 |
+<p> |
58 |
+Below is an example of an ebuild that uses <c>ROOT</c> in |
59 |
+<c>pkg_postinst()</c> to conditionally print an error message if an |
60 |
+old and obsolete configuration file still exists: |
61 |
+</p> |
62 |
+ |
63 |
+<codesample lang="ebuild"> |
64 |
+pkg_postinst() { |
65 |
+ if [[ -e "${ROOT}/etc/oldconfig" ]]; then |
66 |
+ ewarn "You still have the obsolete config file " |
67 |
+ ewarn " ${ROOT}/etc/oldconfig." |
68 |
+ ewarn "Please migrate your settings to ${ROOT}/etc/newconfig" |
69 |
+ ewarn "and remove ${ROOT}/etc/oldconfig." |
70 |
+ fi |
71 |
+} |
72 |
+</codesample> |
73 |
+ |
74 |
+</body> |
75 |
+</subsection> |
76 |
</section> |
77 |
|
78 |
<section> |
79 |
@@ -348,45 +399,11 @@ The following variables may or must be defined by every ebuild. |
80 |
</table> |
81 |
|
82 |
</body> |
83 |
-</section> |
84 |
|
85 |
-<section> |
86 |
-<title>SLOT</title> |
87 |
-<body> |
88 |
- |
89 |
-<p> |
90 |
-When slots are not needed, use <c>SLOT="0"</c>. Do <b>not</b> use |
91 |
-<c>SLOT=""</c>, because the variable must not be empty. |
92 |
-</p> |
93 |
- |
94 |
-<p> |
95 |
-See <uri link="::general-concepts/slotting/" /> for more information on this |
96 |
-variable and see <uri link="::ebuild-maintenance/package-moves/" />. |
97 |
-</p> |
98 |
- |
99 |
-</body> |
100 |
-</section> |
101 |
- |
102 |
-<section> |
103 |
-<title>KEYWORDS</title> |
104 |
-<body> |
105 |
- |
106 |
-<p> |
107 |
-The only valid construct involving a <c>*</c> inside <c>KEYWORDS</c> is a <c>-*</c>. Do |
108 |
-<b>not</b> use <c>KEYWORDS="*"</c> or <c>KEYWORDS="~*"</c>. |
109 |
-</p> |
110 |
- |
111 |
-<p> |
112 |
-See <uri link="::keywording/"/> for how to handle this variable. |
113 |
-</p> |
114 |
- |
115 |
-</body> |
116 |
-</section> |
117 |
- |
118 |
-<section> |
119 |
+<subsection> |
120 |
<title>SRC_URI</title> |
121 |
|
122 |
-<subsection> |
123 |
+<subsubsection> |
124 |
<title>Conditional Sources</title> |
125 |
<body> |
126 |
|
127 |
@@ -405,9 +422,9 @@ SRC_URI="https://example.com/files/${P}-core.tar.bz2 |
128 |
</codesample> |
129 |
|
130 |
</body> |
131 |
-</subsection> |
132 |
+</subsubsection> |
133 |
|
134 |
-<subsection> |
135 |
+<subsubsection> |
136 |
<title>Renaming Sources</title> |
137 |
<body> |
138 |
|
139 |
@@ -430,9 +447,9 @@ SRC_URI="https://example.com/files/${PV}.tar.gz -> ${P}.tar.gz" |
140 |
</codesample> |
141 |
|
142 |
</body> |
143 |
-</subsection> |
144 |
+</subsubsection> |
145 |
|
146 |
-<subsection> |
147 |
+<subsubsection> |
148 |
<title>Third-party mirrors</title> |
149 |
<body> |
150 |
|
151 |
@@ -487,9 +504,9 @@ list does not outweigh the burden of maintaining it. |
152 |
</p> |
153 |
|
154 |
</body> |
155 |
-</subsection> |
156 |
+</subsubsection> |
157 |
|
158 |
-<subsection> |
159 |
+<subsubsection> |
160 |
<title>Lifting restrictions</title> |
161 |
<body> |
162 |
|
163 |
@@ -547,110 +564,161 @@ The following table shows the effects of the prefixes when <c>RESTRICT="mirror"< |
164 |
</table> |
165 |
|
166 |
</body> |
167 |
+</subsubsection> |
168 |
</subsection> |
169 |
-</section> |
170 |
|
171 |
-<section> |
172 |
-<title>IUSE</title> |
173 |
+<subsection> |
174 |
+<title>LICENSE</title> |
175 |
<body> |
176 |
|
177 |
<p> |
178 |
-Note that the <c>IUSE</c> variable is cumulative, so there is no need to specify |
179 |
-USE flags used only within inherited eclasses within the ebuild's IUSE. |
180 |
-</p> |
181 |
-<note> |
182 |
-You need not assign the IUSE variable in your ebuild if it is empty. |
183 |
-</note> |
184 |
- |
185 |
-<p> |
186 |
-Arch USE flags (<c>sparc</c>, <c>mips</c>, <c>x64-macos</c> and so on) should |
187 |
-not be listed. |
188 |
+It is possible to specify multiple <c>LICENSE</c> entries, and entries which only |
189 |
+apply if a particular <c>USE</c> flag is set. The format is the same as for |
190 |
+<c>DEPEND</c>. See <uri link="https://www.gentoo.org/glep/glep-0023.html"> |
191 |
+GLEP 23</uri> for details. |
192 |
</p> |
193 |
|
194 |
</body> |
195 |
-</section> |
196 |
+</subsection> |
197 |
|
198 |
-<section> |
199 |
-<title>LICENSE</title> |
200 |
+<subsection> |
201 |
+<title>SLOT</title> |
202 |
<body> |
203 |
|
204 |
<p> |
205 |
-It is possible to specify multiple <c>LICENSE</c> entries, and entries which only |
206 |
-apply if a particular <c>USE</c> flag is set. The format is the same as for |
207 |
-<c>DEPEND</c>. See <uri link="https://www.gentoo.org/glep/glep-0023.html"> |
208 |
-GLEP 23</uri> for details. |
209 |
+When slots are not needed, use <c>SLOT="0"</c>. Do <b>not</b> use |
210 |
+<c>SLOT=""</c>, because the variable must not be empty. |
211 |
+</p> |
212 |
+ |
213 |
+<p> |
214 |
+See <uri link="::general-concepts/slotting/" /> for more information on this |
215 |
+variable and see <uri link="::ebuild-maintenance/package-moves/" />. |
216 |
</p> |
217 |
|
218 |
</body> |
219 |
-</section> |
220 |
+</subsection> |
221 |
|
222 |
-<section> |
223 |
-<title>RESTRICT</title> |
224 |
+<subsection> |
225 |
+<title>KEYWORDS</title> |
226 |
<body> |
227 |
|
228 |
<p> |
229 |
-While Portage may recognise several different <c>RESTRICT</c> tokens, it is |
230 |
-important that you do not rely on them existing. That is, you should ensure |
231 |
-your ebuild does not fail if those tokens are not exposed or given a different |
232 |
-name by another package manager. You can make use of Portage-provided |
233 |
-<c>RESTRICT</c> tokens, but do not fail hard without them. See |
234 |
-<uri link="https://projects.gentoo.org/pms/7/pms.html#x1-810008.2.8"> |
235 |
-PMS</uri> for the list of standardised <c>RESTRICT</c> tokens, or the above |
236 |
-table. |
237 |
+The only valid construct involving a <c>*</c> inside <c>KEYWORDS</c> is a <c>-*</c>. Do |
238 |
+<b>not</b> use <c>KEYWORDS="*"</c> or <c>KEYWORDS="~*"</c>. |
239 |
+</p> |
240 |
+ |
241 |
+<p> |
242 |
+See <uri link="::keywording/"/> for how to handle this variable. |
243 |
</p> |
244 |
|
245 |
</body> |
246 |
-</section> |
247 |
+</subsection> |
248 |
|
249 |
-<section> |
250 |
-<title>ROOT</title> |
251 |
+<subsection> |
252 |
+<title>IUSE</title> |
253 |
<body> |
254 |
|
255 |
<p> |
256 |
-The idea behind <c>ROOT</c> is that one can build a system with |
257 |
-<c>ROOT=/somewhere</c> and then chroot into it or tar up |
258 |
-<c>/somewhere</c> as a system image. It is not designed to allow the |
259 |
-user to run <c>/somewhere/usr/bin/foo</c>. |
260 |
+Note that the <c>IUSE</c> variable is cumulative, so there is no need to specify |
261 |
+USE flags used only within inherited eclasses within the ebuild's IUSE. |
262 |
</p> |
263 |
+<note> |
264 |
+You need not assign the IUSE variable in your ebuild if it is empty. |
265 |
+</note> |
266 |
|
267 |
<p> |
268 |
-Ebuilds may reference <c>ROOT</c> only during <c>pkg_*</c> phases. It |
269 |
-can't be used correctly in <c>src_*</c> phases, since <c>ROOT</c> may |
270 |
-be different when merging a binary package. For example, a binary |
271 |
-package may be built with <c>ROOT=/</c> and then installed onto a |
272 |
-system using <c>ROOT=/somewhere</c>. |
273 |
+Arch USE flags (<c>sparc</c>, <c>mips</c>, <c>x64-macos</c> and so on) should |
274 |
+not be listed. |
275 |
</p> |
276 |
|
277 |
+</body> |
278 |
+</subsection> |
279 |
+ |
280 |
+<subsection> |
281 |
+<title>REQUIRED_USE</title> |
282 |
+<body> |
283 |
<p> |
284 |
-When building a package, <c>ROOT</c> should not be used to satisfy the |
285 |
-required dependencies on libraries, headers files etc. Instead, the |
286 |
-files on the build system should be specified using <c>/</c>. |
287 |
+The <c>REQUIRED_USE</c> variable contains a list of assertions that must be |
288 |
+met by the configuration of USE flags to be valid for this ebuild. In order |
289 |
+to be matched, a USE flag in a terminal element must be enabled |
290 |
+(or disabled if it has an exclamation mark prefix). |
291 |
</p> |
292 |
|
293 |
<p> |
294 |
-In a cross compiling environment, ebuilds must not call any of the |
295 |
-binaries inside <c>ROOT</c> since they may not be executable on the |
296 |
-build system. |
297 |
+Essentially, <c>REQUIRED_USE</c> is an analogue of <c>DEPEND</c> style syntax. |
298 |
+For example, to state that some combination is forbidden, i.e. "if foo is set, |
299 |
+bar must be unset": |
300 |
</p> |
301 |
|
302 |
+<codesample lang="ebuild"> |
303 |
+REQUIRED_USE="foo? ( !bar )" |
304 |
+</codesample> |
305 |
<p> |
306 |
-Below is an example of an ebuild that uses <c>ROOT</c> in |
307 |
-<c>pkg_postinst()</c> to conditionally print an error message if an |
308 |
-old and obsolete configuration file still exists: |
309 |
+To state "if foo is set, then at least one of bar, baz, and quux must be activated": |
310 |
+</p> |
311 |
+<codesample lang="ebuild"> |
312 |
+REQUIRED_USE="foo? ( || ( bar baz quux ) )" |
313 |
+</codesample> |
314 |
+<p> |
315 |
+To state "exactly one of foo, bar, or baz must be set, but not several": |
316 |
</p> |
317 |
+<codesample lang="ebuild"> |
318 |
+REQUIRED_USE="^^ ( foo bar baz )" |
319 |
+</codesample> |
320 |
+<p> |
321 |
+Note that the last relationship is that of an Exclusive OR (XOR). |
322 |
+While an XOR could be formed from usual DEPEND syntax, |
323 |
+a specific ^^ operator has been added for this case. |
324 |
+</p> |
325 |
+<p> |
326 |
+Finally, to state "at least one of foo, bar, or baz must be set": |
327 |
+</p> |
328 |
+<codesample lang="ebuild"> |
329 |
+REQUIRED_USE="|| ( foo bar baz )" |
330 |
+</codesample> |
331 |
+<important> |
332 |
+See section <uri link="::general-concepts/use-flags/#Conflicting USE Flags"/> |
333 |
+for when (and when not) to use <c>REQUIRED_USE</c>. |
334 |
+</important> |
335 |
+</body> |
336 |
|
337 |
+<subsubsection> |
338 |
+<title>EAPI 5</title> |
339 |
+<body> |
340 |
+<p> |
341 |
+EAPI 5 added an additional case to simplify conflicting USE flags. |
342 |
+</p> |
343 |
+<p> |
344 |
+To state "zero or one of foo, bar, or baz must be set, but not several": |
345 |
+</p> |
346 |
<codesample lang="ebuild"> |
347 |
-pkg_postinst() { |
348 |
- if [[ -e "${ROOT}/etc/oldconfig" ]]; then |
349 |
- ewarn "You still have the obsolete config file " |
350 |
- ewarn " ${ROOT}/etc/oldconfig." |
351 |
- ewarn "Please migrate your settings to ${ROOT}/etc/newconfig" |
352 |
- ewarn "and remove ${ROOT}/etc/oldconfig." |
353 |
- fi |
354 |
-} |
355 |
+REQUIRED_USE="?? ( foo bar baz )" |
356 |
+</codesample> |
357 |
+<p>In the previous EAPI, this would be the same as:</p> |
358 |
+<codesample lang="ebuild"> |
359 |
+REQUIRED_USE="foo? ( !bar !baz ) bar? ( !foo !baz ) baz? ( !foo !bar )" |
360 |
</codesample> |
361 |
+</body> |
362 |
+</subsubsection> |
363 |
+</subsection> |
364 |
+ |
365 |
+<subsection> |
366 |
+<title>RESTRICT</title> |
367 |
+<body> |
368 |
+ |
369 |
+<p> |
370 |
+While Portage may recognise several different <c>RESTRICT</c> tokens, it is |
371 |
+important that you do not rely on them existing. That is, you should ensure |
372 |
+your ebuild does not fail if those tokens are not exposed or given a different |
373 |
+name by another package manager. You can make use of Portage-provided |
374 |
+<c>RESTRICT</c> tokens, but do not fail hard without them. See |
375 |
+<uri link="https://projects.gentoo.org/pms/7/pms.html#x1-810008.2.8"> |
376 |
+PMS</uri> for the list of standardised <c>RESTRICT</c> tokens, or the above |
377 |
+table. |
378 |
+</p> |
379 |
|
380 |
</body> |
381 |
+</subsection> |
382 |
</section> |
383 |
|
384 |
<section> |
385 |
@@ -825,74 +893,6 @@ have no direct correlation with the expected string should be avoided. |
386 |
</body> |
387 |
</section> |
388 |
|
389 |
-<section> |
390 |
-<title>REQUIRED_USE</title> |
391 |
-<body> |
392 |
-<p> |
393 |
-The <c>REQUIRED_USE</c> variable contains a list of assertions that must be |
394 |
-met by the configuration of USE flags to be valid for this ebuild. In order |
395 |
-to be matched, a USE flag in a terminal element must be enabled |
396 |
-(or disabled if it has an exclamation mark prefix). |
397 |
-</p> |
398 |
- |
399 |
-<p> |
400 |
-Essentially, <c>REQUIRED_USE</c> is an analogue of <c>DEPEND</c> style syntax. |
401 |
-For example, to state that some combination is forbidden, i.e. "if foo is set, |
402 |
-bar must be unset": |
403 |
-</p> |
404 |
- |
405 |
-<codesample lang="ebuild"> |
406 |
-REQUIRED_USE="foo? ( !bar )" |
407 |
-</codesample> |
408 |
-<p> |
409 |
-To state "if foo is set, then at least one of bar, baz, and quux must be activated": |
410 |
-</p> |
411 |
-<codesample lang="ebuild"> |
412 |
-REQUIRED_USE="foo? ( || ( bar baz quux ) )" |
413 |
-</codesample> |
414 |
-<p> |
415 |
-To state "exactly one of foo, bar, or baz must be set, but not several": |
416 |
-</p> |
417 |
-<codesample lang="ebuild"> |
418 |
-REQUIRED_USE="^^ ( foo bar baz )" |
419 |
-</codesample> |
420 |
-<p> |
421 |
-Note that the last relationship is that of an Exclusive OR (XOR). |
422 |
-While an XOR could be formed from usual DEPEND syntax, |
423 |
-a specific ^^ operator has been added for this case. |
424 |
-</p> |
425 |
-<p> |
426 |
-Finally, to state "at least one of foo, bar, or baz must be set": |
427 |
-</p> |
428 |
-<codesample lang="ebuild"> |
429 |
-REQUIRED_USE="|| ( foo bar baz )" |
430 |
-</codesample> |
431 |
-<important> |
432 |
-See section <uri link="::general-concepts/use-flags/#Conflicting USE Flags"/> |
433 |
-for when (and when not) to use <c>REQUIRED_USE</c>. |
434 |
-</important> |
435 |
-</body> |
436 |
- |
437 |
-<subsection> |
438 |
-<title>EAPI 5</title> |
439 |
-<body> |
440 |
-<p> |
441 |
-EAPI 5 added an additional case to simplify conflicting USE flags. |
442 |
-</p> |
443 |
-<p> |
444 |
-To state "zero or one of foo, bar, or baz must be set, but not several": |
445 |
-</p> |
446 |
-<codesample lang="ebuild"> |
447 |
-REQUIRED_USE="?? ( foo bar baz )" |
448 |
-</codesample> |
449 |
-<p>In the previous EAPI, this would be the same as:</p> |
450 |
-<codesample lang="ebuild"> |
451 |
-REQUIRED_USE="foo? ( !bar !baz ) bar? ( !foo !baz ) baz? ( !foo !bar )" |
452 |
-</codesample> |
453 |
-</body> |
454 |
-</subsection> |
455 |
-</section> |
456 |
- |
457 |
<section> |
458 |
<title>User environment</title> |
459 |
<body> |