Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
use-flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Mon Dec 31, 2012 2:16 am    Post subject: use-flags Reply with quote

hi,
while reading http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=2 I don't recognize a difference between for example:
Quote:
Let us take a look at a specific example: the kde keyword. If you do not have this keyword in your USE variable, all packages that have optional KDE support will be compiled without KDE support. All packages that have an optional KDE dependency will be installed without installing the KDE libraries (as dependency). If you have defined the kde keyword, then those packages will be compiled with KDE support, and the KDE libraries will be installed as dependency.
to add "-kde" in the make.conf file and just don't write anything of kde at all:
Quote:
To change this default setting, you need to add or remove keywords to the USE variable. This is done globally by defining the USE variable in /etc/portage/make.conf. In this variable you add the extra USE flags you require, or remove the USE flags you don't want. This latter is done by prefixing the keyword with the minus-sign ("-").

is there any difference? I, for example, don't want any Qt/KDE applications and therefore added "-kde -qt" in my make.conf. Would there be anything different if I delete these?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Dec 31, 2012 2:34 am    Post subject: Reply with quote

LoTeK,

The difference depends on your profile.
If the selected profile contains the kde USE flag, you need to set -kde to disable it. If the profile does not contain USE kde, as you say, doing nothing is fine.

To see all the USE flags, look in
Code:
emerge --info
This does not include the content of package.use
_________________
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
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Mon Dec 31, 2012 2:41 am    Post subject: Reply with quote

The default USE flags are set in the profile and in some ebuilds.

So, for example, if you have the default/linux/amd64/10.0/desktop profile set, the "kde" flag is not set by default. If you like KDE applications, you can set the "kde" flag in make.conf, and it will become enabled. On the other hand, if you set the profile to default/linux/amd64/10.0/desktop/kde, the "kde" USE flag will be set by default, without you needing to put it in make.conf. To disable it, you need to set "-kde" in make.conf. Every once in a while profiles are tweaked and USE flags can get set or unset by default.

Sometimes it also makes sense in some ebuilds to have a flag set by default that does not match the value in the profile. Take for example virtualbox. Whatever profile you use, if you try to emerge it, the "qt4" flag will be on unless you set "-qt4" in make.conf. The reason is that most people expect VirtualBox to have a user interface.

So you can use this rule: if you know you want something for all packages, enable the flag in make.conf. If you know you definitely don't want it, disable it. Otherwise, just leave it alone and make a decision if a problem ever comes up. (You can also use package.use for setting USE flags on a package-by-package basis.)
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Mon Dec 31, 2012 3:01 am    Post subject: Reply with quote

on my T420s I use the hardened/linux/amd64 profile and when I run
Code:
emerge --info
there is for example the jpeg useflag. But when I've installed feh (without the jpeg useflag in my make.conf/package.use), after trying to open a *.jpg image the error message "unloadable image, format unspecified etc" appeared and then I've added jpeg in my make.conf, recompiled feh and now it works. So it should have worked without setting jpeg as a global useflag?
Quote:
So you can use this rule: if you know you want something for all packages, enable the flag in make.conf. If you know you definitely don't want it, disable it. Otherwise, just leave it alone and make a decision if a problem ever comes up. (You can also use package.use for setting USE flags on a package-by-package basis.)
Then I'll stick with the "-kde". I'm also not sure if I should let the X-useflag in make.conf or to put it in package.use for every package that needs it, because I only want X-support for packages that wouldn't work without it (but there are many such programs)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Dec 31, 2012 3:06 am    Post subject: Reply with quote

LoTeK,

USE flags control options. IF a package will not complie/work without say X support, is not optional and is not controlled by the X use flag.
That means that setting -X in make.conf is safe
_________________
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
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Jan 10, 2013 2:49 pm    Post subject: Reply with quote

NeddySeagoon,

I just saw this thread https://forums.gentoo.org/viewtopic-t-947494.html and like viciantohun I didn't set the X useflag before I've tried to install openbox and I've got the same error message as him:
Code:
The following REQUIRED_USE flag constraints are unsatisfied:
any-of ( aqua wayland X )

The above constraints are a subset of the following complete expression:
any-of ( aqua wayland X ) xinerama? ( X )

After enabling the X useflag openbox compiled without problems. So Gnome, openbox etc need X-support, therefore it shouldn't be controlled by the useflags?!
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Thu Jan 10, 2013 3:40 pm    Post subject: Reply with quote

actually they only one of the following flags set: aqua wayland or X (all graphical systems)
So someone running a plain wayland system, why would he need X? He could just set -X wayland and the ebuild would be happy.
No one is stopping him from using X in addition, while not forcing it.

I hope my argument is understandable.
V.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Thu Jan 10, 2013 3:48 pm    Post subject: Reply with quote

LoTeK wrote:
Code:
The following REQUIRED_USE flag constraints are unsatisfied:
any-of ( aqua wayland X )

The above constraints are a subset of the following complete expression:
any-of ( aqua wayland X ) xinerama? ( X )

After enabling the X useflag openbox compiled without problems. So Gnome, openbox etc need X-support, therefore it shouldn't be controlled by the useflags?!


The message tells you that the package requires one out of three options, X being one of them, though probably the right one for >=90% of all users: aqua isn't available for Linux and Wayland is still considered experimental. I assume these options aren't mutually exclusive, so having all three available as flags offers the highest flexibility (if they are mutually exclusive X should be enabled by default and be overridden by the other two).

Unfortunately the meaning and handling of USE flags has become a rather complex mess over time, so simple explanations from the past often aren't 100% complete and valid anymore. Foe example, originally there were three locations to enable/disable USE flags with identical syntax, these days I think it's over ten locations with at least three different syntaxes. Also USE flags can be used for much more these days than setting build switches, so semantics get blurred often. Mind there are good reasons for these changes, but they make the subject as a whole much harder to understand and explain.
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Jan 10, 2013 4:17 pm    Post subject: Reply with quote

Quote:
actually they only one of the following flags set: aqua wayland or X (all graphical systems)
So someone running a plain wayland system, why would he need X? He could just set -X wayland and the ebuild would be happy.
No one is stopping him from using X in addition, while not forcing it.
ok, but I meant that:
Quote:
USE flags control options. IF a package will not complie/work without say X support, is not optional and is not controlled by the X use flag.
That means that setting -X in make.conf is safe
means that if I want to compile for example firefox which needs X-support (or any graphical-system or framebuffer if I'm correct?!) then whatever my USE-flags are, firefox compiles every library/dependency that it minimally needs to function properly and if I want to compile for example vim which doesn't need X-support, then portage looks at my /etc/portage/make.conf file and if I have X enabled vim will get compiled with X support otherwise without.
But if Gnome/etc needs one of those three graphics-systems and no USE flag is enabled portage should therefore just install Gnome with one of those, or wouldn't portage do this because the user should have the last word on which graphic-system Gnome builds on?!
Quote:
Unfortunately the meaning and handling of USE flags has become a rather complex mess over time, so simple explanations from the past often aren't 100% complete and valid anymore. Foe example, originally there were three locations to enable/disable USE flags with identical syntax, these days I think it's over ten locations with at least three different syntaxes. Also USE flags can be used for much more these days than setting build switches, so semantics get blurred often. Mind there are good reasons for these changes, but they make the subject as a whole much harder to understand and explain.
or this could be the answer.. :)

I thought that there are only /etc/portage/make.conf(global) and /etc/portage/package.use (local, with higher precedence)...
what are those other uses?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Thu Jan 10, 2013 11:35 pm    Post subject: Reply with quote

LoTeK wrote:
I thought that there are only /etc/portage/make.conf(global) and /etc/portage/package.use (local, with higher precedence)...
what are those other uses?

Disclaimer: I've been out of touch with Gentoo development for a couple years, so the following info may could be incorrect to some degree.

Originally (when I started using Gentoo around 2002) you had to configure USE flags by a) selecting a profile (make.defaults), b) adjust your standard flags via make.conf and c) could override those via the USE environment variable. make.globals could have technically been used, but to my knowledge it never contained a USE setting. I actually forgot about auto-use settings in those days adding a fourth location, but that's a topic you better don't ask about (everyone is happy to not have that anymore).

As the package base grew there was a need to set USE flags (and other stuff) per package in a consistent way, so 2003/2004 /etc/portage/package.use was added. That was still simple enough to understand, even though the implementation was a bit messy.
Later on support for package.use was also added for profiles, you got default USE settings in ebuilds directly, forced overrides via package.use.mask/force, the whole USE_EXPAND system, certain specific flags being triggered by portage internally, the mess called USE-dependencies, the other mess called REQUIRED_USE, proper per-package environment overrides (I think, not sure on that) supporting USE as well and probably a couple more I forgot or don't know about. Oh, and then you can adjust the priority of some of these locations via USE_ORDER if it still exists.

As I said before, there are good reasons for all of these extensions, but they make the topic pretty complicated to understand completely, as you easily get lost in specific details.
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Jan 17, 2013 3:57 pm    Post subject: Reply with quote

sorry for the late reply, (internet problems.. :( )
well, I have pretty messed up my use-flag-configuration.. for example I have set the "debug" flag in /etc/portage/make.conf and then I've read in this thread:https://forums.gentoo.org/viewtopic-t-796014.html that it causes problems.. today I've compiled 8 hours and still can't recompile a few packages...

this is my /etc/portage/make.conf:
Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"

# These are the USE flags that were used in addition to what is provided by the
# profile used for building.

USE="bindist mmx sse sse2 xft jpeg apng hddtemp X cairo dri dga ogg \
usb raw sse3 ssl png pdf gtk opengl jack flac mp3 mp4 gnuplot mplayer \
multilib plotutils sound udev pcmcia smp sound mplayer ncurses fortran \
blas cxx fbcon python alsa bash-completion bcmath branding cups dbus \
debug latex mmap crypt -qt -kde lvm acpi cracklib lm_sensors hardened thinkpad \
pango policykit gudev consolekit smpeg mad mpeg gtk+"

MAKEOPTS="-j5"

INPUT_DEVICES="evdev synaptics"

VIDEO_CARDS="nouveau intel vesa"

GENTOO_MIRRORS="http://gentoo.mneisen.org/ http://mirror.netcologne.de/gentoo/ http://mirror.opteamax.de/gentoo/"


I've seen in the "post your make.conf" thread in the gentoo chat section:
Quote:
I'm using the KDE profile. This is my /etc/portage/make.conf:

Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.

CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="i686-pc-linux-gnu"

# These are the USE flags that were used in addition to what is provided by the
# profile used for building.

USE="qt4 kde -gtk -gnome"

MAKEOPTS="-j2"
ACCEPT_LICENCE="*"

INPUT_DEVICES="evdev synaptics"
VIDEO_CARDS="intel"

SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"

GENTOO_MIRRORS="http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/
http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/
http://mirror.datapipe.net/gentoo
http://mirror.the-best-hosting.net
http://mirrors.rit.edu/gentoo/
http://mirror.mcs.anl.gov/pub/gentoo/
http://mirror.lug.udel.edu/pub/gentoo/
http://gentoo.netnitco.net
http://gentoo.mirrors.tds.net/gentoo
http://gentoo.cites.uiuc.edu/pub/gentoo/"


This may be simple but I've not had one discrepancy with emerge with this setup. Chances are the closer you are to the default the less likely you'll have issues.


which I do like more then mine, are there any recommendations for setting most of the use-flags in packacke.use or is a "bloated" make.conf better?
I would like to have nearly everything in package.use, but can't this be even more sluggish, because of inconsistencies?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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