Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] how do virtual ebuilds work?
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
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 632

PostPosted: Fri Jan 03, 2020 11:08 am    Post subject: [SOLVED] how do virtual ebuilds work? Reply with quote

Hi,

I'd like to understand how virtual ebuilds "behave" through a practical example.

Say I want to emerge the suricata package on a clean system (no dependencies installed yet). This package depends on virtual/rust, and it's ebuild has this RDEPEND line:

Code:
RDEPEND="|| ( =dev-lang/rust-${PV}* =dev-lang/rust-bin-${PV}* )"


Is the order important? ie. does it mean that rust will be pulled in instead of rust-bin if neither of these packages is in the system?

I'm asking because depending on rust "first" instead of rust-bin implies a lot of CPU time and disk space (or ramdisk memory) for /var/tmp.
I for one don't care to build rust from source.

So, does this mean I am *required* to first emerge rust-bin and then suricata?


Last edited by Vieri on Fri Jan 03, 2020 1:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 03, 2020 1:20 pm    Post subject: Reply with quote

Vieri,

Lets take virtual/editor/editor-0-r3.ebuild as a worked example.

It contains
Code:
RDEPEND="|| (
        app-editors/nano
        app-editors/dav
        app-editors/e3
        app-editors/ee
        app-editors/elvis
        app-editors/emacs:*
        app-editors/emact
        app-editors/ersatz-emacs
        app-editors/fe
        app-editors/jasspa-microemacs
        app-editors/jed
...


Packages that depend on an editor being installed depend on virtual/editor
Any one of the packages in the RDEPEND, satisfies virtual/editor. (You may have several)
It the event that virtual/editor is not satisfied, the first package in the list, app-editors/nano, will be installed. Other than that, the order is not important.
That's how nano gets into the stage3

None of the above stops a particular ebuild depending on a particular editor if it needs to.

Your rust example only has two entries, which is why I didn't use it.
It means that if rust is not yet installed, build it, but if the pre built rust is there already that's OK.
The knock on is that if you want rust-bin you must install it yourself because rust-bin is not first in the list of options in the virtual.

It a way for ebuild writers to say, I want one of these but it doesn't matter which one.
_________________
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
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 632

PostPosted: Fri Jan 03, 2020 1:27 pm    Post subject: Reply with quote

OK, so it seems that the author of virtual/rust prefers pulling in rust instead of rust-bin.

Fine, I'll just emerge rust-bin before.

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 03, 2020 1:31 pm    Post subject: Reply with quote

Vieri,

Exactly so.
Building things for yourself is the Gentoo way, so its more a philosophical thing.
_________________
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
Ionen
l33t
l33t


Joined: 06 Dec 2018
Posts: 691

PostPosted: Fri Jan 03, 2020 1:33 pm    Post subject: Reply with quote

Rather than a preference, in gentoo picking source package over binary where available is just the standard. When other defaults are picked, they are usually a source of debate if it's not an obvious pick too.

Either way, you can also emerge them together, or mask what you don't like if you don't want it to be brought up again.

Edit: personally I enjoyed being able to compile rust 1.40.0-r1 again with my own rust-1.40.0-r1 for no reason thanks to the new system-bootstrap #DestroyTheEnvironement :twisted:
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