0b7e256162
This has a major advantage: you can write hooks directly in Nix expressions. For instance, rather than write a builder like this: source $stdenv/setup postInstall=postInstall postInstall() { ln -sf gzip $out/bin/gunzip ln -sf gzip $out/bin/zcat } genericBuild (the gzip builder), you can just add this attribute to the derivation: postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat"; and so a separate build script becomes unnecessary. This should allow us to get rid of most builders in Nixpkgs. * Allow configure and make arguments to contain whitespace. Previously, you could say, for instance configureFlags="CFLAGS=-O0" but not configureFlags="CFLAGS=-O0 -g" since the `-g' would be interpreted as a separate argument to configure. Now you can say configureFlagsArray=("CFLAGS=-O0 -g") or similarly configureFlagsArray=("CFLAGS=-O0 -g" "LDFLAGS=-L/foo -L/bar") which does the right thing. Idem for makeFlags, installFlags, checkFlags and distFlags. Unfortunately you can't pass arrays to Bash through the environment, so you can't put the array above in a Nix expression, e.g., configureFlagsArray = ["CFLAGS=-O0 -g"]; since it would just be flattened to a since string. However, you can use the inline hooks described above: preConfigure = "configureFlagsArray=(\"CFLAGS=-O0 -g\")"; svn path=/nixpkgs/trunk/; revision=6863
11 lines
275 B
Nix
11 lines
275 B
Nix
{stdenv, fetchurl}:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "gzip-1.3.3";
|
|
src = fetchurl {
|
|
url = http://nix.cs.uu.nl/dist/tarballs/gzip-1.3.3.tar.gz;
|
|
md5 = "52eaf713673507d21f7abefee98ba662";
|
|
};
|
|
postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat";
|
|
}
|