aboutsummaryrefslogtreecommitdiff
blob: 90f89cf7f7f275082dca00ad99016be5767ac18e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>
<guide self="ebuild-writing/functions/pkg_setup/">
<chapter>
<title>pkg_setup</title>

<body>
<table>
  <tr>
    <th>Function</th>
    <ti><c>pkg_setup</c></ti>
  </tr>
  <tr>
    <th>Purpose</th>
    <ti>Pre-build environment configuration and checks</ti>
  </tr>
  <tr>
    <th>Sandbox</th>
    <ti>Disabled</ti>
  </tr>
  <tr>
    <th>Privilege</th>
    <ti>root</ti>
  </tr>
  <tr>
    <th>Called for</th>
    <ti>ebuild, binary</ti>
  </tr>
</table>
</body>

<section>
<title>Default <c>pkg_setup</c></title>
<body>
<codesample lang="ebuild">
pkg_setup() {
	return
}
</codesample>
</body>
</section>

<section>
<title>Sample <c>pkg_setup</c></title>
<body>
<codesample lang="ebuild">
pkg_setup() {
	# We need to know which GUI we're building in several
	# different places, so work it out here.
	if use gtk ; then
		if use gtk2 ; then
			export mypkg_gui="gtk2"
		else
			export mypkg_gui="gtk1"
		fi
	elif use motif then
		export mypkg_gui="motif"
	else
		export mypkg_gui="athena"
	fi
}
</codesample>
</body>
</section>

</chapter>
</guide>