summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-10-26 22:20:25 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-10-26 22:20:25 +0000
commit0b7e25616262410d35a96d3bdf39a6c204467470 (patch)
tree7203dc92b8badf85a283adccba9fc7fb3231a568 /pkgs/tools
parentc8cc99203894c2464a7961b5e6bd8a46a25ed2d6 (diff)
downloadnixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar.gz
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar.bz2
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar.lz
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar.xz
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.tar.zst
nixlib-0b7e25616262410d35a96d3bdf39a6c204467470.zip
* Hook variables in the generic builder are now executed using eval.
  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
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/compression/gzip/builder.sh9
-rw-r--r--pkgs/tools/compression/gzip/default.nix2
2 files changed, 1 insertions, 10 deletions
diff --git a/pkgs/tools/compression/gzip/builder.sh b/pkgs/tools/compression/gzip/builder.sh
deleted file mode 100644
index 9cf502b4330d..000000000000
--- a/pkgs/tools/compression/gzip/builder.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-source $stdenv/setup
-
-postInstall=postInstall
-postInstall() {
-    ln -sf gzip $out/bin/gunzip
-    ln -sf gzip $out/bin/zcat
-}
-
-genericBuild
diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix
index 735fd10fd7bb..92cf55f1275b 100644
--- a/pkgs/tools/compression/gzip/default.nix
+++ b/pkgs/tools/compression/gzip/default.nix
@@ -6,5 +6,5 @@ stdenv.mkDerivation {
     url = http://nix.cs.uu.nl/dist/tarballs/gzip-1.3.3.tar.gz;
     md5 = "52eaf713673507d21f7abefee98ba662";
   };
-  builder = ./builder.sh;
+  postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat";
 }