Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to choose 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
viio
n00b
n00b


Joined: 17 Mar 2020
Posts: 33

PostPosted: Sat Mar 21, 2020 1:20 pm    Post subject: How to choose USE flags? Reply with quote

Hi,

I've installed Gentoo with the "default/linux/amd64/17.1/hardened (stable)" profile.

Currently no custom USE flags are set.

I am wondering what's best practice to choose USE flags?
I guess going through this list from top to bottom doesn't make much sense.

My goal is to have a very minimal desktop configuration with X and a window manager like i3.
So I guess I could add "-gnome -kde -xfce" as a basis.

Before I install a new package, how can I see the USE flags it will be build with?
Then I can look closer to the description of these flags and either set/unset them globally or for this package only.


PS: This forum is missing an inline code BBCode.
Back to top
View user's profile Send private message
alexander-n8hgeg5e
n00b
n00b


Joined: 02 Nov 2019
Posts: 58

PostPosted: Sat Mar 21, 2020 1:42 pm    Post subject: Reply with quote

if you emerge with --ask and --verbose the use-flags will be shown and you
will be asked whether you want to proceed.

For use-flags it think, just add them from time to time if you feel
you want to.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31618
Location: here

PostPosted: Sat Mar 21, 2020 1:52 pm    Post subject: Reply with quote

The profiles add all you need to run correctly each one.
If you use a window manager you can choose desktop profile.
If in the time you need some use flag you can add it globally in make.conf or for single package in /etc/portage/package.use and the run emerge -UD @world command for apply new use flag to all installed packages
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3686

PostPosted: Sat Mar 21, 2020 3:47 pm    Post subject: Re: How to choose USE flags? Reply with quote

viio wrote:
So I guess I could add "-gnome -kde -xfce" as a basis.

Unless some package you want to install pulls in stuff you don't want, there is no need for that.
The profile you selected has those flags not enabled, so you don't need to disable them.
Back to top
View user's profile Send private message
CBf9YHqgmkfqQe
n00b
n00b


Joined: 21 Mar 2020
Posts: 2

PostPosted: Sat Mar 21, 2020 5:46 pm    Post subject: Reply with quote

I wouldn't start by blindly adding a whole ton of use flags until you know what they do. It's best to slowly add them over time. Start off with easy ones you know you want or don't want. For example, if you don't like KDE, you could do "-qt5 -kde" or something along those lines.

Use "emerge --preview --verbose package-name-here-lol" and it shows you all the USE flags that a specific package uses, use that tool to figure what USE flags to add or remove over time. Also if you're unsure what a specific USE flag does, the "euses my-awesome-use-flag" package is very useful, as it searches by USE flags and gives you a short description on what that USE flag does, so you can be more educated on if you should add/remove that flag from your global USE flags, or just make it program specific.

More USE flags is not better, in fact I'd argue you want as minimal as possible. Too many USE flags that are randomly added can cause conflicts in the future. Be educated with the "euses" program to be sure you really want to add it to your global USE flag.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


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

PostPosted: Sat Mar 21, 2020 5:51 pm    Post subject: Reply with quote

app-portage/ufed is a great tool to set your global flags, and more.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
viio
n00b
n00b


Joined: 17 Mar 2020
Posts: 33

PostPosted: Sat Mar 21, 2020 5:54 pm    Post subject: Reply with quote

Thanks everyone for the input.

The "emerge --verbose --preview" command is exactly what I was looking for. :)

Both euse and ufed look nice, but currently I'm fine applying the changes manually to the specific files.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3686

PostPosted: Sat Mar 21, 2020 5:59 pm    Post subject: Reply with quote

Replace it with "emerge --verbose --pretend --ask"
Back to top
View user's profile Send private message
AlexJGreen
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2018
Posts: 149

PostPosted: Sat Mar 21, 2020 6:07 pm    Post subject: Re: How to choose USE flags? Reply with quote

_

Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
389292
Guru
Guru


Joined: 26 Mar 2019
Posts: 504

PostPosted: Sat Mar 21, 2020 6:52 pm    Post subject: Reply with quote

When I first started I just compared base and desktop profile USE flags, and then chose base profile and put what I need from desktop to make.conf It were most of the flags, but not all of them. It does make sense to go through that list if you want a complete list of flags even for something you may install in the future.
Back to top
View user's profile Send private message
viio
n00b
n00b


Joined: 17 Mar 2020
Posts: 33

PostPosted: Sat Mar 21, 2020 9:34 pm    Post subject: Reply with quote

etnull wrote:
When I first started I just compared base and desktop profile USE flags


That's a good idea.
Thanks.

I know I can list all flags of the current profile with "emerge --info".
But how could I see which flags some other profiles use?
Back to top
View user's profile Send private message
389292
Guru
Guru


Joined: 26 Mar 2019
Posts: 504

PostPosted: Sat Mar 21, 2020 9:46 pm    Post subject: Reply with quote

If I remember correctly I just 'eselect profile set' to the needed one temporarily. It should also be somewhere in the guts of portage, but I don't remember the directory without research.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Sat Mar 21, 2020 9:55 pm    Post subject: Reply with quote

viio wrote:
But how could I see which flags some other profiles use?

I have NO-MULTILIB, but also want KDE. But there is no profile for this. So I know only one trick:

1. Do an emerge --info and write down (or copy to a file) all used USE-Flags.
2. Then change with eselect profile to a desktop profile you wish.
3. Do an emerge --info again and save now the used USE-Flags.
3. Change back with eselect profile to your original profile.
4. Pull in all new USE-Flags in you make.conf.
Back to top
View user's profile Send private message
AlexJGreen
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2018
Posts: 149

PostPosted: Sun Mar 22, 2020 7:52 pm    Post subject: Reply with quote

_

Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Wed Mar 25, 2020 8:21 am    Post subject: Reply with quote

coderanger wrote:
https://wiki.gentoo.org/wiki/Profile_(Portage)#Combining_profiles

Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ... so my solution for now is: Copying all the stuff from .../target/desktop and .../target/desktop/plasma into my /etc/portage.

I would like to know why it is so impossible for the gentoo developers to give us just 4 profiles more ... :-(
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3686

PostPosted: Wed Mar 25, 2020 8:24 am    Post subject: Reply with quote

pietinger wrote:
coderanger wrote:
https://wiki.gentoo.org/wiki/Profile_(Portage)#Combining_profiles

Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ...

You are not alone ...
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31618
Location: here

PostPosted: Wed Mar 25, 2020 9:03 am    Post subject: Reply with quote

coderanger wrote:
pietinger wrote:
I have NO-MULTILIB, but also want KDE. But there is no profile for this.

[url=https://wiki.gentoo.org/wiki/Profile_(Portage)#Combining_profiles]Combining profiles[/url]

If you need to combine two existing profiles it's no so complicate.
First you should create a local overlay, after that the steps are (in this example I combine no-multilib with plasma for amd64 arch):
  • create profile directory in local overlay with mkdir -p /var/db/repos/local/profiles/no-multilib-plasma, where no-multilib-plasma is the profile name
  • create parent file with plasma and no-multilib: echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
  • the last step is add profile in profiles.desc with echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc

At this point you can select profile with eselect
Code:
$ eselect profile list
Available profile symlink targets:
...
[35]  local:no-multilib-plasma (dev)

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Wed Mar 25, 2020 9:58 am    Post subject: Reply with quote

fedeliallalinea wrote:
First you should create a local overlay, after that the steps [...]


Thank you very much, fedeliallalinea. You help me again. You said, I have to create a local overlay. I found some information and put them together in "Step 1", but I am not sure, if it is complete.

So, may I ask you again: Would be step 1 correct ? Is it all I would need (or too much) ?

--- Step 1: Creating a local repo

# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===

--- Step 2: From fedeliallalinea

# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
#echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
#echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31618
Location: here

PostPosted: Wed Mar 25, 2020 10:06 am    Post subject: Reply with quote

Step 1 seems looks ok
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Wed Mar 25, 2020 10:10 am    Post subject: Reply with quote

fedeliallalinea wrote:
Step 1 seems looks ok


Thank you again ... (you are fast as a shark :D )
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Wed Mar 25, 2020 10:47 am    Post subject: Reply with quote

I did it ... and had the problem with "multilib" again, but ...
Code:
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/sandbox-2.13::gentoo  ABI_X86="(32*) (64) (-x32)" 416 KiB
[ebuild   R    ] dev-util/cmake-3.16.5::gentoo  USE="ncurses qt5* -doc -emacs -test" 0 KiB
[ebuild   R    ] sys-devel/gcc-9.2.0-r2:9.2.0::gentoo  USE="(cxx) fortran (multilib*) nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla" 0 KiB
[ebuild   R    ] sys-libs/glibc-2.29-r7:2.2::gentoo  USE="multiarch (multilib*) ssp -audit -caps (-cet) -compile-locales -doc -gd -headers-only -nscd -profile (-selinux) -suid -systemtap -test (-vanilla)" 2.337 KiB

... if I change the order in the file "parent", it is all OK. No "multilib" anymore :-)

So in step 2 it must be:

# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent


So the complete procedure is:

Code:
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 2136

PostPosted: Tue Mar 08, 2022 3:42 pm    Post subject: Reply with quote

pietinger wrote:

Code:
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc


Fixing a few minor issues here to those that find this post

Shorten parent path to not reapply all of 17.1 again;
Ensure profile-formats is set;
Drop unused auto-sync;

Code:
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
profile-formats = portage-2
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:arch/amd64/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Tue Mar 08, 2022 4:46 pm    Post subject: Reply with quote

grknight,

thank you very much for this update !

Not only I am using it for myself - I gave this as recommendation in my german installation guide (I will now update immediately).

Many Greetings,
Peter
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5642
Location: Bavaria

PostPosted: Wed Oct 16, 2024 1:06 am    Post subject: Reply with quote

I am adding to this old thread because I have linked to it very often ... and there are now wiki articles:

Although “only” for DESKTOP+HARDENED, but maybe that's exactly what you're looking for. ;-)

https://wiki.gentoo.org/wiki/Hardened_Desktop_Profiles

https://wiki.gentoo.org/wiki/KDE/Hardened_KDE_Plasma_profile
https://wiki.gentoo.org/wiki/GNOME/Guide/Hardened_GNOME_Profiles
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
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