[Exherbo-dev] Proposal for "option restrictions" syntax

Bo Ørsted Andresen zlin at exherbo.org
Tue Sep 16 00:21:45 BST 2008


On Wednesday 13 August 2008 23:03:21 Ciaran McCreesh wrote:
> Possibly something like:
>
>     ( foo bar baz ) [[ number-selected = exactly-one ]]
>     ( monkey ) [[ requires = [ animals bananas ] ]]

So taking xorg-server as an example this would become:

MYOPTIONS+="
    ( kdrive platform:x86 video_driver:ati )           [[ requires = [ video_driver:fbdev video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:sis )           [[ requires = [ video_driver:fbdev video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:siliconmotion ) [[ requires = [ video_driver:fbdev video_driver:vesa ] ]]
 
    ( kdrive platform:x86 video_driver:chips )         [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:glint )         [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:mach64 )        [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:mga )           [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:neomagic )      [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:nv )            [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:r128 )          [[ requires = [ video_driver:vesa ] ]]
    ( kdrive platform:x86 video_driver:via )           [[ requires = [ video_driver:vesa ] ]]
 
    ( kdrive-vesa ) [[ requires = [ kdrive ] ]]
    ( xephyr )      [[ requires = [ kdrive ] ]]
    ( xfake )       [[ requires = [ kdrive ] ]]
    ( xfbdev )      [[ requires = [ kdrive ] ]]
    ( xsdl )        [[ requires = [ kdrive ] ]]
"

as opposed to e.g. the following which is less repetitive but doesn't have an
obvious way of handling number-selected requirements:

DEPENDENCIES+="
    options:
        kdrive? (
            platform:x86? (
                video_driver:ati? ( video_driver:fbdev video_driver:vesa )
                video_driver:sis? ( video_driver:fbdev video_driver:vesa )
                video_driver:siliconmotion? ( video_driver:fbdev video_driver:vesa )

                video_driver:chips? ( video_driver:vesa )
                video_driver:glint? ( video_driver:vesa )
                video_driver:mach64? ( video_driver:vesa )
                video_driver:mga? ( video_driver:vesa )
                video_driver:neomagic? ( video_driver:vesa )
                video_driver:nv? ( video_driver:vesa )
                video_driver:r128? ( video_driver:vesa )
                video_driver:via? ( video_driver:vesa )
            )
        )
        kdrive-vesa? ( kdrive )
        xephyr? ( kdrive )
        xfake? ( kdrive )
        xfbdev? ( kdrive )
        xsdl? ( kdrive )
"

Taking mplayer as an example you get:

MYOPTIONS+="
   ( cddb )     [[ requires = [ cdparanoia ] ]] 
   ( gtk )      [[ requires = [ freetype xshape ] ]]
   ( srt )      [[ requires = [ freetype ] ]]

   ( dga )      [[ requires = [ X ] ]]
   ( opengl )   [[ requires = [ X ] ]]
   ( vidix )    [[ requires = [ X ] ]]
   ( xinerama ) [[ requires = [ X ] ]]
   ( xshape )   [[ requires = [ X ] ]]
   ( xv )       [[ requires = [ X ] ]]
   ( xvmc )     [[ requires = [ X ] ]]
"

I wonder if it would be feasible to provide some short cut for stating that all
of a number of options have the same requirements?

For kde-l10n you get something like:

MYOPTIONS+="
    ( $(for l in ${LINGUAS}; do
            echo " linguas:${l}") ) [[ number-selected = at-least-one ]]"

In the ten packages I know of and have inspected I've seen the need for:
   * if a b c then d e
   * at least one of a b c
   * exactly one of a b c
   * at most one of a b

which is pretty much what was listed earlier in this thread.

-- 
Bo Andresen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.exherbo.org/pipermail/exherbo-dev/attachments/20080916/747bc857/attachment.pgp>


More information about the Exherbo-dev mailing list