View previous topic :: View next topic |
Author |
Message |
viio n00b

Joined: 17 Mar 2020 Posts: 33
|
Posted: Sat Mar 21, 2020 1:20 pm Post subject: How to choose USE flags? |
|
|
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 |
|
 |
alexander-n8hgeg5e n00b

Joined: 02 Nov 2019 Posts: 58
|
Posted: Sat Mar 21, 2020 1:42 pm Post subject: |
|
|
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 |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31618 Location: here
|
Posted: Sat Mar 21, 2020 1:52 pm Post subject: |
|
|
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 |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 3686
|
Posted: Sat Mar 21, 2020 3:47 pm Post subject: Re: How to choose USE flags? |
|
|
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 |
|
 |
CBf9YHqgmkfqQe n00b

Joined: 21 Mar 2020 Posts: 2
|
Posted: Sat Mar 21, 2020 5:46 pm Post subject: |
|
|
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 |
|
 |
Jaglover Watchman


Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
 |
viio n00b

Joined: 17 Mar 2020 Posts: 33
|
Posted: Sat Mar 21, 2020 5:54 pm Post subject: |
|
|
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 |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 3686
|
Posted: Sat Mar 21, 2020 5:59 pm Post subject: |
|
|
Replace it with "emerge --verbose --pretend --ask" |
|
Back to top |
|
 |
AlexJGreen Tux's lil' helper

Joined: 19 Sep 2018 Posts: 149
|
Posted: Sat Mar 21, 2020 6:07 pm Post subject: Re: How to choose USE flags? |
|
|
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am; edited 1 time in total |
|
Back to top |
|
 |
389292 Guru

Joined: 26 Mar 2019 Posts: 504
|
Posted: Sat Mar 21, 2020 6:52 pm Post subject: |
|
|
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 |
|
 |
viio n00b

Joined: 17 Mar 2020 Posts: 33
|
Posted: Sat Mar 21, 2020 9:34 pm Post subject: |
|
|
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 |
|
 |
389292 Guru

Joined: 26 Mar 2019 Posts: 504
|
Posted: Sat Mar 21, 2020 9:46 pm Post subject: |
|
|
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 |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Sat Mar 21, 2020 9:55 pm Post subject: |
|
|
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 |
|
 |
AlexJGreen Tux's lil' helper

Joined: 19 Sep 2018 Posts: 149
|
Posted: Sun Mar 22, 2020 7:52 pm Post subject: |
|
|
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am; edited 1 time in total |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Wed Mar 25, 2020 8:21 am Post subject: |
|
|
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 |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 3686
|
Posted: Wed Mar 25, 2020 8:24 am Post subject: |
|
|
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 |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31618 Location: here
|
Posted: Wed Mar 25, 2020 9:03 am Post subject: |
|
|
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 |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Wed Mar 25, 2020 9:58 am Post subject: |
|
|
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 |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31618 Location: here
|
Posted: Wed Mar 25, 2020 10:06 am Post subject: |
|
|
Step 1 seems looks ok _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Wed Mar 25, 2020 10:10 am Post subject: |
|
|
fedeliallalinea wrote: | Step 1 seems looks ok |
Thank you again ... (you are fast as a shark ) |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Wed Mar 25, 2020 10:47 am Post subject: |
|
|
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 |
|
 |
grknight Retired Dev

Joined: 20 Feb 2015 Posts: 2136
|
Posted: Tue Mar 08, 2022 3:42 pm Post subject: |
|
|
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 |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
Posted: Tue Mar 08, 2022 4:46 pm Post subject: |
|
|
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 |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5642 Location: Bavaria
|
|
Back to top |
|
 |
|