/[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.18
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.18 2004/09/11 14:05:49 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
150 158
151<pre caption="An example USE setting in /etc/make.conf"> 159<pre caption="An example USE setting in /etc/make.conf">
152USE="-kde -qt ldap" 160USE="-kde -qt ldap"
153</pre> 161</pre>
154 162
163<p>
164Sometimes you want to declare a certain USE flag for one (or a couple) of
165applications but not system-wide. To accomplish this, you will need to create
166the <path>/etc/portage</path> directory (if it doesn't exist yet) and edit
167<path>/etc/portage/package.use</path>.
168</p>
169
170<p>
171For instance, if you don't want <c>berkdb</c> support globally but you do want
172it for <c>mysql</c>, you would add:
173</p>
174
175<pre caption="/etc/portage/package.use example">
176dev-db/mysql berkdb
177</pre>
178
179<p>
180You can of course also explicitly <e>disable</e> USE flags for a certain
181application. For instance, if you don't want <c>java</c> support in PHP:
182</p>
183
184<pre caption="/etc/portage/package.use 2nd example">
185dev-php/php -java
186</pre>
187
155</body> 188</body>
156</subsection> 189</subsection>
157<subsection> 190<subsection>
158<title>Declare temporary USE-flags</title> 191<title>Declare temporary USE-flags</title>
159<body> 192<body>
160 193
161<p> 194<p>
162Sometimes you want to set a certain USE-setting only once. Instead of editing 195Sometimes 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 196<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just
164declare the USE-variable as environment variable. 197declare the USE-variable as environment variable. Remember that, when you
198re-emerge or update this application (either explicitly or as part of a system
199update) your changes will be lost!
165</p> 200</p>
166 201
167<p> 202<p>
168As an example we will temporarily remove java from the USE-setting 203As an example we will temporarily remove java from the USE-setting
169during the installation of mozilla. 204during the installation of mozilla.
172<note> 207<note>
173The <c>emerge</c> command will be discussed more thoroughly in <uri 208The <c>emerge</c> command will be discussed more thoroughly in <uri
174link="?part=2&amp;chap=2">Portage and Software</uri>. 209link="?part=2&amp;chap=2">Portage and Software</uri>.
175</note> 210</note>
176 211
177<pre caption="Using USE as evironment variable"> 212<pre caption="Using USE as environment variable">
178# <i>USE="-java" emerge mozilla</i> 213# <i>USE="-java" emerge mozilla</i>
179</pre> 214</pre>
180 215
181</body> 216</body>
182</subsection> 217</subsection>
200</pre> 235</pre>
201 236
202</body> 237</body>
203</subsection> 238</subsection>
204<subsection> 239<subsection>
205<title>Precendence</title> 240<title>Precedence</title>
206<body> 241<body>
207 242
208<p> 243<p>
209Of course there is a certain precendence on what setting has priority over the 244Of 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 245USE 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 246<c>java</c> is declared anyway. The precedence for the USE setting is, ordered
212by priority (first has lowest priority): 247by priority (first has lowest priority):
213</p> 248</p>
214 249
222 </li> 257 </li>
223 <li> 258 <li>
224 User-defined USE setting in <path>/etc/make.conf</path> 259 User-defined USE setting in <path>/etc/make.conf</path>
225 </li> 260 </li>
226 <li> 261 <li>
262 User-defined USE setting in <path>/etc/portage/package.use</path>
263 </li>
264 <li>
227 User-defined USE setting as environment variable 265 User-defined USE setting as environment variable
228 </li> 266 </li>
229</ol> 267</ol>
230 268
231<p> 269<p>
235</p> 273</p>
236 274
237<pre caption="Running emerge info"> 275<pre caption="Running emerge info">
238# <i>emerge info</i> 276# <i>emerge info</i>
239</pre> 277</pre>
278
279</body>
280</subsection>
281<subsection>
282<title>Adapting your Entire System to New USE Flags</title>
283<body>
284
285<p>
286If you have altered your USE flags and you wish to update your entire system to
287use the new USE flags, you can try following the next steps to accomplish this.
288Note however that these steps will take a long time to finish and that work is
289on the way to adjust Portage to handle this behaviour quicker and automatically.
290</p>
291
292<p>
293First of all, rebuild your entire system using the new USE flags:
294</p>
295
296<pre caption="Rebuilding your entire system">
297# <i>emerge --emptytree world</i>
298</pre>
299
300<p>
301Next, run Portage' depclean to remove the conditional dependencies that
302were emerged on your "old" system but that have been obsoleted by the new USE
303flags.
304</p>
305
306<warn>
307Running <c>emerge depclean</c> is a dangerous operation and should be handled
308with care. Double-check the provided list of "obsoleted" packages to make sure
309it doesn't remove packages you need. In the following example we add the
310<c>-p</c> switch to have depclean only list the packages without removing them.
311</warn>
312
313<pre caption="Removing obsoleted packages">
314# <i>emerge -p depclean</i>
315</pre>
316
317<p>
318When depclean has finished, your system is using the new USE flag settings.
319</p>
240 320
241</body> 321</body>
242</subsection> 322</subsection>
243</section> 323</section>
244<section> 324<section>

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

  ViewVC Help
Powered by ViewVC 1.1.20