When you are installing Gentoo (or any other distribution, or even operating system for that matter) you make choices depending on the environment you are working with. A setup for a server differs from a setup for a workstation. A gaming workstation differs from a 3D rendering workstation.
This is not only true for choosing what packages you want to install, but also what features a certain package should support. If you don't need OpenGL, why would you bother installing OpenGL and build OpenGL support in most of your packages? If you don't want to use KDE, why would you bother compiling packages with KDE-support if those packages work flawless without?
To help users in deciding what to install/activate and what not, we wanted the user to specify his environment in an easy way. This forces the user into deciding what he really wants and eases the process for Portage, our package managment system, to make usefull decisions.
Enter the USE-flags. Such a flag is a keyword that embodies support and dependency-information for a certain concept. If you define a certain USE-flag, Portage will know that you want support for the chosen keyword. Ofcourse this also alters the dependency information for a package.
Lets take a look at a specific example: the
By correctly defining the keywords you will receive a system tailored specifically to your needs.
There are two types of USE-flags:
A list of available global USE-flags can be found
gtk - Adds support for x11-libs/gtk+ (The GIMP Toolkit) gtk2 - Use gtk+-2.0.0 over gtk+-1.2 in cases where a program supports both. gtkhtml - Adds support for gnome-extra/gtkhtml guile - Adds support for dev-util/guile (interpreter for Scheme) icc - Use the Intel C++ Compiler if the package supports it icc-pgo - Enable PGO data generation or use when use icc. imap - Adds support for IMAP
In the hope you are convinced of the importance of USE-flags we will now inform you how to declare USE-flags.
As previously mentioned, all USE-flags are declared inside the
USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk
imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls
oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang
spell ssl svga tcpd truetype X xml2 xmms xv zlib"
As you can see, this variable already contains quite a lot of keywords. Do
not alter the
To change this default setting, you need to add or remove keywords to the
For instance, to remove support for KDE and QT but add support for ldap, the
following
USE="-kde -qt ldap"
Sometimes you want to set a certain USE-setting only once. Instead of editing
As an example we will temporarily remove java from the USE-setting during the installation of mozilla.
# USE="-java" emerge mozilla
Some packages don't only listen to USE-flags, but also provide USE-flags. When
you install such a package, the USE-flag they provide is added to your USE
setting. To view the list of packages that provide a USE-flag, check
gnome gnome-base/gnome gtk x11-libs/gtk+ qt x11-libs/qt kde kde-base/kdebase motif x11-libs/openmotif
Ofcourse there is a certain precendence on what setting has priority over the
USE setting. You don't want to declare
In the next chapter on
Let us take the example of
# emerge --pretend --verbose mozilla These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] net-www/mozilla-1.5-r1 +java +crypt -ipv6 -gtk2 +ssl +ldap +gnome -debug +mozcalendar -mozaccess -mozxmlterm -moznoirc -moznomail -moznocompose -moznoxft
# emerge --usepkg gentoolkit
Now run
# etcat uses gnumeric [ Colour Code : setunset ] [ Legend : (U) Col 1 - Current USE flags ] [ : (I) Col 2 - Installed With USE flags ] U I [ Found these USE variables in : app-office/gnumeric-1.2.0 ] - -libgda : Adds GNU Data Access (CORBA wrapper) support for gnumeric - -gnomedb : unknown + + python : Adds support/bindings for the Python language + + bonobo : Adds support for gnome-base/bonobo (Gnome CORBA interfaces)