[Nix-dev] Re: [Nix-commits] SVN commit: nix - 20510 - viric - in nixpkgs/branches/stdenv-updates/pkgs: development/libraries/acl development/libraries/attr development/libraries/gettext os-specific/linux/uclibc tools/misc/coreutils top-level

Ludovic Courtès ludo at gnu.org
Wed Mar 10 15:41:09 CET 2010


Hi,

Lluís Batlle <viriketo at gmail.com> writes:

> 2010/3/10 Ludovic Courtès <ludo at gnu.org>:
>> Saluton Lluís,
>>
>> Llus Batlle <viriketo at gmail.com> writes:
>>
>>> +      ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
>>> +        stdenv.gccCross.libc.libiconv.hostDrv;
>>
>> The condition should be something like ‘(stdenv ? glibc)’ since only
>> non-glibc platforms need libiconv.
> I thought about that... and decided to do what I did.
>
> It is a bit more difficult to do something very similar to what you propose.
>
> We have different stdenvs for different platforms, and some platforms
> have fixed either glibc or another thing. Cross-building, it gets
> quite flexible; there is "libcCross", and it points to either a uclibc
> or glibc, depending on what the user chose.

OK, thanks for explaining.

I don’t think there’s any other case where an attribute name can refer
to different packages, as ‘libc’ in this case.  Usually attribute names
correspond to the implementation name (e.g., ‘inetutils’, ‘nettools’),
not to the feature provided (‘ifconfig’).

> I could have done: if (stdenv.cross.libc == "glibc"), and then take
> libiconv as a usual input. Do you prefer this way? This would be easy.

Why not.  It would better reflect the intent IMO.

Thanks,
Ludo’.



More information about the nix-dev mailing list