Hi Rohan,

Rohan Hart <[email protected]> writes:

> 2010/3/20 Ludovic Courtès <[email protected]>:
>> Actually, things could be committed to ‘trunk’ as long as (1) users can
>> choose between GNU ld and GNU Gold, and (2) the default remains GNU ld.
>>
>> Before committing to ‘trunk’, you’d have to make sure that it won’t
>> cause too many rebuilds, and in particular that it doesn’t affect
>> ‘stdenv’; otherwise that could go to ‘stdenv-updates’.
>>
>> What do you think?
>
> I can do that.  What's the best way to make this configurable easily
> by users?

The easiest way would be via ‘getConfig’, something like:

  binutils =
    if (getConfig [ "binutils" "gold" ] false)
    then binutilsGold
    else binutilsLd;

  binutilsGold = import .../  {
    gold = true;
    ...
  };

  binutilsLd = import .../ {
    gold = false;
    ...
  };

(See ‘all-packages.nix’ for examples.)

Then packages referring to ‘binutils’ don’t have to be changed: they
will refer to the user-selected variant of Binutils.  Users would only
have to set ‘binutils.gold = true’ in ~/.nixpkgs/config.nix (whether on
NixOS or not.)

What do you think?

Thanks,
Ludo’.
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to