[Nix-dev] Re: [Nix-commits] SVN commit: nix - 12701 - simons - nixpkgs/trunk/pkgs/tools/text/replace

Eelco Dolstra e.dolstra at tudelft.nl
Mon Aug 25 16:43:55 CEST 2008


Hi,

Andres Loeh wrote:

>> Log:
>> replace: makeFlags is an array
> 
> [...]
> 
>> -  makeFlags = "TREE=\$(out)";
>> +  makeFlags = ["TREE=\$(out)"];
> 
> I don't think makeFlags is an array. setup.sh has two variables,
> makeFlags and makeFlagsArray. The latter is an array, the former
> isn't. Actually, it's not quite clear to me why both are needed.

makeFlagsArray is a shell array, which is useful when you want to pass arguments
to make that contain spaces, e.g.

  makeFlagsArray=(CFLAGS="-O2 -g" LDFLAGS=...)

If you said

  makeFlags="CFLAGS=-O2 -g LDFLAGS=..."

obviously it wouldn't work.

Unfortunately there is no way to pass shell arrays through environment
variables, so you can't define makeFlagsArray as a derivation attribute; it has
to be done in shell code.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list