Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help me understand the goal behind USE flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
DanielC
n00b
n00b


Joined: 07 Sep 2015
Posts: 25
Location: Sweden

PostPosted: Wed Sep 09, 2015 9:26 pm    Post subject: Help me understand the goal behind USE flags Reply with quote

Hello all,

I know conceptually what USE flags are, and I know that they are supposed to be one of the big advantages of Gentoo. But in practice I don't know what to do with them. For example, I honestly cannot think of a single program that I use that has optional support for (say) KDE, or ALSA, or what-not.

Can you help me understand USE flags are useful? Can you name a program that you use turned out more to your liking because you had your USE flags set?

Cheers,
Daniel.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Wed Sep 09, 2015 9:37 pm    Post subject: Reply with quote

Usually the use flags will enable or disable chunks of functionality or features. I tend to not mess with the USE flags until I need a feature that is not in the default settings.

A good example might be vlc. The package supports a lot of USE flags. I currently don't have support for bluray, but if I suddenly wanted to use vlc for a bluray movie, I would set the bluray USE flag and rebuild vlc.

Use 'equery' from the gentoolkit package:

Code:
$ equery uses vlc


In my case, I get this:
Code:
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-video/vlc-2.1.5-r1:
 U I
 + + X                      : Enables support for, e.g., fullscreen mode via the X Window System. By
                              itself, this flag does not build a graphical interface.
 + + a52                    : Enable support for decoding ATSC A/52 streams used in DVD
 - - aalib                  : Add support for media-libs/aalib (ASCII-Graphics Library)
 + + alsa                   : Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
 - - atmo                   : Enables support for AtmoLight (homebrew Ambient Lighting Technology)
 - - audioqueue             : Enables AudioQueue audio module for Mac OS X.
 - - avahi                  : Add avahi/Zeroconf support
 + + avcodec                : Enables libavcodec support for video/audio encoding/decoding. libavcodec
                              is part of FFmpeg.
 + + avformat               : Enables libformat support for reading and writing various media
                              containers. libavformat is part of FFmpeg.
 + + bidi                   : Enable bidirectional language support
 - - bluray                 : Enables libbluray for Blu-ray disc support.
 + + cdda                   : Add Compact Disk Digital Audio (Standard Audio CD) support
 - - cddb                   : Access cddb servers to retrieve and submit information about compact
                              disks
 - - chromaprint            : Enables libchromaprint for Chromaprint based audio fingerprinter
                              support.
 + + cpu_flags_x86_mmx      : Use the MMX instruction set
 + + cpu_flags_x86_sse      : Use the SSE instruction set
 + + dbus                   : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)
 - - dc1394                 : Enables IIDC cameras support.
 - - debug                  : Enable extra debug codepaths, like asserts and extra output. If you want
                              to get meaningful backtraces see
                              https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - dirac                  : Enable Dirac video support (an advanced royalty-free video compression
                              format) via the reference library: dirac.
 - - directfb               : Add support for DirectFB layer (library for FB devices)
 + + dts                    : Enable DTS Coherent Acoustics decoder support
 - - dvb                    : Add support for DVB (Digital Video Broadcasting)
 + + dvbpsi                 : Enables support for Mpeg-TS files (.ts, .m2ts, .mts) via
                              media-libs/libdvbpsi.
 + + dvd                    : Add support for DVDs
 - - egl                    : Enables EGL video output module.
 + + encode                 : Add support for encoding of audio or video files
 - - faad                   : Enable AAC audio decoding library support via media-libs/faad2.
 - - fdk                    : Enables the Fraunhofer AAC codec library.
 + + ffmpeg                 : Enable ffmpeg/libav-based audio/video codec support
 + + flac                   : Add support for FLAC: Free Lossless Audio Codec
 - - fluidsynth             : Enables Fluidsynth MIDI software synthesis (with external sound fonts).
 - - fontconfig             : Support for configuring and customizing font access via
                              media-libs/fontconfig
 + + gcrypt                 : Enables cryptography support via libgcrypt.
 - - gme                    : Enables support for media-libs/game-music-emu for playing various video
                              game music formats.
 - - gnome                  : Adds support for GNOME's filesystem abstraction layer,
                              gnome-base/gnome-vfs. This flag is not GUI-related.
 + + gnutls                 : Add support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)
 - - growl                  : Enables growl notification support (over UDP for remote access and
                              native on OSX)
 + + httpd                  : Enables a web based interface for vlc.
 - - ieee1394               : Enable FireWire/iLink IEEE1394 support (dv, camera, ...)
 - - jack                   : Add support for the JACK Audio Connection Kit
 - - kate                   : Adds support for Ogg Kate subtitles via libkate.
 - - kde                    : Add support for KDE (K Desktop Environment)
 - - libass                 : SRT/SSA/ASS (SubRip / SubStation Alpha) subtitle support
 - - libav                  : Prefer libav over ffmpeg whenever both are supported
 - - libcaca                : Add support for colored ASCII-art graphics
 - - libnotify              : Enable desktop notification support
 - - libsamplerate          : Build with support for converting sample rates using libsamplerate
 - - libtar                 : Uses libtar instead of the built-in tar reader for reading custom skins.
 - - libtiger               : Enables Ogg Kate subtitles rendering using libtiger.
 - - linsys                 : Enables support for Linux Linear Systems Ltd. SDI and HD-SDI input
                              cards.
 - - lirc                   : Add support for lirc (Linux's Infra-Red Remote Control)
 + + live                   : Enables live555 streaming media support (client support for rtsp).
 + + lua                    : Enable Lua scripting support, needed for including support for Jamendo
                              (online music platform) and similar things.
 - - macosx                 : Enables Mac OS X gui support.
 - - macosx-audio           : Enables Mac OS X audio module.
 - - macosx-dialog-provider : Enables Mac OS X dialog module.
 - - macosx-eyetv           : Enables Mac OS X EyeTV (TNT Tuner) module.
 - - macosx-qtkit           : Enables Mac OS X qtkit module: qtcapture (video) and qtsound (audio)
                              module.
 - - macosx-quartztext      : Enables Mac OS X quartz text module.
 - - macosx-vout            : Enables Mac OS X video output module.
 + + matroska               : Enables matroska support using reference libraries (fallback on other
                              existing matroska support if disabled, i.e., matroska enabled FFmpeg)
 - - modplug                : Add libmodplug support for playing SoundTracker-style music files
 + + mp3                    : Add support for reading mp3 files
 + + mpeg                   : Add libmpeg3 support to various packages
 - - mtp                    : Enable support for Media Transfer Protocol
 - - musepack               : Enable support for the musepack audio codec
 + + ncurses                : Add ncurses support (console display library)
 + + ogg                    : Add support for the Ogg container format (commonly used by Vorbis,
                              Theora and flac)
 - - omxil                  : Enables OpenMAX Integration Layer codec module.
 - - opencv                 : Enabled OpenCV (computer vision) filter module.
 + + opengl                 : Add support for OpenGL (3D graphics)
 - - optimisememory         : Enable optimisation for memory rather than performance.
 - - png                    : Add support for libpng (PNG images)
 + + postproc               : Enables image post-processing via libpostproc (part of FFmpeg).
 - - projectm               : Enables the projectM visualization plugin.
 - - pulseaudio             : Add support for PulseAudio sound server
 + + qt4                    : (Restricted to >=media-video/vlc-0.9)
                              Builds a Qt4 based frontend, a graphical interface.
 - - rdp                    : Enables freerdp for RDP/Remote Desktop client support
 + + rtsp                   : Enables real audio and RTSP modules.
 - - run-as-root            : Allows vlc to start for root. Don't enable this unless you have a very
                              specific (e.g. embedded) need for it!
 + + samba                  : Add support for SAMBA (Windows File and Printer sharing)
 - - schroedinger           : Enable Dirac video support (an advanced royalty-free video compression
                              format) via libschroedinger (high-speed implementation in C of the Dirac
                              codec).
 + + sdl                    : Add support for Simple Direct Layer (media library)
 - - sdl-image              : Enables sdl image video decoder (depends on sdl)
 - - sftp                   : Enables libssh2 to support SFTP file transfer.
 - - shout                  : Enables libshout output.
 - - sid                    : Adds support for playing C64 SID files through media-libs/libsidplay-2.
 - - skins                  : Enables support for the skins2 interface.
 - - speex                  : Add support for the speex audio codec (used for speech)
 - - svg                    : Add support for SVG (Scalable Vector Graphics)
 + + swscale                : Enables image scaling and conversion via libswscale (part of FFmpeg).
 - - taglib                 : Enable tagging support with taglib
 - - 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
 + + theora                 : Add support for the Theora Video Compression Codec
 - - tremor                 : Enables tremor, a fixed-point version of the Ogg Vorbis decoder.
 + + truetype               : Add support for FreeType and/or FreeType2 fonts
 - - twolame                : Enables twolame support (MPEG Audio Layer 2 encoder).
 - - udev                   : Enable virtual/udev integration (device discovery, power and storage
                              device support, etc)
 + + upnp                   : Enables support for the Intel SDK stack based UPnP discovery module
                              instead of CyberLink.
 - - v4l                    : Enable support for video4linux (using linux-headers or userspace libv4l
                              libraries)
 - - vaapi                  : Enable Video Acceleration API for hardware decoding
 - - vcdx                   : Enables VCD with navigation via libvcdinfo (depends on cdio)
 - - vdpau                  : Enable the Video Decode and Presentation API for Unix acceleration
                              interface
 + + vlm                    : New videolan (media) manager (vlm), a little manager designed to launch
                              and manage multiple streams from within one instance of VLC.
 + + vnc                    : Enable VNC (remote desktop viewer) support
 - - vorbis                 : Add support for the OggVorbis audio codec
 - - wma-fixed              : Enables fixed point WMA decoder.
 + + x264                   : Enable h264 encoding using x264
 + + xcb                    : Support the X C-language Binding, a replacement for Xlib; !!! you will
                              need this option to be able to integrate video in the Qt interface, see
                              bug #500678.
 - - xml                    : Add support for XML files
 + + xv                     : Add in optional support for the Xvideo extension (an X API for video
                              playback)
 - - zvbi                   : Enables support for teletext subtitles via the zvbi library.


HTH
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 118

PostPosted: Wed Sep 09, 2015 10:05 pm    Post subject: Reply with quote

Well, for instance, I turned off policykit, consolekit, udisks, cups, nls, a variety of languages, kde, gnome, ncurses, doc, handbook and a variety of other things that are commonly on.

And lo and behold, I thus have no policykit, consolekit, udisks, cups, nls, a variety of languages, kde, and gnome on my system. I do have ncurses on my system though since it's often nonoptional, I only have it turned off where it is optional. One of the more interesting things is that I lack a top command because I emerged procps without ncurses.

I find it had to believe that not some part of your system has optional support for some of the things listed above.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
DanielC
n00b
n00b


Joined: 07 Sep 2015
Posts: 25
Location: Sweden

PostPosted: Wed Sep 09, 2015 11:14 pm    Post subject: Reply with quote

russK wrote:

A good example might be vlc. The package supports a lot of USE flags. I currently don't have support for bluray, but if I suddenly wanted to use vlc for a bluray movie, I would set the bluray USE flag and rebuild vlc.

Use 'equery' from the gentoolkit package:

Code:
$ equery uses vlc


In my case, I get this:
Code:
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-video/vlc-2.1.5-r1:
 U I
 + + X                      : Enables support for, e.g., fullscreen mode via the X Window System. By
                              itself, this flag does not build a graphical interface.
 + + a52                    : Enable support for decoding ATSC A/52 streams used in DVD
 - - aalib                  : Add support for media-libs/aalib (ASCII-Graphics Library)
 ...



Thanks! That's a good example. That's also a very useful command. Now I have a way to find out what USE flags I should consider changing.
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Sat Oct 24, 2015 11:04 pm    Post subject: Reply with quote

I'll give another example that might be more common than those already presented. I run a KDE desktop. However, my favorite email program is Balsa, which is a gnome application. If I simply emerged balsa, it would drag in all sorts of gnome libraries and applications, and might (it's been a long time since I set this up) even try to bring in systemd, which I have chosen not to use. So, I globally set -gnome (in make.conf) and balsa only pulls in those gnome pieces which are absolutely necessary for it to compile and run. There are also some specific applications where I have to turn on the gnome use flag (in packages.use) in order to get them to install at all, or to be able to turn on some other use flag I want. It would be similar with kde if you wanted to use some particular kde application, but you use a lighter weight desktop and wanted to avoid the entire kde desktop and associated bloat.
Back to top
View user's profile Send private message
Abraxas
l33t
l33t


Joined: 25 May 2003
Posts: 814

PostPosted: Sat Nov 14, 2015 1:06 pm    Post subject: Reply with quote

I'll give another USE case. I use gnome. Generally I globally disable QT and then re-enable it per application for applications that only have a QT interface that I want a GUI for. I do this for a lot of things. Sometimes there are choices for libraries you can use and if I prefer one I will disable the others unless a particular application can only use that specific library.
_________________
Time makes more converts than reason. - Thomas Paine
Travel is fatal to prejudice, bigotry, and narrow-mindedness, and many of our people need it sorely on these accounts. - Mark Twain
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sat Nov 14, 2015 4:22 pm    Post subject: Reply with quote

DanielC,

Here is an example you can try at home.

After updating your system do
Code:
USE=-alsa emerge -pvN @world
the -p option is important, don't let it build anything.
Every package listed with -alsa* has optional alsa support that is presently on.

For multimedia packages, turning off alsa means, in most cases, you won't get any audio output. That's not an error, its a configuration option.
A few packages offer both alsa and oss support. You can choose one, the other or neither.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
-Fin-roller
n00b
n00b


Joined: 13 Aug 2015
Posts: 14
Location: Paimio

PostPosted: Sun Nov 22, 2015 8:00 am    Post subject: Reply with quote

One package that also demonstrates this is media-video/ffmpeg. You're probably going to decode and encode video with your computer and ffmpeg is used to do a lot of that. Just prepare to get a bit confused and check out
Code:
emerge -vp ffmpeg
=). There's all sort of stuff you can enable and disable at your discretion. Fortunately there is a wiki page (https://wiki.gentoo.org/wiki/Ffmpeg) about it.

I don't know if say Ubuntu's ffmpeg is compiled with "gsm lossy speech compression algorithm". But if it is: why? I'm never going to use that. It's probably not a big thing or anything, but why would I want to carry around that when I'm obviously never going to need that? Then again, if it isn't compiled with Ubuntu's ffmpeg, you'd be in trouble if you ran Ubuntu and happened to be one of the three guys on the planet that actually need that support. With USE flags it's only matter of tuning your make.conf and recompiling the package.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum