Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 275551
Collapse All | Expand All

(-)ebuild-writing/functions/text.xml (-1 / +8 lines)
Lines 6-15 Link Here
6
<body>
6
<body>
7
<p>
7
<p>
8
When installing packages from source, the function call order is <c>pkg_setup</c>,
8
When installing packages from source, the function call order is <c>pkg_setup</c>,
9
<c>src_unpack</c>, <c>src_compile</c>, <c>src_test</c> (optional, <c>FEATURES="test"</c>),
9
<c>src_unpack</c>, <c>src_prepare</c>, <c>src_configure</c>, <c>src_compile</c>, 
10
<c>src_test</c> (optional, <c>FEATURES="test"</c>),
10
<c>src_install</c>, <c>pkg_preinst</c>, <c>pkg_postinst</c>. When installing packages
11
<c>src_install</c>, <c>pkg_preinst</c>, <c>pkg_postinst</c>. When installing packages
11
from a binary, the function call order is <c>pkg_setup</c>, <c>pkg_preinst</c>,
12
from a binary, the function call order is <c>pkg_setup</c>, <c>pkg_preinst</c>,
12
<c>pkg_postinst</c>.
13
<c>pkg_postinst</c>.
14
As some phases haven't been introduced from the beginning, you can have a look at
15
<uri link="::ebuild-writing/eapi"/> for an overview, what have been introduced in which EAPI.
13
</p>
16
</p>
14
17
15
<figure short="How the ebuild functions are processed" link="diagram.png"/>
18
<figure short="How the ebuild functions are processed" link="diagram.png"/>
Lines 43-51 Link Here
43
</section>
46
</section>
44
</chapter>
47
</chapter>
45
48
49
<include href="pkg_pretend/"/>
46
<include href="pkg_nofetch/"/>
50
<include href="pkg_nofetch/"/>
47
<include href="pkg_setup/"/>
51
<include href="pkg_setup/"/>
48
<include href="src_unpack/"/>
52
<include href="src_unpack/"/>
53
<include href="src_prepare/"/>
54
<include href="src_configure/"/>
49
<include href="src_compile/"/>
55
<include href="src_compile/"/>
50
<include href="src_test/"/>
56
<include href="src_test/"/>
51
<include href="src_install/"/>
57
<include href="src_install/"/>
Lines 54-57 Link Here
54
<include href="pkg_prerm/"/>
60
<include href="pkg_prerm/"/>
55
<include href="pkg_postrm/"/>
61
<include href="pkg_postrm/"/>
56
<include href="pkg_config/"/>
62
<include href="pkg_config/"/>
63
<include href="pkg_info/"/>
57
</guide>
64
</guide>
(-)ebuild-writing/functions/src_configure/text.xml (+83 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_configure/">
3
<chapter>
4
<title>src_configure</title>
5
6
<body>
7
<table>
8
  <tr>
9
    <th>Function</th>
10
    <ti><c>src_configure</c></ti>
11
  </tr>
12
  <tr>
13
    <th>Purpose</th>
14
    <ti>Configure the package.</ti>
15
  </tr>
16
  <tr>
17
    <th>Sandbox</th>
18
    <ti>Enabled</ti>
19
  </tr>
20
  <tr>
21
    <th>Privilege</th>
22
    <ti>user</ti>
23
  </tr>
24
  <tr>
25
    <th>Called for</th>
26
    <ti>ebuild</ti>
27
  </tr>
28
  <tr>
29
    <th>EAPI</th>
30
    <ti>2</ti>
31
  </tr>
32
</table>
33
</body>
34
35
<section>
36
<title>Default <c>src_configure</c></title>
37
<body>
38
<codesample lang="ebuild">
39
src_configure() {
40
	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
41
        econf
42
    fi
43
}
44
</codesample>
45
</body>
46
</section>
47
48
<section>
49
<title>Sample <c>src_configure</c></title>
50
<body>
51
<codesample lang="ebuild">
52
src_configure() {
53
    use sparc &amp;&amp; filter-flags -fomit-frame-pointer
54
    append-ldflags -Wl,-z,now
55
56
    econf \
57
        $(use_enable ssl ) \
58
        $(use_enable perl perlinterp )
59
}
60
</codesample>
61
</body>
62
</section>
63
64
<section>
65
<title><c>src_configure</c> Processes</title>
66
<body>
67
<p>
68
The following subsections cover different topics which often occur when writing
69
<c>src_configure</c> functions.
70
</p>
71
72
<contentsTree/>
73
</body>
74
</section>
75
76
</chapter>
77
78
<include href="configuring/"/>
79
<!--<include href="build-environment/"/>
80
<include href="building/"/>
81
<include href="distutils/"/>
82
<include href="no-build-system/"/>-->
83
</guide>
(-)ebuild-writing/functions/src_configure/index.html (+100 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
4
  <head>
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
    <title>Gentoo Development Guide: src_configure</title>
7
    <link rel="stylesheet" href="../../../devmanual.css" type="text/css" />
8
  </head>
9
  <body>
10
    <div class="main">
11
      <h1>Gentoo Development Guide</h1>
12
      <div class="navtop" style="text-align: center;">
13
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
14
          <col width="33%" />
15
          <col width="34%" />
16
          <col width="33%" />
17
          <tr>
18
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../src_prepare/autopackage/index.html">Autopackage</a></td>
19
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
20
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="configuring/index.html">Configuring a Package</a> →</td>
21
          </tr>
22
        </table>
23
      </div>
24
      <div class="document">
25
<h1>src_configure</h1>
26
<table>
27
  <tr>
28
    <td class="devbook"><b>Function</b></td>
29
    <td class="devbook"><code class="docutils literal"><span class="pre">src_configure</span></code></td>
30
  </tr>
31
  <tr>
32
    <td class="devbook"><b>Purpose</b></td>
33
    <td class="devbook">Configure the package.</td>
34
  </tr>
35
  <tr>
36
    <td class="devbook"><b>Sandbox</b></td>
37
    <td class="devbook">Enabled</td>
38
  </tr>
39
  <tr>
40
    <td class="devbook"><b>Privilege</b></td>
41
    <td class="devbook">user</td>
42
  </tr>
43
  <tr>
44
    <td class="devbook"><b>Called for</b></td>
45
    <td class="devbook">ebuild</td>
46
  </tr>
47
  <tr>
48
    <td class="devbook"><b>EAPI</b></td>
49
    <td class="devbook">2</td>
50
  </tr>
51
</table>
52
<div class="section"><h2><a name="default-src_configure" id="default-src_configure">Default <code class="docutils literal"><span class="pre">src_configure</span></code></a></h2>
53
<pre><span class="Constant"><span class="Special">src_configure()</span> <span class="PreProc">{</span>
54
	<span class="Statement">if</span> <span class="Statement">[[</span> -x <span class="Identifier">${ECONF_SOURCE:-.}</span>/configure <span class="Statement">]]</span> <span class="Statement">;</span> <span class="Statement">then</span>
55
        <span class="Statement">econf</span>
56
    <span class="Statement">fi</span>
57
<span class="PreProc">}</span>
58
</span></pre>
59
</div><div class="section"><h2><a name="sample-src_configure" id="sample-src_configure">Sample <code class="docutils literal"><span class="pre">src_configure</span></code></a></h2>
60
<pre><span class="Constant"><span class="Special">src_configure()</span> <span class="PreProc">{</span>
61
    <span class="Statement">use</span> sparc <span class="Statement">&amp;&amp;</span> <span class="Statement">filter-flags</span> -fomit-frame-pointer
62
    <span class="Statement">append-ldflags</span> -Wl,-z,now
63
64
    <span class="Statement">econf</span> <span class="PreProc">\</span>
65
        <span class="PreProc">$(</span><span class="Statement">use_enable</span> ssl <span class="PreProc">)</span> <span class="PreProc">\</span>
66
        <span class="PreProc">$(</span><span class="Statement">use_enable</span> perl perlinterp <span class="PreProc">)</span>
67
<span class="PreProc">}</span>
68
</span></pre>
69
</div><div class="section"><h2><a name="src_configure-processes" id="src_configure-processes"><code class="docutils literal"><span class="pre">src_configure</span></code> Processes</a></h2>
70
<p>
71
The following subsections cover different topics which often occur when writing
72
<code class="docutils literal"><span class="pre">src_configure</span></code> functions.
73
</p>
74
75
<ul><li><a class="reference" href="configuring/index.html">Configuring a Package</a></li></ul>
76
</div>
77
78
79
80
</div>
81
      <div class="navbottom" style="text-align: center;">
82
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
83
          <col width="33%" />
84
          <col width="34%" />
85
          <col width="33%" />
86
          <tr>
87
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../src_prepare/autopackage/index.html">Autopackage</a></td>
88
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
89
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="configuring/index.html">Configuring a Package</a> →</td>
90
          </tr>
91
        </table>
92
      </div>
93
    </div>
94
    <div class="footer">
95
      <p><a href="http://validator.w3.org/check/referer"><img src="/icons/icon_mini-xhtml.png" alt="Valid XHTML 1.0" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="/icons/icon_mini-css.png" alt="Valid CSS" /></a><a href="http://www.gentoo.org/"><img src="/icons/icon_mini-gentoo.png" alt="Powered by Gentoo" /></a><a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/icons/icon_mini-creativecommons.png" alt="Creative Commons License" /></a><img src="/icons/icon_mini-xml.png" alt="XML Powered!" /><br /><br />
96
	  The text of this document is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 License</a>.
97
	</p>
98
    </div>
99
  </body>
100
</html>
(-)ebuild-writing/functions/src_configure/configuring/text.xml (-11 / +5 lines)
Lines 1-5 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_compile/configuring/">
2
<guide self="ebuild-writing/functions/src_configure/configuring/">
3
<chapter>
3
<chapter>
4
<title>Configuring a Package</title>
4
<title>Configuring a Package</title>
5
5
Lines 29-51 Link Here
29
</p>
29
</p>
30
30
31
<codesample lang="ebuild">
31
<codesample lang="ebuild">
32
src_compile() {
32
src_configure() {
33
    # We have optional perl, python and ruby support
33
    # We have optional perl, python and ruby support
34
    econf \
34
    econf \
35
        $(use_enable perl ) \
35
        $(use_enable perl ) \
36
        $(use_enable python ) \
36
        $(use_enable python ) \
37
        $(use_enable ruby )
37
        $(use_enable ruby )
38
39
    # ...
40
}
38
}
41
39
42
src_compile() {
40
src_configure() {
43
    # Our package optional IPv6 support which uses --with rather than
41
    # Our package optional IPv6 support which uses --with rather than
44
    # --enable / --disable
42
    # --enable / --disable
45
43
46
    econf $(use_with ipv6 )
44
    econf $(use_with ipv6 )
47
48
    # ...
49
}
45
}
50
</codesample>
46
</codesample>
51
47
Lines 57-73 Link Here
57
</p>
53
</p>
58
54
59
<codesample lang="ebuild">
55
<codesample lang="ebuild">
60
src_compile() {
56
src_configure() {
61
    # Our package has optional perl, python and ruby support
57
    # Our package has optional perl, python and ruby support
62
    econf \
58
    econf \
63
        $(use_enable perl perlinterp ) \
59
        $(use_enable perl perlinterp ) \
64
        $(use_enable python pythoninterp ) \
60
        $(use_enable python pythoninterp ) \
65
        $(use_enable ruby rubyinterp )
61
        $(use_enable ruby rubyinterp )
66
67
    # ...
68
}
62
}
69
63
70
src_compile() {
64
src_coonfigure() {
71
    econf $(use_with X x11 )
65
    econf $(use_with X x11 )
72
}
66
}
73
</codesample>
67
</codesample>
(-)ebuild-writing/functions/src_unpack/text.xml (-4 / +4 lines)
Lines 11-17 Link Here
11
  </tr>
11
  </tr>
12
  <tr>
12
  <tr>
13
    <th>Purpose</th>
13
    <th>Purpose</th>
14
    <ti>Extract source packages and do any necessary patching or fixes.</ti>
14
    <ti>Extract source packages and do any necessary patching or fixes.<important>within EAPI=2, the patching/modifying parts of <c>src_unpack</c> have been splitted out to a new phase called <c>src_prepare</c>. see <uri link="::ebuild-writing/functions/src_prepare"/></important></ti>
15
  </tr>
15
  </tr>
16
  <tr>
16
  <tr>
17
    <th>Sandbox</th>
17
    <th>Sandbox</th>
Lines 42-48 Link Here
42
</section>
42
</section>
43
43
44
<section>
44
<section>
45
<title>Sample <c>src_unpack</c></title>
45
<title>Sample <c>src_unpack</c> for EAPI=0,1</title>
46
<body>
46
<body>
47
<codesample lang="ebuild">
47
<codesample lang="ebuild">
48
src_unpack() {
48
src_unpack() {
Lines 89-100 Link Here
89
89
90
</chapter>
90
</chapter>
91
91
92
<include href="epatch/"/>
92
<!--<include href="epatch/"/>-->
93
<include href="cvs-sources/"/>
93
<include href="cvs-sources/"/>
94
<include href="svn-sources/"/>
94
<include href="svn-sources/"/>
95
<include href="tla-sources/"/>
95
<include href="tla-sources/"/>
96
<include href="rpm-sources/"/>
96
<include href="rpm-sources/"/>
97
<include href="deb-sources/"/>
97
<include href="deb-sources/"/>
98
<include href="autopackage/"/>
98
<!--<include href="autopackage/"/>-->
99
<include href="other-formats/"/>
99
<include href="other-formats/"/>
100
</guide>
100
</guide>
(-)ebuild-writing/functions/src_unpack/autopackage/text.xml (-42 lines)
Lines 1-42 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_unpack/autopackage/">
3
<chapter>
4
<title>Autopackage</title>
5
6
<body>
7
<p>
8
If a package is only supplied in autopackage format, you must not add
9
it to the tree. If a package is supplied in autopackage format and
10
some other sane standard format (for example a source tarball), use
11
the other format only.
12
</p>
13
14
<p>
15
Autopackage packages are totally unsuitable for Gentoo systems for a
16
large number of reasons:
17
</p>
18
19
<ul>
20
  <li>
21
  To even unpack the package, you must run arbitrary code supplied by an untrusted source.
22
  </li>
23
  <li>They install directly to the live filesystem.</li>
24
  <li>Their intrinsic dependency resolver is broken.</li>
25
  <li>They do not support the filesystem layout used by Gentoo.</li>
26
  <li>They do not support configuration protection.</li>
27
  <li>They can clobber arbitrary files on uninstall.</li>
28
  <li>The linking mechanism used is insufficiently flexible.</li>
29
  <li>
30
  The entire format is completely unportable and highly tied to x86
31
  Linux systems.
32
  </li>
33
</ul>
34
35
<p>
36
Upstream are aware of these issues and have no desire to fix them <d/>
37
indeed, they pass off some of their most broken behaviour as
38
'features'.
39
</p>
40
</body>
41
</chapter>
42
</guide>
(-)ebuild-writing/functions/src_unpack/epatch/text.xml (-148 lines)
Lines 1-148 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_unpack/epatch/">
3
<chapter>
4
<title>Patching with epatch</title>
5
6
<body>
7
<p>
8
The canonical way of applying patches in ebuilds is to
9
use <c>epatch</c> (from <c>eutils.eclass</c>, which you must make sure
10
to import!) inside <c>src_unpack</c>. This function automatically
11
handles <c>-p</c> levels, <c>gunzip</c> and so on as necessary.
12
</p>
13
14
<p>
15
Note that distributing modified tarballs rather than a vanilla tarball
16
and patches is <e>highly</e> discouraged.
17
</p>
18
</body>
19
20
<section>
21
<title>Basic <c>epatch</c></title>
22
<body>
23
24
<p>
25
In its simplest form, <c>epatch</c> takes a single filename and
26
applies that patch. It will automatically <c>die</c> if the apply
27
fails. The following is taken from <c>app-misc/detox</c>:
28
</p>
29
30
<codesample lang="ebuild">
31
src_unpack() {
32
    unpack ${A}
33
    cd "${S}"
34
    epatch "${FILESDIR}/${P}-destdir.patch"
35
    epatch "${FILESDIR}/${P}-parallel_build.patch"
36
}
37
</codesample>
38
39
<p>
40
For larger patches, using <c>mirror://gentoo/</c> rather
41
than <c>files/</c> is more appropriate. In these situations, it is
42
usually best to <c>bzip2</c> the patch in question (as opposed to
43
<c>files/</c> patches, which must not be compressed). For example,
44
from <c>app-admin/showconsole</c>:
45
</p>
46
47
<codesample lang="ebuild">
48
src_unpack() {
49
    unpack ${P}.tar.bz2
50
    cd "${S}"
51
    epatch "${DISTDIR}/${P}-suse-update.patch.bz2"
52
    epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch"
53
}
54
</codesample>
55
56
<p>
57
Remember to add the patch to <c>SRC_URI</c>.
58
</p>
59
</body>
60
61
<subsection>
62
<title>CVS Keyword Lines and Patches</title>
63
<body>
64
<p>
65
If your patch includes any changes to CVS <c>$Id: $</c>
66
(or <c>$Header: $</c>, or <c>$Date: $</c>) lines, it cannot be
67
distributed under <c>files/</c>, since CVS will clobber the patch when
68
you commit. In these situations, either remove this hunk of the patch
69
manually, or mirror the file.
70
</p>
71
</body>
72
</subsection>
73
74
</section>
75
76
<section>
77
<title>Multiple Patches with <c>epatch</c></title>
78
<body>
79
80
<p>
81
epatch can also apply multiple patches (which can be selectively based
82
upon arch) from a single directory. This can be useful if upstream
83
have releases that need more patches.
84
</p>
85
86
<p>
87
A simple example:
88
</p>
89
90
<codesample lang="ebuild">
91
src_unpack() {
92
    unpack ${A}
93
    cd "${S}"
94
    EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
95
        EPATCH_FORCE="yes" epatch
96
}
97
</codesample>
98
99
<p>
100
Here, one of the <c>SRC_URI</c> components is a tarball containing
101
many patches with file extension <c>.patch</c>.
102
</p>
103
104
<p>
105
Variables which may be defined include:
106
</p>
107
108
<table>
109
  <tr>
110
    <th>Variable</th>
111
    <th>Purpose</th>
112
  </tr>
113
  <tr>
114
    <ti><c>EPATCH_SOURCE</c></ti>
115
    <ti>Specifies the directory in which epatch looks for patches.</ti>
116
  </tr>
117
  <tr>
118
    <ti><c>EPATCH_SUFFIX</c></ti>
119
    <ti>File extension for patches.</ti>
120
  </tr>
121
  <tr>
122
    <ti><c>EPATCH_OPTS</c></ti>
123
    <ti>Default options to <c>patch</c>.</ti>
124
  </tr>
125
  <tr>
126
    <ti><c>EPATCH_EXCLUDE</c></ti>
127
    <ti>List of patches to exclude.</ti>
128
  </tr>
129
  <tr>
130
    <ti><c>EPATCH_FORCE</c></ti>
131
    <ti>
132
    Force epatch to apply patches even if they do not follow the
133
    canonical naming form (set to <c>yes</c>).
134
    </ti>
135
  </tr>
136
</table>
137
138
<p>
139
Bulk patches should be named in the form
140
<c>??_${ARCH}_foo.${EPATCH_SUFFIX}</c>. If they are
141
not, <c>EPATCH_FORCE="yes"</c> must be set. To apply a patch on <c>all</c>
142
archs, use all for the <c>${ARCH}</c> part.
143
</p>
144
145
</body>
146
</section>
147
</chapter>
148
</guide>
(-)ebuild-writing/functions/pkg_info/text.xml (+67 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/pkg_info/">
3
<chapter>
4
<title>pkg_info</title>
5
6
<body>
7
<table>
8
  <tr>
9
    <th>Function</th>
10
    <ti><c>pkg_info</c></ti>
11
  </tr>
12
  <tr>
13
    <th>Purpose</th>
14
    <ti>display information about a package</ti>
15
  </tr>
16
  <tr>
17
    <th>Sandbox</th>
18
    <ti>?</ti>
19
  </tr>
20
  <tr>
21
    <th>Privilege</th>
22
    <ti>root</ti>
23
  </tr>
24
  <tr>
25
    <th>Called for</th>
26
    <ti>ebuild</ti>
27
  </tr>
28
</table>
29
</body>
30
31
<section>
32
<title>Default <c>pkg_info</c></title>
33
<body>
34
<codesample lang="ebuild">
35
pkg_info()
36
{
37
    return
38
}
39
</codesample>
40
</body>
41
</section>
42
43
<section>
44
<title>Sample <c>pkg_info</c></title>
45
<body>
46
<codesample lang="ebuild">
47
pkg_info() {
48
	"${ROOT}"/usr/bin/mythfrontend --version
49
}
50
</codesample>
51
</body>
52
</section>
53
54
<section>
55
<title>Notes on <c>pkg_info</c></title>
56
<body>
57
<p>
58
this phase will be called when a package manager displays
59
information about a package.
60
within EAPI=3, this phase can also be called for non-installed
61
packages.
62
</p>
63
</body>
64
</section>
65
66
</chapter>
67
</guide>
(-)ebuild-writing/functions/pkg_info/index.html (+87 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
4
  <head>
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
    <title>Gentoo Development Guide: pkg_info</title>
7
    <link rel="stylesheet" href="../../../devmanual.css" type="text/css" />
8
  </head>
9
  <body>
10
    <div class="main">
11
      <h1>Gentoo Development Guide</h1>
12
      <div class="navtop" style="text-align: center;">
13
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
14
          <col width="33%" />
15
          <col width="34%" />
16
          <col width="33%" />
17
          <tr>
18
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../pkg_config/index.html">pkg_config</a></td>
19
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
20
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="../../../ebuild-writing/misc-files/index.html">Miscellaneous Files</a> →</td>
21
          </tr>
22
        </table>
23
      </div>
24
      <div class="document">
25
<h1>pkg_info</h1>
26
<table>
27
  <tr>
28
    <td class="devbook"><b>Function</b></td>
29
    <td class="devbook"><code class="docutils literal"><span class="pre">pkg_info</span></code></td>
30
  </tr>
31
  <tr>
32
    <td class="devbook"><b>Purpose</b></td>
33
    <td class="devbook">display information about a package</td>
34
  </tr>
35
  <tr>
36
    <td class="devbook"><b>Sandbox</b></td>
37
    <td class="devbook">?</td>
38
  </tr>
39
  <tr>
40
    <td class="devbook"><b>Privilege</b></td>
41
    <td class="devbook">root</td>
42
  </tr>
43
  <tr>
44
    <td class="devbook"><b>Called for</b></td>
45
    <td class="devbook">ebuild</td>
46
  </tr>
47
</table>
48
<div class="section"><h2><a name="default-pkg_info" id="default-pkg_info">Default <code class="docutils literal"><span class="pre">pkg_info</span></code></a></h2>
49
<pre><span class="Constant"><span class="Special">pkg_info()</span>
50
<span class="PreProc">{</span>
51
    <span class="Statement">return</span>
52
<span class="PreProc">}</span>
53
</span></pre>
54
</div><div class="section"><h2><a name="sample-pkg_info" id="sample-pkg_info">Sample <code class="docutils literal"><span class="pre">pkg_info</span></code></a></h2>
55
<pre><span class="Constant"><span class="Special">pkg_info()</span> <span class="PreProc">{</span>
56
	<span class="Statement">"</span><span class="Identifier">${ROOT}</span><span class="Statement">"</span>/usr/bin/mythfrontend <span class="PreProc">--</span><span class="Comment">version</span>
57
<span class="PreProc">}</span>
58
</span></pre>
59
</div><div class="section"><h2><a name="notes-on-pkg_info" id="notes-on-pkg_info">Notes on <code class="docutils literal"><span class="pre">pkg_info</span></code></a></h2>
60
<p>
61
this phase will be called when a package manager displays
62
information about a package.
63
within EAPI=3, this phase can also be called for non-installed
64
packages.
65
</p>
66
</div>
67
</div>
68
      <div class="navbottom" style="text-align: center;">
69
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
70
          <col width="33%" />
71
          <col width="34%" />
72
          <col width="33%" />
73
          <tr>
74
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../pkg_config/index.html">pkg_config</a></td>
75
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
76
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="../../../ebuild-writing/misc-files/index.html">Miscellaneous Files</a> →</td>
77
          </tr>
78
        </table>
79
      </div>
80
    </div>
81
    <div class="footer">
82
      <p><a href="http://validator.w3.org/check/referer"><img src="/icons/icon_mini-xhtml.png" alt="Valid XHTML 1.0" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="/icons/icon_mini-css.png" alt="Valid CSS" /></a><a href="http://www.gentoo.org/"><img src="/icons/icon_mini-gentoo.png" alt="Powered by Gentoo" /></a><a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/icons/icon_mini-creativecommons.png" alt="Creative Commons License" /></a><img src="/icons/icon_mini-xml.png" alt="XML Powered!" /><br /><br />
83
	  The text of this document is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 License</a>.
84
	</p>
85
    </div>
86
  </body>
87
</html>
(-)ebuild-writing/functions/src_compile/text.xml (-2 / +34 lines)
Lines 11-17 Link Here
11
  </tr>
11
  </tr>
12
  <tr>
12
  <tr>
13
    <th>Purpose</th>
13
    <th>Purpose</th>
14
    <ti>Configure and build the package.</ti>
14
    <ti>Configure and build the package.<important>the configure parts of <c>src_compile</c> have been splitted out in EAPI=2 to <c>src_configure</c>. see <uri link="::ebuild-writing/functions/src_configure"/></important></ti>
15
  </tr>
15
  </tr>
16
  <tr>
16
  <tr>
17
    <th>Sandbox</th>
17
    <th>Sandbox</th>
Lines 31-36 Link Here
31
<section>
31
<section>
32
<title>Default <c>src_compile</c></title>
32
<title>Default <c>src_compile</c></title>
33
<body>
33
<body>
34
<subsection>
35
<title>with EAPI=0,1</title>
36
<body>
34
<codesample lang="ebuild">
37
<codesample lang="ebuild">
35
src_compile() {
38
src_compile() {
36
    if [ -x ./configure ]; then
39
    if [ -x ./configure ]; then
Lines 42-52 Link Here
42
}
45
}
43
</codesample>
46
</codesample>
44
</body>
47
</body>
48
</subsection>
49
<subsection>
50
<title>with EAPI=2</title>
51
<body>
52
<codesample lang="ebuild">
53
src_compile() {
54
    if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
55
        emake || die "emake failed"
56
    fi
57
}
58
</codesample>
59
</body>
60
</subsection>
61
</body>
45
</section>
62
</section>
46
63
47
<section>
64
<section>
48
<title>Sample <c>src_compile</c></title>
65
<title>Sample <c>src_compile</c></title>
49
<body>
66
<body>
67
<subsection>
68
<title>with EAPI=0</title>
69
<body>
50
<codesample lang="ebuild">
70
<codesample lang="ebuild">
51
src_compile() {
71
src_compile() {
52
    use sparc &amp;&amp; filter-flags -fomit-frame-pointer
72
    use sparc &amp;&amp; filter-flags -fomit-frame-pointer
Lines 60-65 Link Here
60
}
80
}
61
</codesample>
81
</codesample>
62
</body>
82
</body>
83
</subsection>
84
<subsection>
85
<title>with EAPI=2</title>
86
<body>
87
<p>
88
porting the above example to EAPI=2, you won't need to define an extra
89
<c>src_compile</c>, as it only calls <c>emake</c> (which is the default
90
<c>src_compile</c> function).
91
</p>
92
</body>
93
</subsection>
94
</body>
63
</section>
95
</section>
64
96
65
<section>
97
<section>
Lines 77-83 Link Here
77
</chapter>
109
</chapter>
78
110
79
<include href="build-environment/"/>
111
<include href="build-environment/"/>
80
<include href="configuring/"/>
112
<!--<include href="configuring/"/>-->
81
<include href="building/"/>
113
<include href="building/"/>
82
<include href="distutils/"/>
114
<include href="distutils/"/>
83
<include href="no-build-system/"/>
115
<include href="no-build-system/"/>
(-)ebuild-writing/functions/src_compile/configuring/text.xml (-82 lines)
Lines 1-82 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_compile/configuring/">
3
<chapter>
4
<title>Configuring a Package</title>
5
6
<body>
7
<p>
8
Many packages come with an autoconf-generated <c>./configure</c>
9
script for checking the build environment and configuring optional
10
support for libraries. The <c>econf</c> function should be used where
11
possible <d/> this will provide correct build and path specifications for
12
a Gentoo environment.
13
</p>
14
15
<p>
16
Often the configure script will try to automatically enable support
17
for optional components based upon installed packages. This
18
must <b>not</b> be allowed to happen. For example, if a user has Perl
19
installed but has <c>USE="-perl"</c>, packages with <e>optional</e>
20
Perl support must not link against Perl. This automatic detection can
21
usually be overridden using <c>--enable-</c> and <c>--disable</c>
22
or <c>--with-</c> and <c>--without-</c> switches (but note that these
23
don't always work <d/> make sure these are tested properly!).
24
</p>
25
26
<p>
27
The <c>use_enable</c> and <c>use_with</c> utility functions should,
28
where appropriate, be used to generate these switches.
29
</p>
30
31
<codesample lang="ebuild">
32
src_compile() {
33
    # We have optional perl, python and ruby support
34
    econf \
35
        $(use_enable perl ) \
36
        $(use_enable python ) \
37
        $(use_enable ruby )
38
39
    # ...
40
}
41
42
src_compile() {
43
    # Our package optional IPv6 support which uses --with rather than
44
    # --enable / --disable
45
46
    econf $(use_with ipv6 )
47
48
    # ...
49
}
50
</codesample>
51
52
<p>
53
Sometimes the package's choice of name for the option will not exactly
54
match the name or case of the <c>USE</c> flag. This is very often the
55
case with the <c>X</c> flag. For these situations, there are two
56
argument forms:
57
</p>
58
59
<codesample lang="ebuild">
60
src_compile() {
61
    # Our package has optional perl, python and ruby support
62
    econf \
63
        $(use_enable perl perlinterp ) \
64
        $(use_enable python pythoninterp ) \
65
        $(use_enable ruby rubyinterp )
66
67
    # ...
68
}
69
70
src_compile() {
71
    econf $(use_with X x11 )
72
}
73
</codesample>
74
75
<p>
76
To check for an unset <c>USE</c> flag, the <c>use_enable !flag</c>
77
form can be used.
78
</p>
79
</body>
80
81
</chapter>
82
</guide>
(-)ebuild-writing/functions/diagram.svg (-70 / +317 lines)
Lines 1-71 Link Here
1
<?xml version="1.0" standalone="no"?>
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
2
<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
<svg
4
<svg viewBox="0 100 830 80" width="830" height="80" xmlns="http://www.w3.org/2000/svg" version="1.1">
4
   xmlns:svg="http://www.w3.org/2000/svg"
5
    <desc>Ebuild Function Order</desc>
5
   xmlns="http://www.w3.org/2000/svg"
6
    <rect x="-10" y="-10" width="1000" height="1000" fill="#eeeeee" id="background" />
6
   version="1.0"
7
7
   width="1100"
8
    <rect x="10" y="110" width="80" height="30"
8
   height="80"
9
        fill="#ccccff" stroke="black" stroke-width="2" />
9
   viewBox="0 100 830 80"
10
    <text style="text-anchor: middle;" x="50" y="130">pkg_setup</text>
10
   id="svg2503">
11
11
  <defs
12
    <line x1="90" y1="125"  x2="130" y2="125" stroke-width="2" stroke="black" />
12
     id="defs2577" />
13
    <line x1="130" y1="125" x2="122" y2="120" stroke-width="2" stroke="black" />
13
  <desc
14
    <line x1="130" y1="125" x2="122" y2="130" stroke-width="2" stroke="black" />
14
     id="desc2505">Ebuild Function Order</desc>
15
15
  <rect
16
    <rect x="130" y="110" width="80" height="30"
16
     width="1100"
17
        fill="#ffffff" stroke="black" stroke-width="2" />
17
     height="1000"
18
    <text style="text-anchor: middle;" x="170" y="130">src_unpack</text>
18
     x="-135"
19
19
     y="-10"
20
    <line x1="210" y1="125" x2="250" y2="125" stroke-width="2" stroke="black" />
20
     id="background"
21
    <line x1="250" y1="125" x2="242" y2="120" stroke-width="2" stroke="black" />
21
     style="fill:#eeeeee" />
22
    <line x1="250" y1="125" x2="242" y2="130" stroke-width="2" stroke="black" />
22
  <line
23
23
     style="stroke:#000000;stroke-width:2.19613099"
24
    <rect x="250" y="110" width="80" height="30"
24
     id="line2593"
25
        fill="#ffffff" stroke="black" stroke-width="2" />
25
     y2="125"
26
    <text style="text-anchor: middle;" x="290" y="130">src_compile</text>
26
     x2="372.11496"
27
27
     y1="125"
28
    <line x1="330" y1="125" x2="370" y2="125" stroke-width="2" stroke="black" />
28
     x1="323.88504" />
29
    <line x1="370" y1="125" x2="362" y2="120" stroke-width="2" stroke="black" />
29
  <rect
30
    <line x1="370" y1="125" x2="362" y2="130" stroke-width="2" stroke="black" />
30
     width="80"
31
31
     height="30"
32
    <path d="M 330 125 Q 350 125 350 137 Q 350 150 370 150
32
     x="-115"
33
             L 450 150 Q 470 150 470 137 Q 470 125 490 125"
33
     y="110"
34
        stroke-width="2" stroke="black" fill="none" />
34
     id="rect2508"
35
35
     style="fill:#ccccff;stroke:#000000;stroke-width:2" />
36
    <rect x="370" y="110" width="80" height="30"
36
  <text
37
        fill="#ccffcc" stroke="black" stroke-width="2" />
37
     x="-75.000008"
38
    <text style="text-anchor: middle;" x="410" y="130">src_test</text>
38
     y="130"
39
39
     id="text2510"
40
    <line x1="450" y1="125" x2="490" y2="125" stroke-width="2" stroke="black" />
40
     style="text-anchor:middle">pkg_setup</text>
41
    <line x1="490" y1="125" x2="482" y2="120" stroke-width="2" stroke="black" />
41
  <g
42
    <line x1="490" y1="125" x2="482" y2="130" stroke-width="2" stroke="black" />
42
     transform="translate(-125,0)"
43
43
     id="g2599">
44
    <rect x="490" y="110" width="80" height="30"
44
    <line
45
        fill="#ffffff" stroke="black" stroke-width="2" />
45
       id="line2512"
46
    <text style="text-anchor: middle;" x="530" y="130">src_install</text>
46
       y2="125"
47
47
       x2="130"
48
    <line x1="570" y1="125" x2="610" y2="125" stroke-width="2" stroke="black" />
48
       y1="125"
49
    <line x1="610" y1="125" x2="602" y2="120" stroke-width="2" stroke="black" />
49
       x1="90"
50
    <line x1="610" y1="125" x2="602" y2="130" stroke-width="2" stroke="black" />
50
       style="stroke:#000000;stroke-width:2" />
51
51
    <line
52
    <rect x="610" y="110" width="80" height="30"
52
       id="line2514"
53
        fill="#ccccff" stroke="black" stroke-width="2" />
53
       y2="120"
54
    <text style="text-anchor: middle;" x="650" y="130">pkg_preinst</text>
54
       x2="122"
55
55
       y1="125"
56
    <line x1="690" y1="125" x2="730" y2="125" stroke-width="2" stroke="black" />
56
       x1="130"
57
    <line x1="730" y1="125" x2="722" y2="120" stroke-width="2" stroke="black" />
57
       style="stroke:#000000;stroke-width:2" />
58
    <line x1="730" y1="125" x2="722" y2="130" stroke-width="2" stroke="black" />
58
    <line
59
59
       id="line2516"
60
    <rect x="730" y="110" width="80" height="30"
60
       y2="130"
61
        fill="#ccccff" stroke="black" stroke-width="2" />
61
       x2="122"
62
    <text style="text-anchor: middle;" x="770" y="130">pkg_postinst</text>
62
       y1="125"
63
63
       x1="130"
64
    <path d="M  90 125 Q 110 125 110 142 Q 110 160 130 160
64
       style="stroke:#000000;stroke-width:2" />
65
             L 570 160 Q 590 160 590 142 Q 590 125 610 125"
65
  </g>
66
        stroke-width="2" stroke="black" fill="none" />
66
  <rect
67
67
     width="80"
68
     height="30"
69
     x="4.9999924"
70
     y="110"
71
     id="rect2518"
72
     style="fill:#ffffff;stroke:#000000;stroke-width:2" />
73
  <text
74
     x="44.999992"
75
     y="130"
76
     id="text2520"
77
     style="text-anchor:middle">src_unpack</text>
78
  <line
79
     x1="373"
80
     y1="125"
81
     x2="365"
82
     y2="120"
83
     id="line2524"
84
     style="stroke:#000000;stroke-width:2" />
85
  <line
86
     x1="373"
87
     y1="125"
88
     x2="365"
89
     y2="130"
90
     id="line2526"
91
     style="stroke:#000000;stroke-width:2" />
92
  <rect
93
     width="80"
94
     height="30"
95
     x="373"
96
     y="110"
97
     id="rect2528"
98
     style="fill:#ffffff;stroke:#000000;stroke-width:2" />
99
  <text
100
     x="413"
101
     y="130"
102
     id="text2530"
103
     style="text-anchor:middle">src_compile</text>
104
  <line
105
     x1="453"
106
     y1="125"
107
     x2="493"
108
     y2="125"
109
     id="line2532"
110
     style="stroke:#000000;stroke-width:2" />
111
  <line
112
     x1="493"
113
     y1="125"
114
     x2="485"
115
     y2="120"
116
     id="line2534"
117
     style="stroke:#000000;stroke-width:2" />
118
  <line
119
     x1="493"
120
     y1="125"
121
     x2="485"
122
     y2="130"
123
     id="line2536"
124
     style="stroke:#000000;stroke-width:2" />
125
  <path
126
     d="M 453,125 C 466.33333,125 473,129 473,137 C 473,145.66667 479.66667,150 493,150 L 573,150 C 586.33333,150 593,145.66667 593,137 C 593,129 599.66667,125 613,125"
127
     id="path2538"
128
     style="fill:none;stroke:#000000;stroke-width:2" />
129
  <rect
130
     width="80"
131
     height="30"
132
     x="493"
133
     y="110"
134
     id="rect2540"
135
     style="fill:#ccffcc;stroke:#000000;stroke-width:2" />
136
  <text
137
     x="532.99994"
138
     y="130"
139
     id="text2542"
140
     style="text-anchor:middle">src_test</text>
141
  <line
142
     x1="572.99994"
143
     y1="125"
144
     x2="612.99994"
145
     y2="125"
146
     id="line2544"
147
     style="stroke:#000000;stroke-width:2" />
148
  <line
149
     x1="612.99994"
150
     y1="125"
151
     x2="604.99994"
152
     y2="120"
153
     id="line2546"
154
     style="stroke:#000000;stroke-width:2" />
155
  <line
156
     x1="612.99994"
157
     y1="125"
158
     x2="604.99994"
159
     y2="130"
160
     id="line2548"
161
     style="stroke:#000000;stroke-width:2" />
162
  <rect
163
     width="80"
164
     height="30"
165
     x="612.99994"
166
     y="110"
167
     id="rect2550"
168
     style="fill:#ffffff;stroke:#000000;stroke-width:2" />
169
  <text
170
     x="652.99994"
171
     y="130"
172
     id="text2552"
173
     style="text-anchor:middle">src_install</text>
174
  <line
175
     x1="692.99994"
176
     y1="125"
177
     x2="732.99994"
178
     y2="125"
179
     id="line2554"
180
     style="stroke:#000000;stroke-width:2" />
181
  <line
182
     x1="732.99994"
183
     y1="125"
184
     x2="724.99994"
185
     y2="120"
186
     id="line2556"
187
     style="stroke:#000000;stroke-width:2" />
188
  <line
189
     x1="732.99994"
190
     y1="125"
191
     x2="724.99994"
192
     y2="130"
193
     id="line2558"
194
     style="stroke:#000000;stroke-width:2" />
195
  <rect
196
     width="80"
197
     height="30"
198
     x="732.99994"
199
     y="110"
200
     id="rect2560"
201
     style="fill:#ccccff;stroke:#000000;stroke-width:2" />
202
  <text
203
     x="772.99994"
204
     y="130"
205
     id="text2562"
206
     style="text-anchor:middle">pkg_preinst</text>
207
  <line
208
     x1="812.99994"
209
     y1="125"
210
     x2="852.99994"
211
     y2="125"
212
     id="line2564"
213
     style="stroke:#000000;stroke-width:2" />
214
  <line
215
     x1="852.99994"
216
     y1="125"
217
     x2="844.99994"
218
     y2="120"
219
     id="line2566"
220
     style="stroke:#000000;stroke-width:2" />
221
  <line
222
     x1="852.99994"
223
     y1="125"
224
     x2="844.99994"
225
     y2="130"
226
     id="line2568"
227
     style="stroke:#000000;stroke-width:2" />
228
  <rect
229
     width="80"
230
     height="30"
231
     x="852.99994"
232
     y="110"
233
     id="rect2570"
234
     style="fill:#ccccff;stroke:#000000;stroke-width:2" />
235
  <text
236
     x="892.99994"
237
     y="130"
238
     id="text2572"
239
     style="text-anchor:middle">pkg_postinst</text>
240
  <path
241
     d="M -34.79404,125.20597 C -15.171638,125.20597 -5.3604277,130.80594 -5.3604277,142.00588 C -5.3604277,153.86465 4.4507723,159.79403 24.073182,159.79403 L 671.61258,159.79403 C 691.23498,159.79403 701.04619,153.86465 701.04619,142.00588 C 701.04619,130.80594 710.85739,125.20597 730.4798,125.20597"
242
     id="path2574"
243
     style="fill:none;stroke:#000000;stroke-width:2.41193652" />
244
  <rect
245
     width="80"
246
     height="30"
247
     x="245"
248
     y="110"
249
     id="rect2583"
250
     style="fill:#ffffff;stroke:#000000;stroke-width:2" />
251
  <text
252
     x="286.13922"
253
     y="129.99992"
254
     id="text2585"
255
     style="text-anchor:middle">src_configure</text>
256
  <rect
257
     width="80"
258
     height="30"
259
     x="125"
260
     y="110"
261
     id="rect2587"
262
     style="fill:#ffffff;stroke:#000000;stroke-width:2" />
263
  <text
264
     x="167.51736"
265
     y="129.99992"
266
     id="text2589"
267
     style="text-anchor:middle">src_prepare</text>
268
  <g
269
     transform="translate(-5.0000077,0)"
270
     id="g2604">
271
    <line
272
       x1="90"
273
       y1="125"
274
       x2="130"
275
       y2="125"
276
       id="line2606"
277
       style="stroke:#000000;stroke-width:2" />
278
    <line
279
       x1="130"
280
       y1="125"
281
       x2="122"
282
       y2="120"
283
       id="line2608"
284
       style="stroke:#000000;stroke-width:2" />
285
    <line
286
       x1="130"
287
       y1="125"
288
       x2="122"
289
       y2="130"
290
       id="line2610"
291
       style="stroke:#000000;stroke-width:2" />
292
  </g>
293
  <g
294
     transform="translate(115,0)"
295
     id="g2612">
296
    <line
297
       style="stroke:#000000;stroke-width:2"
298
       id="line2614"
299
       y2="125"
300
       x2="130"
301
       y1="125"
302
       x1="90" />
303
    <line
304
       style="stroke:#000000;stroke-width:2"
305
       id="line2616"
306
       y2="120"
307
       x2="122"
308
       y1="125"
309
       x1="130" />
310
    <line
311
       style="stroke:#000000;stroke-width:2"
312
       id="line2618"
313
       y2="130"
314
       x2="122"
315
       y1="125"
316
       x1="130" />
317
  </g>
68
</svg>
318
</svg>
69
70
<!-- vim: set ft=xml sw=4 sts=4 et : -->
71
(-)ebuild-writing/functions/pkg_pretend/text.xml (+89 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/pkg_pretend/">
3
<chapter>
4
<title>pkg_pretend</title>
5
6
<body>
7
<table>
8
  <tr>
9
    <th>Function</th>
10
    <ti><c>pkg_pretend</c></ti>
11
  </tr>
12
  <tr>
13
    <th>Purpose</th>
14
    <ti>run sanity checks for a package during dependency calculation time</ti>
15
  </tr>
16
  <tr>
17
    <th>Sandbox</th>
18
    <ti>?</ti>
19
  </tr>
20
  <tr>
21
    <th>Privilege</th>
22
    <ti>root</ti>
23
  </tr>
24
  <tr>
25
    <th>Called for</th>
26
    <ti>ebuild</ti>
27
  </tr>
28
  <tr>
29
    <th>EAPI</th>
30
    <ti>3</ti>
31
  </tr>
32
</table>
33
</body>
34
35
<section>
36
<title>Default <c>pkg_pretend</c></title>
37
<body>
38
<codesample lang="ebuild">
39
pkg_pretend()
40
{
41
    return
42
}
43
</codesample>
44
</body>
45
</section>
46
47
<section>
48
<title>Sample <c>pkg_pretend</c></title>
49
<body>
50
<codesample lang="ebuild">
51
pkg_pretend() {
52
	if use kernel_linux ; then
53
		if [[ -e "${ROOT}"/usr/src/linux/.config ]] ; then
54
			if kernel_is lt 2 6 30 ; then
55
				CONFIG_CHECK="FUSE_FS"
56
				FUSE_FS_ERROR="this is an unrealistic testcase..."
57
				check_extra_config
58
			fi
59
		fi
60
	fi
61
}
62
</codesample>
63
</body>
64
</section>
65
66
<section>
67
<title>Notes on <c>pkg_pretend</c></title>
68
<body>
69
<p>
70
the <c>pkg_pretend</c> phase can be used to do sanity checks
71
before the main phase function sequence is run (meaning this phase is
72
executed after the package manager has calculated the dependencies
73
and before installing them).
74
This phase typically checks for a kernel configuration and may
75
<c>eerror</c> and <c>die</c> when needed.
76
<important>
77
	There is no guarantee that the ebuild's dependencies are installed
78
	when this phase is called.
79
</important>
80
<important>
81
	As <c>pkg_pretend</c> is not called in the main phase function
82
	sequence, environment saving is not guaranteed.
83
</important>
84
</p>
85
</body>
86
</section>
87
88
</chapter>
89
</guide>
(-)ebuild-writing/functions/pkg_pretend/index.html (+109 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
4
  <head>
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
    <title>Gentoo Development Guide: pkg_pretend</title>
7
    <link rel="stylesheet" href="../../../devmanual.css" type="text/css" />
8
  </head>
9
  <body>
10
    <div class="main">
11
      <h1>Gentoo Development Guide</h1>
12
      <div class="navtop" style="text-align: center;">
13
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
14
          <col width="33%" />
15
          <col width="34%" />
16
          <col width="33%" />
17
          <tr>
18
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../index.html">Ebuild Functions</a></td>
19
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
20
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="../../../ebuild-writing/functions/pkg_nofetch/index.html">pkg_nofetch</a> →</td>
21
          </tr>
22
        </table>
23
      </div>
24
      <div class="document">
25
<h1>pkg_pretend</h1>
26
<table>
27
  <tr>
28
    <td class="devbook"><b>Function</b></td>
29
    <td class="devbook"><code class="docutils literal"><span class="pre">pkg_pretend</span></code></td>
30
  </tr>
31
  <tr>
32
    <td class="devbook"><b>Purpose</b></td>
33
    <td class="devbook">run sanity checks for a package during dependency calculation time</td>
34
  </tr>
35
  <tr>
36
    <td class="devbook"><b>Sandbox</b></td>
37
    <td class="devbook">?</td>
38
  </tr>
39
  <tr>
40
    <td class="devbook"><b>Privilege</b></td>
41
    <td class="devbook">root</td>
42
  </tr>
43
  <tr>
44
    <td class="devbook"><b>Called for</b></td>
45
    <td class="devbook">ebuild</td>
46
  </tr>
47
  <tr>
48
    <td class="devbook"><b>EAPI</b></td>
49
    <td class="devbook">3</td>
50
  </tr>
51
</table>
52
<div class="section"><h2><a name="default-pkg_pretend" id="default-pkg_pretend">Default <code class="docutils literal"><span class="pre">pkg_pretend</span></code></a></h2>
53
<pre><span class="Constant"><span class="Special">pkg_pretend()</span>
54
<span class="PreProc">{</span>
55
    <span class="Statement">return</span>
56
<span class="PreProc">}</span>
57
</span></pre>
58
</div><div class="section"><h2><a name="sample-pkg_pretend" id="sample-pkg_pretend">Sample <code class="docutils literal"><span class="pre">pkg_pretend</span></code></a></h2>
59
<pre><span class="Constant"><span class="Special">pkg_pretend()</span> <span class="PreProc">{</span>
60
	<span class="Statement">if</span> <span class="Statement">use</span> kernel_linux <span class="Statement">;</span> <span class="Statement">then</span>
61
		<span class="Statement">if</span> <span class="Statement">[[</span> -e <span class="Statement">"</span><span class="Identifier">${ROOT}</span><span class="Statement">"</span>/usr/src/linux/.config <span class="Statement">]]</span> <span class="Statement">;</span> <span class="Statement">then</span>
62
			<span class="Statement">if</span> kernel_is lt 2 6 30 <span class="Statement">;</span> <span class="Statement">then</span>
63
				<span class="Identifier">CONFIG_CHECK</span><span class="Constant">=</span><span class="Statement">"</span>FUSE_FS<span class="Statement">"</span>
64
				<span class="Identifier">FUSE_FS_ERROR</span><span class="Constant">=</span><span class="Statement">"</span>this is an unrealistic testcase...<span class="Statement">"</span>
65
				check_extra_config
66
			<span class="Statement">fi</span>
67
		<span class="Statement">fi</span>
68
	<span class="Statement">fi</span>
69
<span class="PreProc">}</span>
70
</span></pre>
71
</div><div class="section"><h2><a name="notes-on-pkg_pretend" id="notes-on-pkg_pretend">Notes on <code class="docutils literal"><span class="pre">pkg_pretend</span></code></a></h2>
72
<p>
73
the <code class="docutils literal"><span class="pre">pkg_pretend</span></code> phase can be used to do sanity checks
74
before the main phase function sequence is run (meaning this phase is
75
executed after the package manager has calculated the dependencies
76
and before installing them).
77
This phase typically checks for a kernel configuration and may
78
<code class="docutils literal"><span class="pre">eerror</span></code> and <code class="docutils literal"><span class="pre">die</span></code> when needed.
79
<div class="important"><p class="first admonition-title">Important</p><p class="last">
80
	There is no guarantee that the ebuild's dependencies are installed
81
	when this phase is called.
82
</p></div>
83
<div class="important"><p class="first admonition-title">Important</p><p class="last">
84
	As <code class="docutils literal"><span class="pre">pkg_pretend</span></code> is not called in the main phase function
85
	sequence, environment saving is not guaranteed.
86
</p></div>
87
</p>
88
</div>
89
</div>
90
      <div class="navbottom" style="text-align: center;">
91
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
92
          <col width="33%" />
93
          <col width="34%" />
94
          <col width="33%" />
95
          <tr>
96
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../index.html">Ebuild Functions</a></td>
97
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
98
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="../../../ebuild-writing/functions/pkg_nofetch/index.html">pkg_nofetch</a> →</td>
99
          </tr>
100
        </table>
101
      </div>
102
    </div>
103
    <div class="footer">
104
      <p><a href="http://validator.w3.org/check/referer"><img src="/icons/icon_mini-xhtml.png" alt="Valid XHTML 1.0" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="/icons/icon_mini-css.png" alt="Valid CSS" /></a><a href="http://www.gentoo.org/"><img src="/icons/icon_mini-gentoo.png" alt="Powered by Gentoo" /></a><a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/icons/icon_mini-creativecommons.png" alt="Creative Commons License" /></a><img src="/icons/icon_mini-xml.png" alt="XML Powered!" /><br /><br />
105
	  The text of this document is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 License</a>.
106
	</p>
107
    </div>
108
  </body>
109
</html>
(-)ebuild-writing/functions/src_prepare/text.xml (+76 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_prepare/">
3
<chapter>
4
<title>src_prepare</title>
5
6
<body>
7
<table>
8
  <tr>
9
    <th>Function</th>
10
    <ti><c>src_prepare</c></ti>
11
  </tr>
12
  <tr>
13
    <th>Purpose</th>
14
    <ti>patch and fix unpacked source files.</ti>
15
  </tr>
16
  <tr>
17
    <th>Sandbox</th>
18
    <ti>Enabled</ti>
19
  </tr>
20
  <tr>
21
    <th>Privilege</th>
22
    <ti>user</ti>
23
  </tr>
24
  <tr>
25
    <th>Called for</th>
26
    <ti>ebuild</ti>
27
  </tr>
28
  <tr>
29
    <th>EAPI</th>
30
    <ti>2</ti>
31
  </tr>
32
</table>
33
</body>
34
35
<section>
36
<title>Default <c>src_prepare</c></title>
37
<body>
38
<codesample lang="ebuild">
39
src_prepare() {
40
    return
41
}
42
</codesample>
43
</body>
44
</section>
45
46
<section>
47
<title>Sample <c>src_prepare</c></title>
48
<body>
49
<codesample lang="ebuild">
50
src_prepare() {
51
    epatch "${FILESDIR}/${PV}/${P}-fix-bogosity.patch"
52
    use pam &amp;&amp; epatch "${FILESDIR}/${PV}/${P}-pam.patch"
53
54
    sed -i -e 's/"ispell"/"aspell"/' src/defaults.h || die "Sed failed!"
55
}
56
</codesample>
57
</body>
58
</section>
59
60
<section>
61
<title><c>src_prepare</c> Actions</title>
62
<body>
63
<p>
64
The following subsections cover different topics which often occur when writing
65
<c>src_prepare</c> functions.
66
</p>
67
68
<contentsTree/>
69
</body>
70
</section>
71
72
</chapter>
73
74
<include href="epatch/"/>
75
<include href="autopackage/"/>
76
</guide>
(-)ebuild-writing/functions/src_prepare/epatch/text.xml (-11 / +5 lines)
Lines 1-5 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_unpack/epatch/">
2
<guide self="ebuild-writing/functions/src_prepare/epatch/">
3
<chapter>
3
<chapter>
4
<title>Patching with epatch</title>
4
<title>Patching with epatch</title>
5
5
Lines 7-13 Link Here
7
<p>
7
<p>
8
The canonical way of applying patches in ebuilds is to
8
The canonical way of applying patches in ebuilds is to
9
use <c>epatch</c> (from <c>eutils.eclass</c>, which you must make sure
9
use <c>epatch</c> (from <c>eutils.eclass</c>, which you must make sure
10
to import!) inside <c>src_unpack</c>. This function automatically
10
to import!) inside <c>src_prepare</c>. This function automatically
11
handles <c>-p</c> levels, <c>gunzip</c> and so on as necessary.
11
handles <c>-p</c> levels, <c>gunzip</c> and so on as necessary.
12
</p>
12
</p>
13
13
Lines 28-36 Link Here
28
</p>
28
</p>
29
29
30
<codesample lang="ebuild">
30
<codesample lang="ebuild">
31
src_unpack() {
31
src_prepare() {
32
    unpack ${A}
33
    cd "${S}"
34
    epatch "${FILESDIR}/${P}-destdir.patch"
32
    epatch "${FILESDIR}/${P}-destdir.patch"
35
    epatch "${FILESDIR}/${P}-parallel_build.patch"
33
    epatch "${FILESDIR}/${P}-parallel_build.patch"
36
}
34
}
Lines 45-53 Link Here
45
</p>
43
</p>
46
44
47
<codesample lang="ebuild">
45
<codesample lang="ebuild">
48
src_unpack() {
46
src_prepare() {
49
    unpack ${P}.tar.bz2
50
    cd "${S}"
51
    epatch "${DISTDIR}/${P}-suse-update.patch.bz2"
47
    epatch "${DISTDIR}/${P}-suse-update.patch.bz2"
52
    epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch"
48
    epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch"
53
}
49
}
Lines 88-96 Link Here
88
</p>
84
</p>
89
85
90
<codesample lang="ebuild">
86
<codesample lang="ebuild">
91
src_unpack() {
87
src_prepare() {
92
    unpack ${A}
93
    cd "${S}"
94
    EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
88
    EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
95
        EPATCH_FORCE="yes" epatch
89
        EPATCH_FORCE="yes" epatch
96
}
90
}
(-)ebuild-writing/functions/src_prepare/autopackage/text.xml (-1 / +1 lines)
Lines 1-5 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0"?>
2
<guide self="ebuild-writing/functions/src_unpack/autopackage/">
2
<guide self="ebuild-writing/functions/src_prepare/autopackage/">
3
<chapter>
3
<chapter>
4
<title>Autopackage</title>
4
<title>Autopackage</title>
5
5
(-)ebuild-writing/functions/src_prepare/index.html (+96 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
4
  <head>
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
    <title>Gentoo Development Guide: src_prepare</title>
7
    <link rel="stylesheet" href="../../../devmanual.css" type="text/css" />
8
  </head>
9
  <body>
10
    <div class="main">
11
      <h1>Gentoo Development Guide</h1>
12
      <div class="navtop" style="text-align: center;">
13
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
14
          <col width="33%" />
15
          <col width="34%" />
16
          <col width="33%" />
17
          <tr>
18
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../src_unpack/other-formats/index.html">Other Archive Formats</a></td>
19
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
20
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="epatch/index.html">Patching with epatch</a> →</td>
21
          </tr>
22
        </table>
23
      </div>
24
      <div class="document">
25
<h1>src_prepare</h1>
26
<table>
27
  <tr>
28
    <td class="devbook"><b>Function</b></td>
29
    <td class="devbook"><code class="docutils literal"><span class="pre">src_prepare</span></code></td>
30
  </tr>
31
  <tr>
32
    <td class="devbook"><b>Purpose</b></td>
33
    <td class="devbook">patch and fix unpacked source files.</td>
34
  </tr>
35
  <tr>
36
    <td class="devbook"><b>Sandbox</b></td>
37
    <td class="devbook">Enabled</td>
38
  </tr>
39
  <tr>
40
    <td class="devbook"><b>Privilege</b></td>
41
    <td class="devbook">user</td>
42
  </tr>
43
  <tr>
44
    <td class="devbook"><b>Called for</b></td>
45
    <td class="devbook">ebuild</td>
46
  </tr>
47
  <tr>
48
    <td class="devbook"><b>EAPI</b></td>
49
    <td class="devbook">2</td>
50
  </tr>
51
</table>
52
<div class="section"><h2><a name="default-src_prepare" id="default-src_prepare">Default <code class="docutils literal"><span class="pre">src_prepare</span></code></a></h2>
53
<pre><span class="Constant"><span class="Special">src_prepare()</span> <span class="PreProc">{</span>
54
    <span class="Statement">return</span>
55
<span class="PreProc">}</span>
56
</span></pre>
57
</div><div class="section"><h2><a name="sample-src_prepare" id="sample-src_prepare">Sample <code class="docutils literal"><span class="pre">src_prepare</span></code></a></h2>
58
<pre><span class="Constant"><span class="Special">src_prepare()</span> <span class="PreProc">{</span>
59
    <span class="Statement">epatch</span> <span class="Statement">"</span><span class="Identifier">${FILESDIR}</span>/<span class="Identifier">${PV}</span>/<span class="Identifier">${P}</span>-fix-bogosity.patch<span class="Statement">"</span>
60
    <span class="Statement">use</span> pam <span class="Statement">&amp;&amp;</span> <span class="Statement">epatch</span> <span class="Statement">"</span><span class="Identifier">${FILESDIR}</span>/<span class="Identifier">${PV}</span>/<span class="Identifier">${P}</span>-pam.patch<span class="Statement">"</span>
61
62
    <span class="Statement">sed</span> -i -e 's/<span class="Statement">"</span>ispell<span class="Statement">"</span>/<span class="Statement">"</span>aspell<span class="Statement">"</span>/' src/defaults.h <span class="Statement">||</span> <span class="Statement">die</span> <span class="Statement">"</span>Sed failed!<span class="Statement">"</span>
63
<span class="PreProc">}</span>
64
</span></pre>
65
</div><div class="section"><h2><a name="src_prepare-actions" id="src_prepare-actions"><code class="docutils literal"><span class="pre">src_prepare</span></code> Actions</a></h2>
66
<p>
67
The following subsections cover different topics which often occur when writing
68
<code class="docutils literal"><span class="pre">src_prepare</span></code> functions.
69
</p>
70
71
<ul><li><a class="reference" href="epatch/index.html">Patching with epatch</a></li><li><a class="reference" href="autopackage/index.html">Autopackage</a></li></ul>
72
</div>
73
74
75
76
</div>
77
      <div class="navbottom" style="text-align: center;">
78
        <table style="border-top: 1px dashed #330066; margin-left: auto; margin-right: auto;    width: 100%;">
79
          <col width="33%" />
80
          <col width="34%" />
81
          <col width="33%" />
82
          <tr>
83
            <td style="text-align: center; border-right: 1px dashed #330066;">← <a href="../src_unpack/other-formats/index.html">Other Archive Formats</a></td>
84
            <td style="text-align: center;">↑ <a href="../index.html">Ebuild Functions</a> ↑</td>
85
            <td style="text-align: center; border-left: 1px dashed #330066;"><a href="epatch/index.html">Patching with epatch</a> →</td>
86
          </tr>
87
        </table>
88
      </div>
89
    </div>
90
    <div class="footer">
91
      <p><a href="http://validator.w3.org/check/referer"><img src="/icons/icon_mini-xhtml.png" alt="Valid XHTML 1.0" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="/icons/icon_mini-css.png" alt="Valid CSS" /></a><a href="http://www.gentoo.org/"><img src="/icons/icon_mini-gentoo.png" alt="Powered by Gentoo" /></a><a href="http://creativecommons.org/licenses/by-sa/2.0/"><img src="/icons/icon_mini-creativecommons.png" alt="Creative Commons License" /></a><img src="/icons/icon_mini-xml.png" alt="XML Powered!" /><br /><br />
92
	  The text of this document is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 License</a>.
93
	</p>
94
    </div>
95
  </body>
96
</html>
(-)ebuild-writing/eapi/text.xml (+263 lines)
Lines 301-307 Link Here
301
</body>
301
</body>
302
</section>
302
</section>
303
303
304
<section>
305
<title>EAPI="3"</title>
306
<body>
304
307
308
<subsection>
309
<title>Helpers</title>
310
<body>
311
<ul>
312
	<li>
313
		<p><b>utilities die on their own, unless the nonfatal command is used</b></p>
314
		<p>
315
			<!-- TODO link auf fuunction-reference -->
316
			ebuild functions all die on their own in EAPI=3. In case that this
317
			non-zero exit status is expected, you may call <c>nonfatal function
318
			[arg,...]</c>.
319
		</p>
320
		<p>Example:</p>
321
		<codesample lang="ebuild">
322
EAPI=1
323
...
324
src_install() {
325
	emake DESTDIR="${D}" install || die "make install failed"
326
	dodoc ChangeLog README
327
}
328
		</codesample>
329
		<codesample lang="ebuild">
330
EAPI=3
331
...
332
src_install() {
333
	emake DESTDIR="${D}" install
334
	nonfatal dodoc ChangeLog README
335
}
336
		</codesample>
337
	</li>
338
	<li>
339
		<p><b>recursive dodoc</b></p>
340
		<p>
341
			<c>dodoc</c> supports <c>-r</c> as the first argument, which leads
342
			<c>dodoc</c> to install the specified documentation directory
343
			recursively into the docdir.
344
		</p>
345
		<p>Example:</p>
346
		<codesample lang="ebuild">
347
src_install() {
348
	default
349
	dodoc ChangeLog
350
	dodoc -r doc/
351
}
352
		</codesample>
353
	</li>
354
	<li>
355
		<p><b>doins symlink supports</b></p>
356
		<p>
357
			withing EAPI=3, <c>doins</c> supports to install symlinks as symlinks
358
			when installing recursively. For older EAPIs, the symlink behaviour
359
			is undefined.
360
		</p>
361
	</li>
362
	<li>
363
		<p><b>dosed and dohard are banned</b></p>
364
		<p>
365
			<c>dosed</c> and <c>dohard</c> commands are banned in this EAPI.
366
		</p>
367
	</li>
368
	<li>
369
		<p><b>unpack supports .xz and .tar.xz</b></p>
370
		<p>
371
			The <c>unpack</c> command supports xz-archives and xz-compressed tar
372
			files. Please note that the ebuilds must ensure that
373
			<c>app-arch/xz-utils</c> are installed.
374
		</p>
375
	</li>
376
	<li>
377
		<p><b>econf adds --disable-dependency-tracking</b></p>
378
		<p>
379
			Withing EAPI=3, <c>econf</c> adds
380
			<c>--disable-dependency-tracking</c> to the default configure
381
			options.
382
		</p>
383
	</li>
384
	<li>
385
		<p><b>controllable compression via docompress</b></p>
386
		<p>
387
			to compress files in the destination-folder <c>${D}</c>, the
388
			<c>docompress</c> command may be used (in <c>src_install</c>, after
389
			the target files are in <c>${D}</c>).
390
			to control which items should be compressed and which shouldn't
391
			be compressed, you may include and exclude directories. the default
392
			inclusion list contains
393
			<ul>
394
				<li><c>/usr/share/doc</c></li>
395
				<li><c>/usr/share/info</c></li>
396
				<li><c>/usr/share/man</c></li>
397
			</ul>
398
			the default exclusion list contains
399
			<ul>
400
				<li><c>/usr/share/doc/${PF}/html</c></li>
401
			</ul>
402
			when a directory is in- or excluded, all files and directories in the
403
			given directories shall be added to the corresponding list. if a
404
			file is in- or excluded, the file shall be added to the corresponding
405
			list (exclusion is stronger than inclusion - if a file is in both
406
			lists, the inclusion will be ignored). if a non-existing file or
407
			directory is given, it will be ignored.
408
			if the first argument of <c>docompress</c> is <c>-x</c>, the item
409
			specified will be added to the exclusion list, otherwise it will be
410
			added to the inclusion list.
411
		</p>
412
	</li>
413
</ul>
305
</body>
414
</body>
415
</subsection>
416
417
<subsection>
418
<title>Metadata</title>
419
<body>
420
<ul>
421
	<li>
422
		<p><b>slot operator dependencies</b></p>
423
		<p>
424
			an operator slot dependency contains of a colon followed by einer a
425
			'<c>*</c>' or '<c>=</c>':
426
			<ul>
427
				<li><c>*</c> means that any slot of the given package is
428
				acceptable. additional for runtime-dependencies is that the
429
				current package will not break, when the given package is replaced
430
				by a different slot.</li>
431
				<li><c>=</c> means that any slot of the given package is
432
				acceptable. but unlike above (<c>*</c>), for runtime-dependencies
433
				it will break if the slot of the given package and the current
434
				package do not match.</li>
435
			</ul>
436
		</p>
437
	</li>
438
	<li>
439
		<p><b>use dependencies default</b></p>
440
		<p>
441
			additional to the use-deps specified in EAPI=2, a <c>(+)</c> or
442
			<c>(-)</c> may be added to the use-dep to define a default-value in
443
			case the use-flag does not exist in the given packge. the <c>(+)</c>
444
			means that this use-flag is assumed to be enabled, the <c>(-)</c> the
445
			opposite.
446
			example:
447
			<codesample lang="ebuild">
448
DEPEND="
449
	>=dev-libs/boost-1.32[boost(+)]
450
	sys-devel/gcc[openmp(-)]"
451
			</codesample>
452
		</p>
453
	</li>
454
</ul>
455
</body>
456
</subsection>
457
458
<subsection>
459
<title>Phases</title>
460
<body>
461
<ul>
462
	<li>
463
		<p><b>new pkg_pretend phase</b></p>
464
		<p>
465
			the new <c>pkg_pretend</c> phase can be used to do sanity checks
466
			before the main phase function sequence is run (meaning this phase is
467
			executed after the package manager has calculated the dependencies
468
			and before installing them).
469
			This phase typically checks for a kernel configuration and may
470
			<c>eerror</c> and <c>die</c> when needed.
471
			<important>
472
				There is no guarantee that the ebuild's dependencies are installed
473
				when this phase is called.
474
			</important>
475
			<important>
476
				As <c>pkg_pretend</c> is not called in the main phase function
477
				sequence, environment saving is not guaranteed.
478
			</important>
479
		</p>
480
		<p>Example:</p>
481
		<codesample lang="ebuild">
482
# Copyright 1999-2009 Gentoo Foundation
483
# Distributed under the terms of the GNU General Public License v2
484
# $Header: $
485
486
EAPI="3"
487
inherit linux-info
488
...
489
490
pkg_pretend() {
491
	if use kernel_linux ; then
492
		if [[ -e "${ROOT}"/usr/src/linux/.config ]] ; then
493
			if kernel_is lt 2 6 30 ; then
494
				CONFIG_CHECK="FUSE_FS"
495
				FUSE_FS_ERROR="this is an unrealistic testcase..."
496
				check_extra_config
497
			fi
498
		fi
499
	fi
500
}
501
		</codesample>
502
	</li>
503
	<li>
504
		<p><b>default src_install is no longer a non-op</b></p>
505
		<p>
506
			the default implementation of <c>src_install</c> is no longer a
507
			non-op in EAPI=3:
508
		</p>
509
		<codesample lang="ebuild">
510
src_install() {
511
	if [[ -f Makefile ]] || [[ -f GNUmakefile]] || [[ -f makefile ]] ; then
512
		emake DESTDIR="${D}" install
513
	fi
514
515
	if ! declare -p DOCS >/dev/null 2>&amp;1 ; then
516
		local d
517
		for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \
518
				FAQ CREDITS CHANGELOG ; do
519
			[[ -s "${d}" ]] &amp;&amp; dodoc "${d}"
520
		done
521
	# TODO: wrong "declare -a" command...
522
	elif declare -p DOCS | grep -q `^declare -a` ; then
523
		dodoc "${DOCS[@]}"
524
	else
525
		dodoc ${DOCS}
526
	fi
527
}
528
		</codesample>
529
	</li>
530
	<li>
531
		<p><b>pkg_info for non-installed packages</b></p>
532
		<p>
533
			the <c>pkg_info</c> function may also be called by the
534
			package-manager for non-installed packages.
535
			the ebuild writers should note, that dependencies may not be
536
			available.
537
		</p>
538
	</li>
539
</ul>
540
</body>
541
</subsection>
542
543
<subsection>
544
<title>Variables</title>
545
<body>
546
<ul>
547
	<li>
548
		<p><b>AA and KV variables are gone</b></p>
549
		<p>
550
			the <c>${AA}</c> and <c>${KV}</c> variables are no longer set in
551
			EAPI=3.
552
		</p>
553
	</li>
554
	<li>
555
		<p><b>no more RDEPEND="${DEPEND}"</b></p>
556
		<p>
557
			when <c>RDEPEND</c> is unset, there will no longer be an automatic
558
			assignement of <c>RDEPEND="${DEPEND}"</c>.
559
		</p>
560
	</li>
561
</ul>
562
</body>
563
</subsection>
564
565
</body>
566
</section>
567
568
</body>
306
</chapter>
569
</chapter>
307
</guide>
570
</guide>

Return to bug 275551