Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[sigh] I still don't get the USE variables. (I do now)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Fitzsimmons
Guru
Guru


Joined: 01 Jan 2003
Posts: 415
Location: Waterloo, Ontario, Canada

PostPosted: Fri Jan 03, 2003 4:48 pm    Post subject: [sigh] I still don't get the USE variables. (I do now) Reply with quote

Well... I guess it would help if I knew exactly what these things do at the code level. I will try to explain where I am confused.

Lets say for example, since I am running and Intel, I would want the x86 USE variable - that's nice... everything works. But... what if I don't specify any processor type? Then what?

How about gnome and kde? What makes them so special that they get their own? What would happen if I compiled something without the gnome use variable, and then went ahead and used it from gnome? What would be different than if the USE variable was there? Heck... what if I compile a bunch of things assuming that there is some USE variable that I don't need, and it turns out later that I do need it? Does that mean that I need to recompile my entire system?

Please help a dissillusioned n00b. I'm messed. BTW, anyone who has a say about anything might consider revising the USE variable HOWTO so that it makes sence to n00bs like me.


Last edited by Fitzsimmons on Fri Jan 03, 2003 10:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Fri Jan 03, 2003 5:02 pm    Post subject: Reply with quote

as far as i know, it' used as a flag during compilation. it effects packages that have this option (e.g. mplayer has a gnome and gtk feature)

e.g. if you use USE "-gnome kde" and emerge a package, it would be the same as downloading the source code of that package and compilig it using "--wihtout-gnome --with-kde" flags
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1408
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Fri Jan 03, 2003 5:11 pm    Post subject: Reply with quote

Basically USE variables are interesting little toys (actually options or switches to ebuild packages.) So lets just answer one question at a time here. I will now stage a theoretical situation (since I cannot think of an easy real-world example -- I know they exist but I think I might simply muddy the water more with them if I tried.) Lets say there is some ebuild package called "Mr BonezTheGoon's Handy Util" that does something groovy that everyone needs and it only does this in a graphical environment. Now lets just say that by default the ebuild has been written in such a way that the "Util" only runs in a KDE gui environment--BUT-- in the infinite wisdom of the ebuild maintainer/creator they have given you the OPTION to over-ride this default in two ways. They have allowed you to specify the '-KDE' variable and also the 'gnome' which will turn OFF support for the KDE environment and turn ON the support for the Gnome environment. Alternatively you have the luxurious option of specifying just 'gnome' which will allow support for BOTH KDE and Gnome simultaneously for the "Mr BonezTheGoon's Handy Util." Now in this simple little theoretical example situation you can see that a lot depends on the actual ebuild and how it is constructed and what it accepts as variables/options.

So the general idea of USE variables is to allow you to communicate with ebuild packages about what you want them to do, your own direct customizations of the ebuild packages (but only the ebuild packages which allow you to do this.) Some ebuild packages build with support for gnome regardless of USE variables, these ebuilds will effectively ignore a global declaration of '-gnome' given you asked the package to be installed and that it depends on gnome. So in short the USE variables you declare do not have meaning in every ebuild package. Also each ebuild likely has it's own default configuration of certain USE variables--which you can over-ride have you chosen to do so.

At the code level, since you mention it, these basically pass specific arguments to the make command that tell it to build the new app with the specified options available and to compile in the needed libraries and such for it to work properly.

The reason gnome and kde get their own USE variables is because some applications can be compiled with support for either or both of the two desktop environments, and some people (including me) generally use one environment more heavily than the other and so only compile support for one of them into those apps that support both -- which allows the said apps to be smaller in size and therefore likely more efficient (which usually results in better performance somewhere.)

If you did compile a bunch of ebuilds without a USE setting you needed (say you wanted KDE support on somethings that didn't default with KDE support) you will need to specify the USE variable and then recompile the apps in question.

Hope that can answer at least some of your questions, with out causing any new illusions!

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Fri Jan 03, 2003 5:16 pm    Post subject: Reply with quote

wow! 8O

that's what i was thinking of, but i see you have a gift to put it in a lot more words than i do (which is not necessarily bad) :)
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1408
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Fri Jan 03, 2003 5:23 pm    Post subject: Reply with quote

I'm always embarrassed at the length of my posts, brevity is a talent especially when tied to clarity. Personally I bet your earlier post (the one you posted so stealthily whilst I typed my dissertation) is more effective for 95% of the world, especially if they have ever built any apps from scratch (I mean tarball, not C coding.) Anyway, I have dogged on myself in many other threads about how long winded I am--I apologize once again. I also would like to thank the world+dog for still posting short replies in addition to my monstrosities so that those faint of heart can get good nuggets of information they couldn't tolerate from me!

Anyway, away my mouth goes again off. . . . . .off into the distance!

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
Fitzsimmons
Guru
Guru


Joined: 01 Jan 2003
Posts: 415
Location: Waterloo, Ontario, Canada

PostPosted: Fri Jan 03, 2003 6:18 pm    Post subject: Reply with quote

Ok... I will go with the same example. I am using Mr BonezTheGoon's Handy Util but I am running blackbox. I have set both -gnome and -kde (and maybe -gtk -qt - would prog still compile with these?). Will the Util still run at all? And, while i'm at it... since I don't know much about graphics, are you saying that with a simple flag something written for kde/qt can be magically converted into gnome/gtk at compile time? I think this is where I was hung up. Your description was very good though.

PS. There's nothing wrong with long posts - don't let anyone pressure you into making them shorter!! :D

Thanks.
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Fri Jan 03, 2003 6:19 pm    Post subject: Reply with quote

no, don't get me wrong ...your posts aren't only longer they are even more thourough, so some (more experienced) may even get more info reading them ...besides they are funny :)
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1408
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Fri Jan 03, 2003 6:59 pm    Post subject: Reply with quote

hook wrote:
no, don't get me wrong


Hey man I was not upset, I only replied to let you know that I hadn't seen your post until after I posted -- and to let you know that I thought the information you posted was VERY informative!

ssjf, yes your app will still compile and run, at some point it will likely "ignore" one of your USE settings so that it can install with some kind of gui library. Forgive me for not knowing more specifics about which app to reference in the real world but there are some apps that are written in gtk and others in qt (this you already know.) So to answer this question:
ssjf wrote:
"are you saying that with a simple flag something written for kde/qt can be magically converted into gnome/gtk at compile time?"
No. The ebuild must support building the app for gnome, which generally means the app was already written such that it specially and explicitly accepts compile time arguments to direct what support should be built. Nothing magic there at all. So to tackle a whole other topic that is so close to this one . . .

There could be some other app called "ssfj's revolutionary thingy" that was only designed for KDE. Now notice how carefully I worded that (I had to edit it once already because what I had first written was incorrect.) This program "ssfj's revolutionary thingy" can and will run in blackbox/fluxbox/enlightenment/gnome . . . (you get it already, right?) . . . just fine so long as the needed libraries and such are available. So lets make pretend again that we have someone that is running blackbox that wants to use "ssfj's revolutionary thingy" and they have declared (long long ago in the install of their gentoo system) that they do not want support for KDE or Gnome compiled into those packages where it is optional (notice the careful wording again.) So in this persons /etc/make.conf they have somewhere in the USE line "-kde -gnome." If this person then tries to emerge the "srt" (can I just shorten "ssfj's revolutionary thingy" to "srt"?) and they were careful to do what the Gentoo Developers tell us to, and actually did a pretend emerge they would notice that a WHOLE LOT of KDE is going to be installed on the system before "srt" will install. So does this mean that this imaginary person who has so much venom towards KDE, and so much joy associated to Blackbox will need to run KDE every time they want to use the "srt"? Nope, it doesn't mean that at all. You will be able to use the application from within Blackbox so long as all the dependencies are met and are working OK (generally meaning nothing broke during the emerge process.) So again to reiterate:

USE variables are often times ignored if a package depends (requires) something that has been 'disabled' via USE settings

USE variables are often times ignored if the variable has no meaning within the ebuild at hand

USE variables CAN change what support is compiled into an application, and so if you needed specific support but forgot the USE variable you will need to define the variable and then recompile the specified application.

Does that answer all the questions now?

ssjf wrote:
There's nothing wrong with long posts


Sometimes there is no avoiding them, I just think long posts should be the exception to the rule. Unfortunately for me, and why I complain about it, it tends to be the rule.

hook wrote:
besides they are funny

I'm glad humor is able to jump across the digital medium, I never can tell if any emotion gets across with my words. I try to be funny and poke fun at myself in an effort to make people comfortable, and also to let people know I certainly don't know everything nor do I pretend to be getting close to doing so.

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
TripKnot
Apprentice
Apprentice


Joined: 29 May 2002
Posts: 213

PostPosted: Fri Jan 03, 2003 7:09 pm    Post subject: Reply with quote

I'm going to give a specific real world example, spew a few more words and I hope you all understand what I'm going to say because I'm not sure if I'm going to understand myself.

Ok, there are hard and soft dependencies listed in ebuilds. A hard dependency is if a package _needs_ some, lets say, gnome libs to work then it will override your -gnome, if present, in your USE and compile only the gnome libs it needs.

A soft dependency is optional. These can often add functionality if present. Lets use Mplayer as a real world example. A look through the mplayer ebuild shows about 15 options that can be enabled with use flags, dvd, alsa, opengl, and directfb amongst others. Your USE settings determine if DVD support, alsa sound support, opengl video output support or console framebuffer display support is included when compiling mplayer. Appropriate USE flags can greatly expand the usefullness of some apps or keep out options that you know you will never use and keep down the bloat.

USE flags cannot automagically convert, say Konqueror from KDE, to run in any other environment without the KDE libs. Not gonna happen.

Also, in case you were wondering, the -gtk USE flag is bad. Many more apps are compiled for the GTK widget set over QT (In fact the only two things I have found that use QT is KDE and, optionally, chromium.) Not having gtk really kills a lot of features in programs to the point that some become unusable. -kde -qt -gnome are all fine though and are what I use for my systems.

EDIT: A nice feature I'd like to see in the future is a portage option in conjunction with package maintainers to provide details on what effects available soft deps in ebuilds have on the functionality on the compiled app. This could help many people understand the effect of USE flags much better.
Back to top
View user's profile Send private message
Fitzsimmons
Guru
Guru


Joined: 01 Jan 2003
Posts: 415
Location: Waterloo, Ontario, Canada

PostPosted: Fri Jan 03, 2003 7:27 pm    Post subject: Reply with quote

Great I have got it! :D (:roll: I think.)

If I have "-kde" in my USE= when I emerge srt it is not going to merge KDE along with srt - it is going to merge the graphic libraries only. This is because the program simply cannot run without these libraries, so the "-kde" is ignored, but only to the point where the app can be successfully compiled.

...
But if if have "kde" in my USE= is is going to merge all of KDE before merging srt (unless KDE is already merged).

A confirmation is what I am looking for here, BTW.
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1408
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Fri Jan 03, 2003 8:26 pm    Post subject: Reply with quote

ssjf wrote:
If I have "-kde" in my USE= when I emerge srt it is not going to merge KDE along with srt - it is going to merge the graphic libraries only. This is because the program simply cannot run without these libraries, so the "-kde" is ignored, but only to the point where the app can be successfully compiled.


This is right, for most apps (I cannot guarentee that all ebuilds will work this way, but this should be a very good description for the NORM.)

ssjf wrote:
But if if have "kde" in my USE= is is going to merge all of KDE before merging srt (unless KDE is already merged).


The existance of the 'kde' USE variable should have no immediate affect on srt given it REQUIRES (hard dependancy as TripKnot pointed out) the KDE libs to function. The existance of the 'kde' USE variable does (in a well maintained system anyway) imply that KDE is already in use or is going to be in use though.

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
Fitzsimmons
Guru
Guru


Joined: 01 Jan 2003
Posts: 415
Location: Waterloo, Ontario, Canada

PostPosted: Fri Jan 03, 2003 8:39 pm    Post subject: Reply with quote

Ok thanks for all of your help.

That certainly clarified a lot of things for me. If you could add something like this to the FAQ, I think that a lot of other newbs would be really happy.

Now all I need to do is choose which USE variables I should use... that's probably going to take a while (like 5 minutes).

Thanks again.

SSJF
Back to top
View user's profile Send private message
jonaswidarsson
Apprentice
Apprentice


Joined: 16 Jan 2004
Posts: 273
Location: Göteborg, Sweden

PostPosted: Sat Jan 17, 2004 4:22 pm    Post subject: Reply with quote

Picking old thread up... I read it all first, and it was really helpful.

I searhed these forums to get to know whether there is a way to be "safe" with a chioce of USE flags. As I said, the thread was helpful, but I'd like to ask:

How can I assure my use-flags won't annoy me in case of being insufficiently set or cleared?

More precisely:
If I know what hardware drivers I want to use (dvd alsa and so on) and if I know what system I will rely on (kde appletalk blah blah), will that be sufficient for being safe in future emerges?

I like gentoo and have completed one server install from stage1 but haven't taken very much time to examine it yet. I am about to give my laptop a gentoo desktop install very soon. I read the gentoo-user mailing list for a month and was scared of how many times people had issues with missing use flags. That is something I have against gentoo.

I guess there is a possibility to be really bloated by issuing USE="+everything". But I should be safe then, shouldn't I?

I want to USE my computer, not admin it. (flame war trigger) Don't get back to me now and say that I should run mandrake or something. I am willing to learn. I am just asking you how I can be as safe with my flags as possible.

Very big thank you!

Jonas
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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