summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-01-21 01:29:06 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-01-21 01:29:06 +0000
commit8ea631310b5ba2e7628b9588fe25a5db71a5d9b0 (patch)
tree2d4085fdf5e302c9f8986c7949516adfb178bbe1 /pkgs/development/tools
parent4a1c721c01367307c28401f142d4149a53e062e4 (diff)
downloadnixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar.gz
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar.bz2
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar.lz
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar.xz
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.tar.zst
nixpkgs-8ea631310b5ba2e7628b9588fe25a5db71a5d9b0.zip
Making the ccacheWrapper a bit nicer. More flexible, specifically.
svn path=/nixpkgs/trunk/; revision=31753
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/misc/ccache/default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix
index 5c83adfe4a8..2cd00f51d9d 100644
--- a/pkgs/development/tools/misc/ccache/default.nix
+++ b/pkgs/development/tools/misc/ccache/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, runCommand, gcc}:
+{stdenv, fetchurl, runCommand, gcc, zlib}:
 
 let
   ccache =
@@ -9,17 +9,19 @@ stdenv.mkDerivation {
     sha256 = "04ax6ks49b6rn57hx4v9wbvmsfmw6ipn0wyfqwhh4lzw70flv3r7";
   };
 
+  buildInputs = [ zlib ];
+
   passthru = {
     # A derivation that provides gcc and g++ commands, but that
     # will end up calling ccache for the given cacheDir
-    links = cacheDir : (runCommand "ccache-links"
+    links = extraConfig : (runCommand "ccache-links"
         { inherit (gcc) langC langCC; }
       ''
         mkdir -p $out/bin
         if [ $langC -eq 1 ]; then
           cat > $out/bin/gcc << EOF
           #!/bin/sh
-          export CCACHE_DIR=${cacheDir}
+          ${extraConfig}
           exec ${ccache}/bin/ccache ${gcc.gcc}/bin/gcc "\$@"
         EOF
           chmod +x $out/bin/gcc
@@ -27,7 +29,7 @@ stdenv.mkDerivation {
         if [ $langCC -eq 1 ]; then
           cat > $out/bin/g++ << EOF
           #!/bin/sh
-          export CCACHE_DIR=${cacheDir}
+          ${extraConfig}
           exec ${ccache}/bin/ccache ${gcc.gcc}/bin/g++ "\$@"
         EOF
           chmod +x $out/bin/g++