One of the most important features of Gentoo is the USE flags. To me, it’s the most important reason why Gentoo is the best for me, and no other distributions can even get close to what Gentoo USE flags is offering.

If you have ever compiled from source tarball, then this may look familiar:


$ ./configure --help
`configure' configures subversion 1.7.14 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
[snip]
--disable-keychain Disable use of Mac OS KeyChain for auth credentials
--disable-nls Disable gettext functionality
--enable-debug Turn on debugging
--enable-disallowing-of-undefined-references
Use -Wl,--no-undefined flag during linking of some
libraries to disallow undefined references
--enable-maintainer-mode
Turn on debugging and very strict compile-time
warnings
[snip]

Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-apr=PATH prefix for installed APR, path to APR build tree,
or the full path to apr-config
--with-apr-util=PATH prefix for installed APU, path to APU build tree,
or the full path to apu-config
--with-neon=PREFIX Determine neon library configuration based on
'PREFIX/bin/neon-config'. Default is to search for
neon-config in $PATH.
[snip]

For a good source code, it often provides certain degree of configurable options to suit your needs. In the output above, you can see you can --enable-FEATURE, --disable-FEATURE, or --with-PACKAGE something you need.

If you have used Linux long enough, you may encounter a situation that your binary distribution Linux doesn’t build the package with the feature you definitely need to have. And I can bet many users would rather learning how to compile from source than filing a request. Of course, they have to know why Xyz feature is missing first.

The build tools might differ, but it’s same thing when you are unfortunate to have this problem. With binary package, you can only do nothing as a user other than asking your distribution developer to consider to enable the feature. Which brings up an extra dependency most likely, and that might need some consideration time for the developers.

Yet you need Xyz, but that doesn’t mean other users need that as well. Imagining the additional dependency might trigger some dislikes from other users.

Some projects might have the ability to have all capabilities to be compiled, then check in run-time. If the required library is missing, then the feature is disabled. However, not all projects can do this.

On Gentoo, users often have the freedom to enable or to disable certain feature via USE flags as long as the ebuild is well maintained. For example:


$ equery uses subversion
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for dev-vcs/subversion-1.7.14:
U I
- - apache2 : Add Apache2 support
- - berkdb : Add support for sys-libs/db (Berkeley DB for MySQL)
- - ctypes-python : Build and install Ctypes Python bindings
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
- - doc : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
- - dso : Enable runtime module search
- - extras : Install extra scripts (examples, tools, hooks)
- - gnome-keyring : Enable support for storing passwords via gnome-keyring
- - java : Add support for Java
- - kde : Add support for KDE (K Desktop Environment)
- - nls : Add Native Language Support (using gettext - GNU locale utilities)
- - perl : Add optional support/bindings for the Perl language
- - python : Add optional support/bindings for the Python language
- - python_targets_python2_6 : Build with Python 2.6
+ + python_targets_python2_7 : Build with Python 2.7
- - ruby : Add support/bindings for the Ruby language
- - sasl : Add support for the Simple Authentication and Security Layer
- - test : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore
- - vim-syntax : Pulls in related vim syntax scripts
- - webdav-neon : Enable WebDAV support using net-libs/neon
- - webdav-serf : Enable WebDAV support using net-libs/serf

$ qsize subversion
dev-vcs/subversion-1.7.14: 126 files, 22 non-files, 4524.747 KB
$ equery s subversion
* dev-vcs/subversion-1.7.14
Total files : 148
Total size : 4.89 MiB

If I enable webdav-neon for HTTP protocol, after re-emerging the package:


$ qsize subversion
dev-vcs/subversion-1.7.14: 130 files, 22 non-files, 4705.387 KB
$ equery s subversion
* dev-vcs/subversion-1.7.14
Total files : 152
Total size : 5.06 MiB

You can see some extra files are installed as well as extra bytes.

Does USE flags provide faster or smaller installation? Maybe, maybe not. But the points:

  1. You know your packages.
  2. Your packages don’t drag baggage into your system.

If you don’t like dependencies, see how Git might bring extra dependencies in:


$ equery d subversion
* These packages depend on subversion:
dev-vcs/git-1.8.3.2-r1 (subversion ? dev-vcs/subversion[-dso,perl])

I can guess in binary distribution, Git is built with Subversion support for majority users, which requires Perl support in Subversion. On my system, it doesn’t have subversion USE enabled, therefore Subversion package isn’t depended. In fact, my system doesn’t even need Subversion.

So to add the points:

  1. Reduce unnecessary dependencies.

USE flags is the most valuable on Gentoo and unique. Other binary-based distributions are more or less the same in my eyes. The package managers might have different names, but almost do the same tasks to install a package, but Gentoo Portage is totally different story, standing out of all package managers, if you line them all up.

Oh yeah, Portage does binary as well, some big packages have binaries, it would be missing the point to have binaries for all packages.