Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE flag related question
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
Dale__
n00b
n00b


Joined: 18 Apr 2015
Posts: 55

PostPosted: Thu Aug 11, 2016 10:44 pm    Post subject: USE flag related question Reply with quote

I read over the following link a couple times

https://devmanual.gentoo.org/general-concepts/use-flags/index.html

I gather:

1) global USE flags go in /etc/portage/make.conf

2) local USE flags go in /etc/portage/package.use/package where the package file is the name of the package

if I look at a package, mutt for instance

https://packages.gentoo.org/packages/mail-client/mutt

there seems to be a lot of global flags, this seems to make a long USE category in /etc/portage/make.conf

I understand that you might not use all local flags, do you have to use all global flags?

is it local or global if you use USE in an emerge command, does this play well with the portage tree, profile, or anything else this n00b doesn't know

my installation is AMD64 multilib mostly following the handbook, using genkernel, on an old machine
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Thu Aug 11, 2016 11:39 pm    Post subject: Reply with quote

Hi,
I don't think it's quite as complex as you are making it:

Quote:
1) global USE flags go in /etc/portage/make.conf


What I do is let the profile decide what flags to set in make.conf, and not touch the settings there otherwise unless really necessary.

All of the useflags can be set on a per-package basis in package.use

A good way to get your head around these is to
Code:
emerge gentoolkit
and use the equery tool to see a brief description of available flags, and a summary of which of those will be activated by your default profile, for your mutt example - on a the machine I'm using today running profile
Code:
[5]   default/linux/amd64/13.0/desktop/gnome/systemd *
equery tells me
Code:
ian@lw3 ~ $ equery u mutt
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for mail-client/mutt-1.5.24-r2:
 U I
 + + berkdb       : Add support for sys-libs/db (Berkeley DB for MySQL)
 + + crypt        : Add support for encryption -- using mcrypt or gpg where applicable
 - - 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
 - - doc          : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 + + gdbm         : Add support for sys-libs/gdbm (GNU database libraries)
 - - gpg          : Enable support for app-crypt/gpgme
 - - idn          : Enable support for Internationalized Domain Names
 - - imap         : Add support for IMAP (Internet Mail Application Protocol)
 - - kerberos     : Add kerberos support
 - - mbox         : Add support for mbox (/var/spool/mail) style mail spools
 + + nls          : Add Native Language Support (using gettext - GNU locale utilities)
 - - nntp         : Add support for newsgroups (Network News Transfer Protocol)
 - - pop          : Enable support for POP3
 - - qdbm         : Add support for the qdbm (Quick Database Manager) library
 - - sasl         : Add support for the Simple Authentication and Security Layer
 - - sidebar      : Enable the sidebar feature
 - - slang        : Add support for the slang text display library (it's like ncurses, but different)
 - - smime        : Enable support for smime
 - - smtp         : Enable support for smtp
 + + ssl          : Add support for Secure Socket Layer connections
 - - tokyocabinet : Enable tokyocabinet database backend for header caching
mutt will be built with + + support. If I needed additional functionality, I'd add an entry to package.use to enable it. Portage will then sort out any dependencies from there.

Does that answer the question?
Back to top
View user's profile Send private message
Dale__
n00b
n00b


Joined: 18 Apr 2015
Posts: 55

PostPosted: Thu Aug 11, 2016 11:58 pm    Post subject: Reply with quote

yes, this seems easy enough for me, I'll give it a try and get back, thanks much
Back to top
View user's profile Send private message
i4dnf
Apprentice
Apprentice


Joined: 18 Sep 2005
Posts: 265
Location: Bucharest, Romania

PostPosted: Thu Aug 11, 2016 11:59 pm    Post subject: Reply with quote

"global" means that flag is [dis]enabled for all packages that have it when you set it in /etc/portage/make.conf, e.g. if your make.conf contains:
Code:
USE="-png"

will disable png support for all packages.
"local" means the flags is [dis]enabled for the package specified at the beginning of the line in the file in /etc/portage/package.use, e.g if in the example above you want gimp to have png support you would put a line in a file /etc/portage/package.use/enablepngforgimp that contains:
Code:
media-gfx/gimp  png

that will enable png support for gimp and only for gimp.

Note: the above example might require additional packages to have the png flag enabled, so don't take it literally

Code:
USE="png" emerge gimp

enables the png flag just for this invocation of[/i] emerge, subsequent invocations without USE="png" will use the system settings in the above mentioned locations.
This way of setting use flags is not recommended, and should be avoided.
_________________
"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Fri Aug 12, 2016 12:06 am    Post subject: Reply with quote

You are reading too much into global vs local.

Global simply means the option exists on many packages and does roughly the same thing. For example, USE="gtk" builds the package to use the gtk GUI library while USE="qt5" uses the qt5 library. Local is something that isn't a universal. For example, a package might include the option to build a calculator and have a USE="calculator" option. Another package might use the same thing to build an internal calculator or a third party calculator.

This might give you a better idea

Either can go in make.conf or in package.use. In general, put big things in make.conf and tweaks in package.use. For example, if you want to be able to print from all your programs add cups to make.conf. On the other hand, you might just want wicd to use the gtk library to keep everything else consistent with qt5 as much as possible, so you would put that in package.use.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Fri Aug 12, 2016 12:12 am    Post subject: Reply with quote

Dale__ wrote:
yes, this seems easy enough for me, I'll give it a try and get back, thanks much

You're welcome. Just one thing I'd add, whenever I make changes to my package.use I make a point of running the following emerge command with the -pv switch first to see what the ramifications of the change will be, before starting to change my system. Sometimes what looks like a simple change will want to pull in a long dependency chain, require other changes in package.use etc... I like to get an overview of what's going to change before committing to it.

Have fun,
Back to top
View user's profile Send private message
Dale__
n00b
n00b


Joined: 18 Apr 2015
Posts: 55

PostPosted: Fri Aug 12, 2016 11:26 pm    Post subject: Reply with quote

looks like gentoolkit will be a study ... did some studying and not done yet

I found the make.globals file
/usr/share/portage/config/make.globals

do I just add a line like
USE="flag"
there isn't a USE line now

for locals my installation has a package.use directory
/etc/portage/package.use

I gather I add a package file like
mail-client/mutt
and a USE line within it like
USE="flag"

I would use the package page to see my options like
https://packages.gentoo.org/packages/mail-client/mutt

am I on the right track?
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Sat Aug 13, 2016 12:28 am    Post subject: Reply with quote

If using the directory, you can just create a file called ie: mutt
Code:
# touch /etc/portage/package.use/mutt

then add your flags, space separated to that file in the following format ie:
Code:
# echo 'mail-client/mutt imap kerebos nntp' > /etc/portage/package.use/mutt

(not recommending those flags, just an example - I don't use mutt)

You can check your file
Code:
cat /etc/portage/package.use/mutt
or do it all in an editor if you're happier to do that.

Cheers
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Sat Aug 13, 2016 12:37 am    Post subject: Reply with quote

Sorry, missed this bit:
Quote:
I would use the package page to see my options like
https://packages.gentoo.org/packages/mail-client/mutt


Don't try to eat the whole of gentoolkit in one sitting, try
Code:
equery -h
and
Code:
man equery
for starters, use that to list the flag options for your packages, it's preferable (and probably more reliably current) than using a web-page. try a few simple commands
Code:
equery u mutt
would be a good start
Back to top
View user's profile Send private message
Dale__
n00b
n00b


Joined: 18 Apr 2015
Posts: 55

PostPosted: Sat Aug 13, 2016 12:54 am    Post subject: Reply with quote

THANKS!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7090
Location: Saint Amant, Acadiana

PostPosted: Sat Aug 13, 2016 1:09 am    Post subject: Reply with quote

It would be nice if ebuild maintainers maintained some consistency, see caps USE flag [ab]use for instance.
Code:
 ~ $ euse -i caps
global use flags (searching: caps)
************************************************************
[-      ] caps - Use Linux capabilities library to control privilege

local use flags (searching: caps)
************************************************************
[-      ] caps
    kde-frameworks/kinit: Capabilities support for improved security and
    better OOM handling
        [+ B] (5/5.23) 5.23.0 [gentoo]
        [+ B] (5/5.24) 5.24.0 [gentoo]

[-      ] caps
    net-fs/cifs-utils: libcap support
        [+ B] 6.4 [gentoo]
        [+ B] 6.5 [gentoo]

[-      ] caps
    sys-apps/util-linux: build setpriv helper (run programs with diff
    capabilities)
        [-  ] 2.26.2 [gentoo]
        [-  ] 2.27.1 [gentoo]
        [-  ] 2.28 [gentoo]
        [-  ] 2.28.1 [gentoo]
        [-  ] 9999 [gentoo]

_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Sat Aug 13, 2016 1:33 am    Post subject: Reply with quote

Jaglover wrote:
It would be nice if ebuild maintainers maintained some consistency, see caps USE flag [ab]use for instance.

Yep, that's ordinary - but I don't think the OP needs to worry about that issue at this point?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7090
Location: Saint Amant, Acadiana

PostPosted: Sat Aug 13, 2016 1:49 am    Post subject: Reply with quote

It illustrates there is no clear line between global and per package USE flags.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 309

PostPosted: Sat Aug 13, 2016 10:51 am    Post subject: Reply with quote

@OP Since you are not developing packages whether USE flags are global or local is less relevant, you just want the right USE flags for packages emerged on your system.

I suggest you try
Code:
emerge -pv mutt

to see what USE flag combination will be applied if you emerge mutt.

If you find a USE flag you want to change for mutt only then it should go in /etc/portage/package.use or /etc/portage/package.use/use_whatever_filename_means_something_to_you you are the admin for your system so get to decide how you want to arrange package.use

After making the changes run
Code:
emerge -pv mutt

again to make sure the changes you have made have the desired effect.

If you find a USE flag you want to change for most packages on your system then add them in /etc/portage/make.conf
After you have done this I suggest you run
Code:
emerge -pvDN @world
to check what impact this will have on your system.

You should find even if you put local USE information in make.conf you still get the end results you require. I switched some time ago to having things which are system wide in make.conf and everything else in package.use/files_per_package which works for me. I also have a /etc/portage/package.use/zzz-portage-changes file so emerge updates get dumped into a single file where I can keep automatic updates or transfer them to individual package.use/package_name files which contain my manually set per package information ;)

I tend to look in /usr/portage/profile/use.desc and /usr/portage/profile/use.local.desc for USE flag descriptions first, and search other places like the net after if I need additional information.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Aug 13, 2016 11:17 am    Post subject: Reply with quote

Dale__,

The distinction between global and local USE flags is political. Uses can ignore it.
A global use flag is one that appears on a number of packages to do approximately the same thing and all the devs involved have agreed on the what and USE flag description.
If later, another package wants to do the same thing, its expected to use the same flag and description.
A local USE flag can be invented by a single dev at any time without asking anyone. That's important to devs, it allows new packages with new optional features to be added to the tree without any consultation period. The dev need only ensure the new local USE is unique.
Local USE flags tend to get promoted to global as more packages using the same new feature are added.

Global and local use flags all do the same thing from the user perspective.
The use of global to the install (that a different use of the word global) settings in make.conf and per package USE settings has already been covered.
_________________
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
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Sat Aug 13, 2016 1:37 pm    Post subject: Reply with quote

If you activate a USE flag in /etc/portage/package.use for all packages who feature it than, you have set it globally for the moment without having activate it globally in /etc/portage/make.conf.

In the same order of ideas, if you activate a USE flag in make.conf and it is a feature of only one package it have been set globally. Tweak, hack, bad or good it depend of what you want to do.

:D
_________________
Paul
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