2

Gentoo Linux portage relies on USE flags to customize compiling options for software. Here's an example showing how to organize USE flags in a make.conf file:

# ************ USE **************
# ******** profile 'kde' ********
MYPROFILE="apache2 mysql"
HW="3dnow -bluetooth directfb fbcon hddtemp lm_sensors mmx nvidia smp svga xcomposite xvmc"
SYSTEM="caps -cups curl -fortran java nsplugin -oss syslog"
NET="-ipv6 -isdnlog -ldap ppp wifi"
CMDL="bash-completion gpm offensive vim-syntax"
KDE="htmlhandbook plasma semantic-desktop"
GNOME_DEPS="gstreamer -gtk"
DEV="tidy vhosts"
MMEDIA="aalib cdda cddb css dvb exif ffmpeg fontconfig gd gimp gphoto2 imagemagick libcaca lame matroska mplayer musicbrainz quicktime theora v4l v4l2 xine xpm xscreensaver"

USE="${MYPROFILE} ${HW} ${SYSTEM} ${NET} ${CMDL} ${GNOME_DEPS} ${KDE} ${DEV} ${MMEDIA}"

And this configuration is meant to upstage (because of precedence) the cumulative 13.0 profile containing the default flags for instance:

(This example is the sum of the settings in base, default/linux,
 default/linux/x86 and default/linux/x86/13.0/)
USE="a52 aac acpi alsa branding cairo cdr dbus dts dvd dvdr emboss encode exif
fam firefox flac gif gpm gtk hal jpeg lcms ldap libnotify mad mikmod mng mp3
mp4 mpeg ogg opengl pango pdf png ppds qt3support qt4 sdl spell
startup-notification svg tiff truetype vorbis unicode usb X xcb x264 xml xv
xvid"
  • What is the difference between removing support for a feature that appears in the defaults by using -useflag in the make.conf file vs. not having a feature in the cumulative defaults at all and having nothing related to it either in the make.conf file?
  • Can an application sourced from the default profile be qualified in relation to a standard application compiled in one of the standard Linux distributions? (is the default profile close to some "standard" or is it already a pretty much customized subset?)
  • Is it really an issue nowadays to select a no-multilib profile for the whole build?
  • It's been a while since I've used Gentoo, but my understanding is that if you do not specify +flag or -flag, you will get the ebuild's default settings, whereas if you specify -flag, you will override the default. – DopeGhoti Jan 8 '14 at 21:25
  • @DopeGhoti Ok, actually I have an issue with how precedence of per app specs vs. make.conf vs. defaults interact with how USE flags "propagate" in the tree. I'll think it over. – user44370 Jan 8 '14 at 22:00
  • The order of precedence : package.use overrides make.conf overrides profile defaults. – casey Jan 8 '14 at 22:54
  • Recently "emerged". First of all, despite adding only a few USE flags, emerge --info yields tons more than the cumulative profile in the Q. My tr command is 1k smaller than in Arch. Not sure how to investigate differences. Compiled 250-300 elements including Xorg, gcc, gimp and all the base with insuring further --deep --with-bdeps=y, all in no-multilib/march=core2. With firefox-bin. So far no issue. Can't believe all that stuff was compiled with basically no error to speak of and no need to hunt for configuration deps. Quite enabling. – user44370 Jan 10 '14 at 0:58
3

What is the difference between removing support for a feature that appears in the defaults by using -useflag in the make.conf file vs. not having a feature in the cumulative defaults at all and having nothing related to it either in the make.conf file?

It is more complex than that, the order of USE flag as seen by Portage are determined by USE_ORDER = "env:pkg:conf:defaults:pkginternal:repo:env.d" (default, can be overriden in /etc/{,portage/}make.conf; see man make.conf for more details) which means that all these locations override what is set in latter mentioned locations in that variable.

To simplify this down, your question is regarding pkginternal and repo here; respectively the internal package USE flags and the repository, you'll notice here that the package can override the defaults in the repository.

This happens when a package explicitly uses +flag or -flag syntax, in which case that is used in further consideration; if however just flag without suffix is used, the default setting that came from the repository (or env.d) is used instead.

If no default setting exists, it is disabled that default; this makes sense, as the profiles enable things as well as that having every feature on by default would enable way too much.

If you bubble this up (passing along conf, which is /etc/{,portage/}make.conf); the same continues to apply, a default setting not existing anywhere means the USE flag is disabled.

Can an application sourced from the default profile be qualified in relation to a standard application compiled in one of the standard Linux distributions? (is the default profile close to some "standard" or is it already a pretty much customized subset?)

In a standard Linux distribution you would get a package with a lot of features enabled; however, on Gentoo you get to choose which features you will want to enable. The most sane USE flags a majority would want are online; but beyond that, support for different kind of formats, protocols, features, ... and so on you need to specifically turn it on.

To get a better idea about this; take a look at the USE flags in emerge -pv media-video/vlc. To get a more detailed described list of this; do emerge gentoolkit, then equery u media-video/vlc.

On a side note, you'll find some desktop related USE flags enabled in the desktop profile; as well as server related USE flags enabled in the server profile, and so on...

Is it really an issue nowadays to select a no-multilib profile for the whole build?

No comment on this, you can try to ask for pro and cons on the forums; I run a multilib profile to be on the safe side. I'd say this only really makes sense if you run a system where you know that you will not need 32-bit applications; you can note by the list of those that exist that there are no desktop or server specific ones present:

 $ find /usr/portage/profiles/ -name '*no-multilib*'
/usr/portage/profiles/hardened/linux/amd64/no-multilib
/usr/portage/profiles/arch/amd64/no-multilib
/usr/portage/profiles/default/linux/amd64/10.0/no-multilib
/usr/portage/profiles/default/linux/amd64/13.0/no-multilib

Thus choosing such profile would also make you lose the defaults desktop / server can provide; however, the amount of defaults is rather limited, you can very well replicate them in your make.conf if you really believe you need a no-multilib profile for your workflow.

  • That was really interesting and thorough. I cannot do +2. I did not even know there was a difference between "+flag" and just "flag". Actually I am running profile 9 i.e. no multilib and I wanted no desktop profiling as I intended to install Openbox bare on X. First Gentoo install ever. And have no kernel support for ia32. I have yet to find a situation where there was an issue with that... Sometimes I get something like I needed to use the "audit" flag for PAM to enable something but haven't run into issues that I'm aware of. Just a desktop user here (beginner). Thanks for the insight! – user44370 Feb 6 '14 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy