Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Interpret wiki USE flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
djwave28
n00b
n00b


Joined: 14 Apr 2016
Posts: 18

PostPosted: Sat May 14, 2016 6:42 am    Post subject: Interpret wiki USE flags Reply with quote

I have once successfully installed GNOME as a desktop, but after getting more educated on the systemd/openRC am now looking at Openbox .. I am totally new to gentoo and played around some with the emerge and other settings in Gentoo.

When I look at the info on the site for Openbox, i see an intro on USE flags ..

https://wiki.gentoo.org/wiki/Openbox

I get a bit uncertain when I see this. Do I need to add these flags or does the system do that? It is not only here when I get this feeling, so in general it will help me.

I also chose for profile just the desktop version. Do I need to set "-gnome -kde"?

Can somebody bounce me off in the right direction?

Thanks
_________________
Go with the flow like a dead fish!

CPU: i7-2600K
GPU: Radeon HD 6970
Mon: HDTV 1440x900 (Philips 19PFL5422D/27)
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Sat May 14, 2016 8:02 am    Post subject: Reply with quote

To solve your confusion about USE flags you might want to read:
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat May 14, 2016 12:04 pm    Post subject: Re: Interpret wiki USE flags Reply with quote

djwave28 wrote:
When I look at the info on the site for Openbox, i see an intro on USE flags [...] I get a bit uncertain when I see this. Do I need to add these flags or does the system do that? It is not only here when I get this feeling, so in general it will help me.

djwave ... those useflags are a list of all the possible useflags that can be set/unset for that package:

emerge -NC u x11-wm/openbox:
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for x11-wm/openbox-3.5.2-r1:
 U I
 - - branding                 : Enable Gentoo specific branding
 - - 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
 - - imlib                    : Add support for imlib, an image loading and rendering library
 - - nls                      : Add Native Language Support (using gettext - GNU locale utilities)
 + + python_targets_python2_7 : Build with Python 2.7
 + + session                  : Enables support for session managers
 - - startup-notification     : Enable application startup event feedback mechanism
 - - static-libs              : Build static versions of dynamic libraries as well
 - - svg                      : Add support for SVG (Scalable Vector Graphics)
 - - xdg                      : Install the python xdg files for xdg autostart

The first field ("U") denote those 'set' (ie, via the profile, make.conf, or package.use), the second field ("I") denote those set via "IUSE" (in the ebuild).

So, say I want support for 'startup-notification' and 'imlib' I might do the following:

/etc/portage/package.use:
x11-wm/openbox imlib startup-notification

This would then produce the following use settings:

emerge -pvq x11-wm/openbox:
[ebuild N  ] x11-libs/libXinerama-1.1.3  USE="-static-libs"
[ebuild N  ] x11-wm/openbox-3.5.2-r1  USE="imlib session startup-notification -branding -debug -nls -static-libs -svg -xdg" PYTHON_TARGETS="python2_7"

That's really all there is to it, but obviously understanding what each useflag enables/disables it key. Generally the profile, and IUSE, should get you something usable without your having to explictly define some set of useflags, so you can consider such things as allowing the ability to fine tune these to your particular liking/needs.

djwave28 wrote:
I also chose for profile just the desktop version. Do I need to set "-gnome -kde"?

If you're nolonger using gnome then a 'desktop', or 'default', profile should be set, this will probably require that you 'emerge --changed-use @world' to bring the useflags into a consistant state. Setting '-gnome -kde' probably isn't needed, though you can do so if it seems some part of these will be pulled in. Note that an 'emerge --depclean --ask' should be performed subsequent to unmerging 'gnome' so that all of its dependencies are similarly removed.

HTH & best ... khay
Back to top
View user's profile Send private message
djwave28
n00b
n00b


Joined: 14 Apr 2016
Posts: 18

PostPosted: Sat May 14, 2016 2:15 pm    Post subject: Reply with quote

charles17 wrote:
To solve your confusion about USE flags you might want to read:


Thank you charles17. i have been reading about USE flags before and understand they can be applied globally in the make.conf file as well as locally on a per package basis in the package.use file. Then there is of course the default set of USE flags

The thing is that I see these flags with a package and wonder whether I should set them or not. Of course reading and talking in the forum helps the mindset :wink:
_________________
Go with the flow like a dead fish!

CPU: i7-2600K
GPU: Radeon HD 6970
Mon: HDTV 1440x900 (Philips 19PFL5422D/27)
Back to top
View user's profile Send private message
djwave28
n00b
n00b


Joined: 14 Apr 2016
Posts: 18

PostPosted: Sat May 14, 2016 3:52 pm    Post subject: Re: Interpret wiki USE flags Reply with quote

Thanks Khay,

First off I killed my GNOME/systemd and started over. I already run CentOS with GNOME and wanted to try something else.
You give me a perfect example where I start to doubt myself.

/etc/portage/package.use:
x11-wm/openbox imlib startup-notification


In the documentation on the Openbox page, these flags you use are stated "global". Why do you you add these in the package.use file and not in make.conf?

So the flags specified in that list are "optional". I would not need them and will not get them, unless i specifically ask for them?

Code:
imlib - global
nls -    global
session - local


Would I need to add "imlib" to the USE in make.conf and "session" in the package.use?

Thanks again. I am just trying to keep some sanity with it and not clutter my USE flags. It does help :D
_________________
Go with the flow like a dead fish!

CPU: i7-2600K
GPU: Radeon HD 6970
Mon: HDTV 1440x900 (Philips 19PFL5422D/27)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Sun May 15, 2016 12:03 am    Post subject: Reply with quote

Your question seems more "when using useflag globally and when per package"?

Take a simple useflag example: mp3
If you add it globally then any package that use the mp3 useflag will be built with it
and if you add it specifically, then all your packages remain as they are, and the specified package will have mp3 useflag enable.

Why would you get scared to use mp3 globally then?
because some people love to tune their system as small as it could be, no need for mp3 support in vlc if you never play mp3 or any video with mp3 audio in it.

And also because you might not really knows to what "mp3" useflag could be use. While a package might have reading mp3 support always enable, the package may also create mp3 but optionally, instead of building a "mp3save" useflag, the dev might re-use the "mp3" useflag, and so, for this package, mp3 will enable recording mp3, while without it, mp3 reading is always enable.
And if the package use some external libs or package to record mp3, the package will enable deps for that, and all this for a feature you will never use.
Devs try to reuse useflag, but the real meaning for mp3 should be "Add support for reading mp3 files", but in real, you have no guaranty a dev won't use it for something different (in my example, it would not be use to enable reading, but to enable recording). I'm unsure if a real policy exist except a kind of "don't abuse them". But for some people enabling recording of mp3 thru that useflag might be seen as abusing.

But if in your mind: "i care about mp3". enabling mp3 globally should provide mp3 support as much as possible. And a package you didn't even think about will have mp3 enable (let's take a stupid example, mp3 might enable mp3 support on some office app and you didn't knew or think that app could do that).

You can temporary enable/disable a useflag to see its impact on your system: USE="flag -flag" emerge -pvN world
And you can see its impact on a package the same way or check what they "should" do with equery (khayyam mistake the output source, it's not from emerge, but from equery).

While it's also natural to think only about enabling useflag on per package, it's also worth to mention you could also disable them thru it.
You can add mp3 globally (in make.conf so) and -mp3 in package.use for vlc, so mp3 everywhere but not for vlc.

So if you are in doubt, it's better to limit useflag to the application and enable the ones you wish globally without thinking about the application itself but for your system. ie: if you have a need for nls in openbox, your whole system should also have that need, and nls might be better use globally.
Back to top
View user's profile Send private message
djwave28
n00b
n00b


Joined: 14 Apr 2016
Posts: 18

PostPosted: Sun May 15, 2016 7:00 pm    Post subject: Reply with quote

Thank you Krinn,

A somewhat soothing explanation. I understand that i am in control, but for a beginner it is impossible to know all these flags and what they stand for. Moreover what the impact is on the system. Surely the mp3 example is quite clear, but there are lots that I don't have affinity with that require further study.

What risk would be involved if I ignore the USE flags and start tuning afterwards when I slowly master the meaning of these flags? How would I determine if USE flags are "mandatory"?
_________________
Go with the flow like a dead fish!

CPU: i7-2600K
GPU: Radeon HD 6970
Mon: HDTV 1440x900 (Philips 19PFL5422D/27)
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Sun May 15, 2016 7:17 pm    Post subject: Reply with quote

djwave28 wrote:
for a beginner it is impossible to know all these flags and what they stand for


You can always have it explained by `quse -D theflag`or similar commands.

djwave28 wrote:
What risk would be involved if I ignore the USE flags and start tuning afterwards when I slowly master the meaning of these flags?


That's what you should be doing anyhow. Don't set use flags blindly. Change your useflags when you know they need changing and why.

Changing useflags can be done any time you like. It only means recompiling some things. (emerge --newuse)


Last edited by frostschutz on Sun May 15, 2016 8:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun May 15, 2016 7:19 pm    Post subject: Reply with quote

Mandatory USE flags you will not see. Conditionally mandatory USE flags you will see and portage will tell you if there is a conflict.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun May 15, 2016 8:05 pm    Post subject: Reply with quote

djwave28 wrote:
A somewhat soothing explanation. I understand that i am in control, but for a beginner it is impossible to know all these flags and what they stand for. Moreover what the impact is on the system. Surely the mp3 example is quite clear, but there are lots that I don't have affinity with that require further study.

djwave28 ... and that is the situation many beginners find themselves in, mostly because there is the tendency to think that useflags are critical when they are not, they are just a tool that allows to you tune your system to your liking. That tuning happens as and when your understanding grows, so incrementally over time, its far more organic than "do I need x,y,z", or "what does x,y,z do". No one can really answer the first question as that depends on what *you* are trying to achieve (within the context of your understanding that goal), and the second question is partially answered via 'equery', or asking, and like the mp3 example things get clearer as your understanding grows. As for the plethora of useflags, a great many you will probably never encounter (ie, 'urandom', 'hs2-0', 'thin', etc, etc) and so don't need to worry about what they might do, this is mostly taken care of via the profile, or IUSE.

djwave28 wrote:
What risk would be involved if I ignore the USE flags and start tuning afterward when I slowly master the meaning of these flags? How owulde I determine if USE flags are "mandatory"?

By definition no useflags are mandatory, they are optional. If a package requires a useflag (because some other useflag on the target atom requires it) then emerge will inform you of this.

best ... khay
Back to top
View user's profile Send private message
djwave28
n00b
n00b


Joined: 14 Apr 2016
Posts: 18

PostPosted: Sun May 15, 2016 11:09 pm    Post subject: Reply with quote

Thanks all ...!!

I am getting a better picture now and look at these flags with less anxiety ... :)

Thanks for the great help here !!!


Greetz!
_________________
Go with the flow like a dead fish!

CPU: i7-2600K
GPU: Radeon HD 6970
Mon: HDTV 1440x900 (Philips 19PFL5422D/27)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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