Pierre Neidhardt <m...@ambrevar.xyz> writes:

> Any thought on this, anyone?

Having used Gentoo for some years, I'm not sure a "global" parameter
system is desirable.  It could encourage enabling feature "foo", even
for packages that have experimental or broken support for "foo".

But I see how it could be useful to parameterize packages nevertheless.
I imagine adding a 'parameters' field to the package type, and write
definitions along these lines.

(package
  (parameters
   '((pulseaudio . #t)))
  (arguments
   `(#:configure-flags ,(match parameters
                         ((('pulseaudio . #t)
                          '("--enable-pulseaudio" "--enable-dbus"))
                         (_ '()))))
  (inputs
   `(("foo" ,foo)
     ,@(match parameters
         ((('pulseaudio . #t)
           `(("pulseaudio" ,pulseaudio))))
         (_ '()))))))

And perhaps a "with-parameters" procedure for toggling it:

(inputs
  `(("foo" ,foo))
    ("bar" ,(with-parameters ((pulseaudio . #f)) bar)))

We could have a similar procedure that recursively toggles supported
parameters of all given packages.

Actually we can abuse the 'properties' field for this purpose without
having to change anything.

Well, food for thought, thanks for driving this :-)

Attachment: signature.asc
Description: PGP signature

Reply via email to