LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices


Reply
  Search this Thread
Old 10-31-2009, 12:28 AM   #1
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Rep: Reputation: 30
proper use of USE flags


Gentoo is awesome, but I really have no idea if I am taking full advantage of the use flags. Normally I look at all the available use flags from the Gentoo website and stick every use flag I think I need into the /etc/make.conf file. The only problem with this is that a lot of packages have use flags enabled when they dont need to be. For instance, I don't want Amarok using mysql, but it does anyway because the mysql use flag is in make.conf. Basiscaly, I want few packages to use mysql and others not to. Of course a simple solution to this would be to remove mysql from the USE flags in /etc/make.conf and start using the package.use file to select which packages will use mysql. However this seems very tedious. I might have to add an entry into the package.use file for maybe over 100 packages.
I would like to know what is an appropriate list of USE flags I should put in my make.conf file. My system is a laptop that will be used for school, music, few games, and internet.
So what are some good use flags to put in my make.conf that all packages should use. Everything else ill just put into my package.use file.
 
Old 10-31-2009, 02:27 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello hosler,

as described in the Gentoo-handbook you can set the use-flags individually for every package. Therefor you'll have to create a file "/etc/portage/package.use". In your example of amarok and mysql you may insert a line
Code:
media-sound/amarok -mysql
May be that I wrong with the following suggestion since I'm new to Gentoo as well. I set only a few "systemwide" use-flags in /etc/make.conf. When emerging a package, I do a
Code:
emerge -pv package
and look at the use-flags which are enabled and which are disabled. And if I want to change this, I insert an entry in the package.use-file.
An easy method to change the useflags for a single emerge is to
Code:
USE="-mysql +anything" emerge anypackage
Note that you can both, add and remove use-flags with an entry in package.use.

Markus

Last edited by markush; 10-31-2009 at 06:27 AM.
 
Old 10-31-2009, 01:27 PM   #3
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Original Poster
Rep: Reputation: 30
I know how use flags works. I was just wondering if putting them all in the make.conf is even a good idea. If it's not, then what are some use flags that are good for the make.conf file?
 
Old 10-31-2009, 01:31 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello hosler,

this will depend on your needs. As an example my useflags for my current desktop-system: the line in my /etc/make.conf
Code:
USE="-ipv6 -kde X alsa cdr dvd hal acpi"
I'm not using kde or gnome but fvwm2 as a windowmanager.

To answer your question: I do not think, that it is a good idea to put them all into the make.conf.

Markus

Last edited by markush; 10-31-2009 at 02:09 PM.
 
Old 10-31-2009, 01:36 PM   #5
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
You can continue to use global USE flags in /etc/make.conf. This is handy in general.

Use package.use to disable or enable flags for particular ebuilds.
If you disable flags you should have a huge package.use file.

Example ... I use KDE so I have added the kde USE flag globally.
I do not want celestia to use kde as KDE4 is currently not supported ... so I add this entry to package.use:

sci-astronomy/celestia -kde
 
Old 10-31-2009, 11:02 PM   #6
Acron_0248
Member
 
Registered: Feb 2006
Location: Venezuela
Distribution: Gentoo
Posts: 453

Rep: Reputation: 33
As have been already said, a "good flag" is different for every user and that's basically the point of using gentoo, every user can customize it based on personal needs.

Myself, I have this on my make.conf file
Code:
USE="X -accessibility alsa -apm -arts bash-completion -berkdb -bonobo bzip2 -cups curl dbus -eds -esd -fam -gd -gdbm -gnome -gpm gtk2 hal imagemagick -ipv6 -kde -kerberos -ldap -minimal -mozilla -motif mmx nls opengl -oss pch -pam -qt -qt3 -qt4 -samba sse sse2 -ssl tiff truetype vim-syntax -xinerama zlib"
and a lot of people would see that like a lot of USEs, others would say otherwise. I don't really care about gnome or kde so I don't want packages downloading dependencies of those environments just because such USE is in place, however I do care about vim so I really like every package capable of having a syntax file to be downloaded thus vim-syntax set in there is a very good choice for me.

Of course, my package.use had grow a lot over the time, however, I still prefer to have such a file in charge of any customization instead of dealing with many global USEs.

Try to keep focus on the packages more important to you, check the USEs of those packages individually and if you see a particular USE that affects many or all of those packages then you might have a candidate global USE.

Regards
 
Old 11-01-2009, 06:01 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
No one can tell you what USE flags you will need. You will polish your config as you continue using Gentoo and learn how USEs affect each particular package.

Generally, people set the general case in make.conf, for example, if you want mysql support turned on for most packages, then you add "mysql" to your make.conf, on the contrary, if you want it disabled for most packages, then you use "-mysql" in your make.conf. Then you use package.use to add exceptions.

But this is entirely a matter of taste, after years of polishing and fine tuning I don't even have an USE definition in my make.conf, I use package.use exclusively to set all my use flags. It's quite big.
 
Old 11-16-2009, 04:23 PM   #8
ursusca
Member
 
Registered: Sep 2008
Location: Toronto, ON, Canada
Distribution: Gentoo, RHEL (Fedora, CentOS, OEL), Ubuntu, FreeBSD, Solaris 10
Posts: 170

Rep: Reputation: 34
Hi,

Also it might be a good idea to try desktop profile for you. You will have the USE flags preset that you need for a desktop.
 
Old 11-20-2009, 04:33 PM   #9
d2_racing
Gentoo support team
 
Registered: May 2009
Location: Ste-Foy,Québec,Canada
Distribution: Gentoo
Posts: 115

Rep: Reputation: 17
In fact, I use the desktop profile for at least 2 years and because of that, I have only this :

Code:
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
USE="kde -gnome kdeenablefinal xcomposite nls truetype userlocales unicode -firefox xulrunner apache2 mysql mysqli simplexml"
LINGUAS="fr"
INPUT_DEVICES="keyboard mouse evdev"
VIDEO_CARDS="vesa nvidia"

#SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync2.ca.gentoo.org/gentoo-portage"

PORTAGE_ELOG_CLASSES="log warn error info"
PORTAGE_ELOG_SYSTEM="echo:log,warn save:log,warn,error,info syslog:error"

#PORTDIR="/home/sylvain/git/portage"
Pretty small make.conf.
 
Old 12-24-2009, 06:46 AM   #10
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
So basically, I don't need to set USE flags of a package in the make.conf file for installing just that package. I can specify the USE flags for that package at the command line or in etc/portage/package.use. Am I correct?

Let's I need to install a package like MPlayer. According to this guide, I need to setup framebuffer and alsa. Now let us assume that I never had them, would emerge download them as dependencies if I tried to install Mplayer?

Assume I already have installed framebuffer and alsa. While installing MPlayer, would I have to set the USE flags of framebuffer and alsa along with mplayer's USE flags?
 
Old 12-24-2009, 08:19 AM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by gregorian View Post
So basically, I don't need to set USE flags of a package in the make.conf file for installing just that package. I can specify the USE flags for that package at the command line or in etc/portage/package.use. Am I correct?
USE flags in make.conf are global, they will be used for *all* the packages. If you set USE="alsa" in make.conf, then all packages that have the "alsa" USE flag will enable it.

USE flags in package.use affect only the package you specify.

USE flags that you supply in command line are not recorded, that means that the next time that package is re-emerged all your USE settings will be reverted to the default state. In short never ever do it this way unless you enjoy trouble. Setting USE in command line is only advised when you are doing some check, for example when using -pv:

Code:
USE="foo -bar moo -cow" emerge -pv <whatever>
Then look at the output, set the USE flags the real way (either in make.conf or package.use) and run the emerge command without -p.

Quote:
Let's I need to install a package like MPlayer. According to this guide, I need to setup framebuffer and alsa. Now let us assume that I never had them, would emerge download them as dependencies if I tried to install Mplayer?
You don't need alsa nor framebuffer for mplayer to work, but if you want to use them just set the right USE flags (again, either in make.conf or package.use) and then emerge mplayer. USE flags can (and will) push any needed package as a dependency, and will configure mplayer to compile and link against the required libraries. This doesn't mean that you don't need extra setup. If you have never used the framebuffer or alsa then you are going to need to set them up first. If they are not running mplayer can't use them of course.

There are guides for both. Both alsa and fb need kernel support, alsa will need at least a correct mixer setting (make sure vol is not zeroed nor muted, etc), fb will need that you set the right video mode on the kernel boot line (usually in grub.conf). How to write that parameter entirely depend on the fb driver that you use. Some fb drivers will also need special setup, like in the case of uvesafb.

For extra help with any of these open a new specific thread.

Quote:
Assume I already have installed framebuffer and alsa. While installing MPlayer, would I have to set the USE flags of framebuffer and alsa along with mplayer's USE flags?
If you want to take advantage of these capabilities in mplayer then you need to make sure that these flags are enabled for mplayer when emerging it (look at the -pv or -av output). USE flags will push dependencies, yes, but that's not the only thing they do. They can be used to control configure parameters which will ultimately determine the features that are compiled into a given package.
 
Old 01-18-2010, 02:01 PM   #12
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Original Poster
Rep: Reputation: 30
After I do an install of Gentoo, I have been just going through the list of global USE flags and adding the ones I think I would want and need for my system. Doing this, however, makes my make.conf file look massive with all the use flags in it. There are so many global use flags available, and I don't know which are important and which to leave out of the make.conf file.
I'll do what most of you said and experiment on my own to find the best configuration for my system.

Thanks guys
 
Old 01-19-2010, 03:52 AM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Getting used to the USE flags system can take a long time, but don't worry too much about them. Eventually you will get the hang of it. There's nothing wrong with a big make.conf, but if you are patient enough you can always migrate all the flags to package.use, that can be time consuming and quite boring. I guess you could also put them into a separate file and then use the "source" shell statement from make.conf to read the secondary file, much like you do when using layman overlays. Never tested it.
 
Old 03-07-2010, 07:36 PM   #14
dpminusa
LQ Newbie
 
Registered: Mar 2010
Location: USA
Distribution: Gentoo
Posts: 16

Rep: Reputation: 1
Post Gentoo Defaults

In my experience so far the USE flags are great in Gentoo but can lead to a lot of dependency issues and tuning.

Your '/etc/make.profile' links to the default profile for your architecture. You can see the defaults for USE suggested in '/usr/portage/profiles/targets'.

For example a desktop:
/usr/portage/profiles/targets/desktop

This gives you an idea of what Gentoo thinks are the best flags for a desktop. The Gentoo blog articles I have seen stress that they realize a basic desktop should not include KDE and Gnome unless the user wants them and adds them later.

This may offer some guidance.
 
Old 03-09-2010, 04:37 PM   #15
d2_racing
Gentoo support team
 
Registered: May 2009
Location: Ste-Foy,Québec,Canada
Distribution: Gentoo
Posts: 115

Rep: Reputation: 17
And for the profile, you can run this and see what you can select :

Code:
# eselect profile list
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USE flags deucedlt Linux - Distributions 3 02-24-2008 03:25 PM
CC flags and the like Garp Linux - Software 2 05-17-2004 03:48 AM
What means: ...proper Python link flags? BroX Linux - Software 5 04-21-2004 09:40 PM
user flags Comarez Linux - Newbie 7 01-25-2004 07:22 AM
bbpager flags mrsolo Linux - Software 1 06-26-2003 12:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration