|
|
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.24 2004/11/20 22:23:30 neysx Exp $ --> |
| 5 | |
8 | |
| 6 | <sections> |
9 | <sections> |
|
|
10 | |
|
|
11 | <version>1.21</version> |
|
|
12 | <date>2004-10-21</date> |
|
|
13 | |
| 7 | <section> |
14 | <section> |
| 8 | <title>What are USE-flags?</title> |
15 | <title>What are USE-flags?</title> |
| 9 | <subsection> |
16 | <subsection> |
| 10 | <title>The ideas behind USE-flags</title> |
17 | <title>The ideas behind USE-flags</title> |
| 11 | <body> |
18 | <body> |
| … | |
… | |
| 25 | with KDE-support if those packages work flawlessly without? |
32 | with KDE-support if those packages work flawlessly without? |
| 26 | </p> |
33 | </p> |
| 27 | |
34 | |
| 28 | <p> |
35 | <p> |
| 29 | To help users in deciding what to install/activate and what not, we wanted the |
36 | To help users in deciding what to install/activate and what not, we wanted the |
| 30 | user to specify his environment in an easy way. This forces the user into |
37 | user to specify his/her environment in an easy way. This forces the user into |
| 31 | deciding what he really wants and eases the process for Portage, our package |
38 | deciding what they really want and eases the process for Portage, our package |
| 32 | managment system, to make useful decisions. |
39 | managment system, to make useful decisions. |
| 33 | </p> |
40 | </p> |
| 34 | |
41 | |
| 35 | </body> |
42 | </body> |
| 36 | </subsection> |
43 | </subsection> |
| … | |
… | |
| 44 | Portage will know that you want support for the chosen keyword. Of course |
51 | Portage will know that you want support for the chosen keyword. Of course |
| 45 | this also alters the dependency information for a package. |
52 | this also alters the dependency information for a package. |
| 46 | </p> |
53 | </p> |
| 47 | |
54 | |
| 48 | <p> |
55 | <p> |
| 49 | Lets take a look at a specific example: the <c>kde</c> keyword. If you do not |
56 | Let us take a look at a specific example: the <c>kde</c> keyword. If you do not |
| 50 | have this keyword in your <c>USE</c> variable, all packages that have |
57 | have 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 |
58 | <e>optional</e> KDE support will be compiled <e>without</e> KDE support. All |
| 52 | packages that have an <e>optional</e> KDE dependency will be installed |
59 | packages 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 |
60 | <e>without</e> installing the KDE libraries (as dependency). If you have defined |
| 54 | the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE |
61 | the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE |
| … | |
… | |
| 74 | <li> |
81 | <li> |
| 75 | A <e>global</e> USE-flag is used by several packages, system-wide. This is |
82 | A <e>global</e> USE-flag is used by several packages, system-wide. This is |
| 76 | what most people see as USE-flags. |
83 | what most people see as USE-flags. |
| 77 | </li> |
84 | </li> |
| 78 | <li> |
85 | <li> |
| 79 | A <e>local</e> USE-fag is used by a single package to make package-specific |
86 | A <e>local</e> USE-flag is used by a single package to make package-specific |
| 80 | decisions. |
87 | decisions. |
| 81 | </li> |
88 | </li> |
| 82 | </ul> |
89 | </ul> |
| 83 | |
90 | |
| 84 | <p> |
91 | <p> |
| … | |
… | |
| 96 | icc - Use the Intel C++ Compiler if the package supports it |
103 | icc - Use the Intel C++ Compiler if the package supports it |
| 97 | icc-pgo - Enable PGO data generation or use when use icc. |
104 | icc-pgo - Enable PGO data generation or use when use icc. |
| 98 | imap - Adds support for IMAP |
105 | imap - Adds support for IMAP |
| 99 | </pre> |
106 | </pre> |
| 100 | |
107 | |
|
|
108 | <p> |
|
|
109 | A list of available local USE-flags can be found locally in |
|
|
110 | <path>/usr/portage/profiles/use.local.desc</path>. |
|
|
111 | </p> |
|
|
112 | |
| 101 | </body> |
113 | </body> |
| 102 | </subsection> |
114 | </subsection> |
| 103 | </section> |
115 | </section> |
| 104 | <section> |
116 | <section> |
| 105 | <title>Using USE-flags</title> |
117 | <title>Using USE-flags</title> |
| … | |
… | |
| 119 | we think are commonly used by the Gentoo users. This default setting is declared |
131 | we think are commonly used by the Gentoo users. This default setting is declared |
| 120 | in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at |
132 | in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at |
| 121 | this default setting: |
133 | this default setting: |
| 122 | </p> |
134 | </p> |
| 123 | |
135 | |
| 124 | <pre caption="/etc/make.profile/make.defaults USE variable"> |
136 | <pre caption="/etc/make.profile/make.defaults USE variable on an x86 system"> |
| 125 | USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk |
137 | USE="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 |
138 | 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 |
139 | nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl |
| 128 | spell ssl svga tcpd truetype X xml2 xmms xv zlib" |
140 | slang spell ssl svga tcpd truetype X xml2 xmms xv zlib" |
| 129 | </pre> |
141 | </pre> |
| 130 | |
142 | |
| 131 | <p> |
143 | <p> |
| 132 | As you can see, this variable already contains quite a lot of keywords. Do |
144 | As 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 |
145 | <b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor |
| … | |
… | |
| 153 | </pre> |
165 | </pre> |
| 154 | |
166 | |
| 155 | </body> |
167 | </body> |
| 156 | </subsection> |
168 | </subsection> |
| 157 | <subsection> |
169 | <subsection> |
|
|
170 | <title>Declaring USE flags for individual packages</title> |
|
|
171 | <body> |
|
|
172 | |
|
|
173 | <p> |
|
|
174 | Sometimes you want to declare a certain USE flag for one (or a couple) of |
|
|
175 | applications but not system-wide. To accomplish this, you will need to create |
|
|
176 | the <path>/etc/portage</path> directory (if it doesn't exist yet) and edit |
|
|
177 | <path>/etc/portage/package.use</path>. |
|
|
178 | </p> |
|
|
179 | |
|
|
180 | <p> |
|
|
181 | For instance, if you don't want <c>berkdb</c> support globally but you do want |
|
|
182 | it for <c>mysql</c>, you would add: |
|
|
183 | </p> |
|
|
184 | |
|
|
185 | <pre caption="/etc/portage/package.use example"> |
|
|
186 | dev-db/mysql berkdb |
|
|
187 | </pre> |
|
|
188 | |
|
|
189 | <p> |
|
|
190 | You can of course also explicitly <e>disable</e> USE flags for a certain |
|
|
191 | application. For instance, if you don't want <c>java</c> support in PHP: |
|
|
192 | </p> |
|
|
193 | |
|
|
194 | <pre caption="/etc/portage/package.use 2nd example"> |
|
|
195 | dev-php/php -java |
|
|
196 | </pre> |
|
|
197 | |
|
|
198 | </body> |
|
|
199 | </subsection> |
|
|
200 | <subsection> |
| 158 | <title>Declare temporary USE-flags</title> |
201 | <title>Declare temporary USE-flags</title> |
| 159 | <body> |
202 | <body> |
| 160 | |
203 | |
| 161 | <p> |
204 | <p> |
| 162 | Sometimes you want to set a certain USE-setting only once. Instead of editing |
205 | Sometimes 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 |
206 | <path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just |
| 164 | declare the USE-variable as environment variable. |
207 | declare the USE-variable as environment variable. Remember that, when you |
|
|
208 | re-emerge or update this application (either explicitly or as part of a system |
|
|
209 | update) your changes will be lost! |
| 165 | </p> |
210 | </p> |
| 166 | |
211 | |
| 167 | <p> |
212 | <p> |
| 168 | As an example we will temporarily remove java from the USE-setting |
213 | As an example we will temporarily remove java from the USE-setting |
| 169 | during the installation of mozilla. |
214 | during the installation of mozilla. |
| 170 | </p> |
215 | </p> |
| 171 | |
216 | |
| 172 | <note> |
|
|
| 173 | The <c>emerge</c> command will be discussed more thoroughly in <uri |
|
|
| 174 | link="?part=2&chap=2">Portage and Software</uri>. |
|
|
| 175 | </note> |
|
|
| 176 | |
|
|
| 177 | <pre caption="Using USE as evironment variable"> |
217 | <pre caption="Using USE as environment variable"> |
| 178 | # <i>USE="-java" emerge mozilla</i> |
218 | # <i>USE="-java" emerge mozilla</i> |
| 179 | </pre> |
219 | </pre> |
| 180 | |
220 | |
| 181 | </body> |
221 | </body> |
| 182 | </subsection> |
222 | </subsection> |
| … | |
… | |
| 200 | </pre> |
240 | </pre> |
| 201 | |
241 | |
| 202 | </body> |
242 | </body> |
| 203 | </subsection> |
243 | </subsection> |
| 204 | <subsection> |
244 | <subsection> |
| 205 | <title>Precendence</title> |
245 | <title>Precedence</title> |
| 206 | <body> |
246 | <body> |
| 207 | |
247 | |
| 208 | <p> |
248 | <p> |
| 209 | Of course there is a certain precendence on what setting has priority over the |
249 | Of course there is a certain precedence on what setting has priority over the |
| 210 | USE setting. You don't want to declare <c>USE="-java"</c> only to see that |
250 | USE 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 |
251 | <c>java</c> is declared anyway. The precedence for the USE setting is, ordered |
| 212 | by priority (first has lowest priority): |
252 | by priority (first has lowest priority): |
| 213 | </p> |
253 | </p> |
| 214 | |
254 | |
| … | |
… | |
| 222 | </li> |
262 | </li> |
| 223 | <li> |
263 | <li> |
| 224 | User-defined USE setting in <path>/etc/make.conf</path> |
264 | User-defined USE setting in <path>/etc/make.conf</path> |
| 225 | </li> |
265 | </li> |
| 226 | <li> |
266 | <li> |
|
|
267 | User-defined USE setting in <path>/etc/portage/package.use</path> |
|
|
268 | </li> |
|
|
269 | <li> |
| 227 | User-defined USE setting as environment variable |
270 | User-defined USE setting as environment variable |
| 228 | </li> |
271 | </li> |
| 229 | </ol> |
272 | </ol> |
| 230 | |
273 | |
| 231 | <p> |
274 | <p> |
| … | |
… | |
| 238 | # <i>emerge info</i> |
281 | # <i>emerge info</i> |
| 239 | </pre> |
282 | </pre> |
| 240 | |
283 | |
| 241 | </body> |
284 | </body> |
| 242 | </subsection> |
285 | </subsection> |
|
|
286 | <subsection> |
|
|
287 | <title>Adapting your Entire System to New USE Flags</title> |
|
|
288 | <body> |
|
|
289 | |
|
|
290 | <p> |
|
|
291 | If you have altered your USE flags and you wish to update your entire system to |
|
|
292 | use the new USE flags, use <c>emerge</c>'s <c>--newuse</c> option: |
|
|
293 | </p> |
|
|
294 | |
|
|
295 | <pre caption="Rebuilding your entire system"> |
|
|
296 | # <i>emerge --update --deep --newuse world</i> |
|
|
297 | </pre> |
|
|
298 | |
|
|
299 | <p> |
|
|
300 | Next, run Portage's depclean to remove the conditional dependencies that |
|
|
301 | were emerged on your "old" system but that have been obsoleted by the new USE |
|
|
302 | flags. |
|
|
303 | </p> |
|
|
304 | |
|
|
305 | <warn> |
|
|
306 | Running <c>emerge depclean</c> is a dangerous operation and should be handled |
|
|
307 | with care. Double-check the provided list of "obsoleted" packages to make sure |
|
|
308 | it doesn't remove packages you need. In the following example we add the |
|
|
309 | <c>-p</c> switch to have depclean only list the packages without removing them. |
|
|
310 | </warn> |
|
|
311 | |
|
|
312 | <pre caption="Removing obsoleted packages"> |
|
|
313 | # <i>emerge -p depclean</i> |
|
|
314 | </pre> |
|
|
315 | |
|
|
316 | <p> |
|
|
317 | When depclean has finished, run <c>revdep-rebuild</c> to rebuild the |
|
|
318 | applications that are dynamically linked against shared objects provided by |
|
|
319 | possibly removed packages. <c>revdep-rebuild</c> is part of the |
|
|
320 | <c>gentoolkit</c> package; don't forget to emerge it first. |
|
|
321 | </p> |
|
|
322 | |
|
|
323 | <pre caption="Running revdep-rebuild"> |
|
|
324 | # <i>revdep-rebuild</i> |
|
|
325 | </pre> |
|
|
326 | |
|
|
327 | <p> |
|
|
328 | When all this is accomplished, your system is using the new USE flag settings. |
|
|
329 | </p> |
|
|
330 | |
|
|
331 | </body> |
|
|
332 | </subsection> |
| 243 | </section> |
333 | </section> |
| 244 | <section> |
334 | <section> |
| 245 | <title>Package specific USE-flags</title> |
335 | <title>Package specific USE-flags</title> |
| 246 | <subsection> |
336 | <subsection> |
| 247 | <title>Viewing available USE-flags</title> |
337 | <title>Viewing available USE-flags</title> |
| 248 | <body> |
338 | <body> |
| 249 | |
339 | |
| 250 | <p> |
340 | <p> |
| 251 | In the next chapter on <uri link="?part=2&chap=2">Portage and Software</uri> |
|
|
| 252 | we will explain how to manage your installed software and how to work with |
|
|
| 253 | <c>emerge</c>. However, we will give you a primer on <c>emerge</c> by showing |
|
|
| 254 | you how to view what USE-flags a package uses. |
|
|
| 255 | </p> |
|
|
| 256 | |
|
|
| 257 | <p> |
|
|
| 258 | Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To |
341 | Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To |
| 259 | find out, we use <c>emerge</c> with the <c>--pretend</c> (don't really do |
342 | find out, we use <c>emerge</c> with the <c>--pretend</c> and <c>--verbose</c> |
| 260 | anything) and <c>--verbose</c> (give more output) options: |
343 | options: |
| 261 | </p> |
344 | </p> |
| 262 | |
345 | |
| 263 | <pre caption="Viewing the used USE-flags"> |
346 | <pre caption="Viewing the used USE-flags"> |
| 264 | # <i>emerge --pretend --verbose mozilla</i> |
347 | # <i>emerge --pretend --verbose mozilla</i> |
| 265 | These are the packages that I would merge, in order: |
348 | These are the packages that I would merge, in order: |
| … | |
… | |
| 275 | dedicated to package information called <c>etcat</c> which resides in the |
358 | dedicated to package information called <c>etcat</c> which resides in the |
| 276 | <c>gentoolkit</c> package. First, install <c>gentoolkit</c>: |
359 | <c>gentoolkit</c> package. First, install <c>gentoolkit</c>: |
| 277 | </p> |
360 | </p> |
| 278 | |
361 | |
| 279 | <pre caption="Installing gentoolkit"> |
362 | <pre caption="Installing gentoolkit"> |
| 280 | # <i>emerge --usepkg gentoolkit</i> |
363 | # <i>emerge gentoolkit</i> |
| 281 | </pre> |
364 | </pre> |
| 282 | |
365 | |
| 283 | <p> |
366 | <p> |
| 284 | Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a |
367 | Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a |
| 285 | certain package. For instance, for the <c>gnumeric</c> package: |
368 | certain package. For instance, for the <c>gnumeric</c> package: |