guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parameterized packages


From: Pierre Neidhardt
Subject: Re: Parameterized packages
Date: Fri, 17 Jan 2020 17:41:15 +0100

Hi Nicolò,

Yes, you are exactly right.

I didn't know Nix had it, that's great to hear!
Would you happen to know where those USE flags are implemented?

> Taking handbrake[1] recipe as an example: there's the useGtk flag that
> can be passed to the package definition, and that affects build
> options. Since in guix dependencies build inputs are specified inside
> the package definition, propagating those flags should be easy.  If we
> standardize on flags names (don't have "-X", "noX", "disable-x"...), it
> should be easy to incrementally add flags support to all package
> dependencies.  I imagine (with an invalid syntax probably) something
> like:
>
> (inputs
> `(,(unless (member build-flags 'no-x) ("libx11" libx11))
>   ; this package always need x, don't pass flags
>   ("input" ,input "out" (filter (lambda (x) (not (eq? x 'no-x))) build-flags))
>   ("other-input" ,input))) ; flags are passed implicitly here?

Some questions arise though:

- What about passing parameters to implicit dependencies, e.g. those of
  the build system?

- Consider the following case: With package A depending on B depending
  on C, to get parameter X on A we need to enable X on C.
  I guess the workaround is to include "C with parameter X" as an
  explicit input of A.  Hmm...

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]