Gentoo use flags

If you are using Gentoo one of the first things you need to do when you are installing (emerging) software is to define the use flags. Use flags are recepies for the system, which tell your Gentoo box how should it build its software. You can of course put all your use flags in /etc/portage/make.conf but the downside of that approach is that you will literally get all the use flags built as global features in every single package you compile with emerge. So, if you want to make a robust Gentoo box and reduce the packages size you will probably find yourself enabling use flags individually for every single package you will install.

Usually when you do emege program_name_here you will get a message saying something like: “The following use changes are required”. Below is an example on how to define the use flags locally for some packages in Gentoo /etc/portage/package.use file.

# are comments which will not be read during the package compilation.

#/etc/portage/package.use

#Firefox use flags
x11-libs/cairo X
x11-libs/pango X
media-libs/libpng apng
dev-lang/python sqlite

#Fluxbox use flags
media-libs/imlib2 X

#Shutter use flags
app-crypt/gcr gtk
x11-libs/gtk+:3 X
virtual/udev gudev
media-gfx/imagemagick perl
sys-fs/udev gudev

#Vlc use flags
sys-libs/zlib minizip

#Pulseaudio use flags
media-plugins/alsa-plugins pulseaudio

#Xorg use flags
x11-base/xorg-server udev

#Evince use flags
app-text/poppler cairo

#Libreoffice use flags
app-text/ghostscript-gpl cups
media-libs/harfbuzz icu

#Policykit use flags
sys-auth/consolekit policykit

#Fluxbox more use flags
x11-wm/fluxbox -gnome -kde truetype vim-syntax xinerama imlib nls slit toolbar acl

#i3lock use flags
x11-libs/cairo xcb

#Chromium use flags
dev-libs/libxml2 icu

#Xorg related use flags
dev-libs/libxml2 python

#Nautilus use flags
gnome-base/gvfs gtk
dev-libs/boost python
net-libs/rb_libtorrent python

Note. The need for use flags depends on the profile you chose for you desktop with eselect profile list and  eselect profile set commads. I used the default/minimal profile, which did not come with any notable use flags to begin with.  Also, do remember that when you are typing package specific use flags to /etc/portage/package.use file you should leave any version numbering out from the packages. The previous is because otherwise you might get an error message saying that the package.use file is misconfigured.