/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-use.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-working-use.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.19
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
1<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 6
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.5 2003/12/16 18:08:56 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.19 2004/09/24 14:00:33 swift Exp $ -->
5 8
6<sections> 9<sections>
7<section> 10<section>
8<title>What are USE-flags?</title> 11<title>What are USE-flags?</title>
9<subsection> 12<subsection>
25with KDE-support if those packages work flawlessly without? 28with KDE-support if those packages work flawlessly without?
26</p> 29</p>
27 30
28<p> 31<p>
29To help users in deciding what to install/activate and what not, we wanted the 32To help users in deciding what to install/activate and what not, we wanted the
30user to specify his environment in an easy way. This forces the user into 33user to specify his/her environment in an easy way. This forces the user into
31deciding what he really wants and eases the process for Portage, our package 34deciding what they really want and eases the process for Portage, our package
32managment system, to make useful decisions. 35managment system, to make useful decisions.
33</p> 36</p>
34 37
35</body> 38</body>
36</subsection> 39</subsection>
44Portage will know that you want support for the chosen keyword. Of course 47Portage will know that you want support for the chosen keyword. Of course
45this also alters the dependency information for a package. 48this also alters the dependency information for a package.
46</p> 49</p>
47 50
48<p> 51<p>
49Lets take a look at a specific example: the <c>kde</c> keyword. If you do not 52Let us take a look at a specific example: the <c>kde</c> keyword. If you do not
50have this keyword in your <c>USE</c> variable, all packages that have 53have this keyword in your <c>USE</c> variable, all packages that have
51<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All 54<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All
52packages that have an <e>optional</e> KDE dependency will be installed 55packages that have an <e>optional</e> KDE dependency will be installed
53<e>without</e> installing the KDE libraries (as dependency). If you have defined 56<e>without</e> installing the KDE libraries (as dependency). If you have defined
54the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE 57the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE
74 <li> 77 <li>
75 A <e>global</e> USE-flag is used by several packages, system-wide. This is 78 A <e>global</e> USE-flag is used by several packages, system-wide. This is
76 what most people see as USE-flags. 79 what most people see as USE-flags.
77 </li> 80 </li>
78 <li> 81 <li>
79 A <e>local</e> USE-fag is used by a single package to make package-specific 82 A <e>local</e> USE-flag is used by a single package to make package-specific
80 decisions. 83 decisions.
81 </li> 84 </li>
82</ul> 85</ul>
83 86
84<p> 87<p>
96icc - Use the Intel C++ Compiler if the package supports it 99icc - Use the Intel C++ Compiler if the package supports it
97icc-pgo - Enable PGO data generation or use when use icc. 100icc-pgo - Enable PGO data generation or use when use icc.
98imap - Adds support for IMAP 101imap - Adds support for IMAP
99</pre> 102</pre>
100 103
104<p>
105A list of available local USE-flags can be found locally in
106<path>/usr/portage/profiles/use.local.desc</path>.
107</p>
108
101</body> 109</body>
102</subsection> 110</subsection>
103</section> 111</section>
104<section> 112<section>
105<title>Using USE-flags</title> 113<title>Using USE-flags</title>
119we think are commonly used by the Gentoo users. This default setting is declared 127we think are commonly used by the Gentoo users. This default setting is declared
120in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at 128in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at
121this default setting: 129this default setting:
122</p> 130</p>
123 131
124<pre caption="/etc/make.profile/make.defaults USE variable"> 132<pre caption="/etc/make.profile/make.defaults USE variable on an x86 system">
125USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk 133USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm
126 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls 134 gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses
127 oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang 135 nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl
128 spell ssl svga tcpd truetype X xml2 xmms xv zlib" 136 slang spell ssl svga tcpd truetype X xml2 xmms xv zlib"
129</pre> 137</pre>
130 138
131<p> 139<p>
132As you can see, this variable already contains quite a lot of keywords. Do 140As you can see, this variable already contains quite a lot of keywords. Do
133<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor 141<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor
153</pre> 161</pre>
154 162
155</body> 163</body>
156</subsection> 164</subsection>
157<subsection> 165<subsection>
166<title>Declaring USE flags for individual packages</title>
167<body>
168
169<p>
170Sometimes you want to declare a certain USE flag for one (or a couple) of
171applications but not system-wide. To accomplish this, you will need to create
172the <path>/etc/portage</path> directory (if it doesn't exist yet) and edit
173<path>/etc/portage/package.use</path>.
174</p>
175
176<p>
177For instance, if you don't want <c>berkdb</c> support globally but you do want
178it for <c>mysql</c>, you would add:
179</p>
180
181<pre caption="/etc/portage/package.use example">
182dev-db/mysql berkdb
183</pre>
184
185<p>
186You can of course also explicitly <e>disable</e> USE flags for a certain
187application. For instance, if you don't want <c>java</c> support in PHP:
188</p>
189
190<pre caption="/etc/portage/package.use 2nd example">
191dev-php/php -java
192</pre>
193
194</body>
195</subsection>
196<subsection>
158<title>Declare temporary USE-flags</title> 197<title>Declare temporary USE-flags</title>
159<body> 198<body>
160 199
161<p> 200<p>
162Sometimes you want to set a certain USE-setting only once. Instead of editing 201Sometimes you want to set a certain USE-setting only once. Instead of editing
163<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just 202<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just
164declare the USE-variable as environment variable. 203declare the USE-variable as environment variable. Remember that, when you
204re-emerge or update this application (either explicitly or as part of a system
205update) your changes will be lost!
165</p> 206</p>
166 207
167<p> 208<p>
168As an example we will temporarily remove java from the USE-setting 209As an example we will temporarily remove java from the USE-setting
169during the installation of mozilla. 210during the installation of mozilla.
172<note> 213<note>
173The <c>emerge</c> command will be discussed more thoroughly in <uri 214The <c>emerge</c> command will be discussed more thoroughly in <uri
174link="?part=2&amp;chap=2">Portage and Software</uri>. 215link="?part=2&amp;chap=2">Portage and Software</uri>.
175</note> 216</note>
176 217
177<pre caption="Using USE as evironment variable"> 218<pre caption="Using USE as environment variable">
178# <i>USE="-java" emerge mozilla</i> 219# <i>USE="-java" emerge mozilla</i>
179</pre> 220</pre>
180 221
181</body> 222</body>
182</subsection> 223</subsection>
200</pre> 241</pre>
201 242
202</body> 243</body>
203</subsection> 244</subsection>
204<subsection> 245<subsection>
205<title>Precendence</title> 246<title>Precedence</title>
206<body> 247<body>
207 248
208<p> 249<p>
209Of course there is a certain precendence on what setting has priority over the 250Of course there is a certain precedence on what setting has priority over the
210USE setting. You don't want to declare <c>USE="-java"</c> only to see that 251USE setting. You don't want to declare <c>USE="-java"</c> only to see that
211<c>java</c> is declared anyway. The precedence for the USE setting is, ordered 252<c>java</c> is declared anyway. The precedence for the USE setting is, ordered
212by priority (first has lowest priority): 253by priority (first has lowest priority):
213</p> 254</p>
214 255
222 </li> 263 </li>
223 <li> 264 <li>
224 User-defined USE setting in <path>/etc/make.conf</path> 265 User-defined USE setting in <path>/etc/make.conf</path>
225 </li> 266 </li>
226 <li> 267 <li>
268 User-defined USE setting in <path>/etc/portage/package.use</path>
269 </li>
270 <li>
227 User-defined USE setting as environment variable 271 User-defined USE setting as environment variable
228 </li> 272 </li>
229</ol> 273</ol>
230 274
231<p> 275<p>
235</p> 279</p>
236 280
237<pre caption="Running emerge info"> 281<pre caption="Running emerge info">
238# <i>emerge info</i> 282# <i>emerge info</i>
239</pre> 283</pre>
284
285</body>
286</subsection>
287<subsection>
288<title>Adapting your Entire System to New USE Flags</title>
289<body>
290
291<p>
292If you have altered your USE flags and you wish to update your entire system to
293use the new USE flags, you can try following the next steps to accomplish this.
294Note however that these steps will take a long time to finish and that work is
295on the way to adjust Portage to handle this behaviour quicker and automatically.
296</p>
297
298<p>
299First of all, rebuild your entire system using the new USE flags:
300</p>
301
302<pre caption="Rebuilding your entire system">
303# <i>emerge --emptytree world</i>
304</pre>
305
306<p>
307Next, run Portage' depclean to remove the conditional dependencies that
308were emerged on your "old" system but that have been obsoleted by the new USE
309flags.
310</p>
311
312<warn>
313Running <c>emerge depclean</c> is a dangerous operation and should be handled
314with care. Double-check the provided list of "obsoleted" packages to make sure
315it doesn't remove packages you need. In the following example we add the
316<c>-p</c> switch to have depclean only list the packages without removing them.
317</warn>
318
319<pre caption="Removing obsoleted packages">
320# <i>emerge -p depclean</i>
321</pre>
322
323<p>
324When depclean has finished, your system is using the new USE flag settings.
325</p>
240 326
241</body> 327</body>
242</subsection> 328</subsection>
243</section> 329</section>
244<section> 330<section>

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20