Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 513750

Summary: Conditional USE flag defaults based on other USE flags (non-mandatory equivalent of REQUIRED_USE)
Product: Portage Development Reporter: Josh Triplett <josh>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Status: UNCONFIRMED ---    
Severity: enhancement CC: zmedico
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=628004
Whiteboard:
Package list:
Runtime testing required: ---

Description Josh Triplett 2014-06-18 23:01:44 UTC
REQUIRED_USE allows specifying that one USE flag depends on another; however, that only allows hard dependencies.  I'd like a way to have one USE flag enable or disable another by default, while still allowing an explicitly specified value to override that default.  For instance (strawman syntax proposal):

IUSE="flag1 +flag2"
DEFAULT_USE="flag1? ( -flag2 )"

By default, this package would build with -flag1 +flag2.  If the user explicitly enables flag1, but does not specify a value for flag2, the package would build with +flag1 -flag2.  However, the user can still explicitly enable both flag1 and flag2 if they want, or for that matter disable both.

This would come in handy for some ebuilds in Chrome OS.  In particular, some global USE flags are used for specific target environments (such as embedded, or target graphics stacks), and those global USE flags should affect the defaults for certain package-specific USE flags, without preventing the user from overriding those defaults.