summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-01-31 13:50:49 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-01-31 13:50:49 +0000
commita9df2bc8b67cd84d2f23bc60b5b39055559979ab (patch)
tree090be1ea662caa1ef24564bec9da8c310393573c
parent13398fe348ec313b2ccc279b96e8c3c8e34f2187 (diff)
* Latest valgrind, callgrind.
* Build callgrind so that it doesn't need its own copy of valgrind.
* Add kcachegrind and callgrind to the cache.

svn path=/nixpkgs/trunk/; revision=4635
-rw-r--r--pkgs/development/tools/misc/callgrind/builder.sh16
-rw-r--r--pkgs/development/tools/misc/callgrind/default.nix21
-rw-r--r--pkgs/development/tools/misc/callgrind/prefix.patch91
-rw-r--r--pkgs/development/tools/misc/valgrind/default.nix6
-rw-r--r--pkgs/system/all-packages-generic.nix2
-rw-r--r--pkgs/system/populate-cache.nix3
6 files changed, 112 insertions, 27 deletions
diff --git a/pkgs/development/tools/misc/callgrind/builder.sh b/pkgs/development/tools/misc/callgrind/builder.sh
index 7061fcde9e065..b64cbc1387d97 100644
--- a/pkgs/development/tools/misc/callgrind/builder.sh
+++ b/pkgs/development/tools/misc/callgrind/builder.sh
@@ -1,13 +1,9 @@
 source $stdenv/setup
 
-tar jxvf $valgrindsrc || fail
-cd valgrind-* || fail
-./configure --prefix=$out || fail
-make || fail
-make install || fail
+postInstall=postInstall
+postInstall() {
+    # !!! fix for other than x86-linux
+    ln -s $valgrind/lib/valgrind/x86-linux/*.so $out/lib/valgrind/x86-linux/
+}
 
-tar zxvf $src
-cd clg3 || fail
-./configure --prefix=$out || fail
-make || fail
-make install || fail
+genericBuild
\ No newline at end of file
diff --git a/pkgs/development/tools/misc/callgrind/default.nix b/pkgs/development/tools/misc/callgrind/default.nix
index 2da38e0f10b3f..f9410b1c998da 100644
--- a/pkgs/development/tools/misc/callgrind/default.nix
+++ b/pkgs/development/tools/misc/callgrind/default.nix
@@ -1,21 +1,18 @@
-# Valgrind has to be in the same prefix and I didn't feel like
-# patching. So, valgrind is installed here as well.
-
-{stdenv, fetchurl, which, perl}:
+{stdenv, fetchurl, which, perl, valgrind}:
 
 stdenv.mkDerivation {
-  name = "callgrind-0.10.1pre";
+  name = "callgrind-0.10.1";
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = http://nix.cs.uu.nl/dist/tarballs/clg3-cvs-2005.11.11.tar.gz;
-    md5 = "c272cff1c567ba154ccc60fe2ff241d8";
+    url = http://kcachegrind.sourceforge.net/callgrind-0.10.1.tar.bz2;
+    md5 = "6d8acca6b58b0b72804339d04426d550";
   };
 
-  valgrindsrc = fetchurl {
-    url = http://nix.cs.uu.nl/dist/tarballs/valgrind-3.0.1.tar.bz2;
-    md5 = "c29efdb7d1a93440f5644a6769054681";
-  };
+  # Callgrind wants to install in the same prefix as Valgrind.  This
+  # patch fixes that.
+  patches = [./prefix.patch];
 
-  buildInputs = [which perl];
+  buildInputs = [which perl valgrind];
+  inherit valgrind;
 }
diff --git a/pkgs/development/tools/misc/callgrind/prefix.patch b/pkgs/development/tools/misc/callgrind/prefix.patch
new file mode 100644
index 0000000000000..d3981f23dcef0
--- /dev/null
+++ b/pkgs/development/tools/misc/callgrind/prefix.patch
@@ -0,0 +1,91 @@
+diff -rc callgrind-0.10.1-orig/callgrind.in callgrind-0.10.1/callgrind.in
+*** callgrind-0.10.1-orig/callgrind.in	2005-11-14 03:21:14.000000000 +0100
+--- callgrind-0.10.1/callgrind.in	2006-01-31 13:35:59.000000000 +0100
+***************
+*** 11,14 ****
+          esac
+  esac
+  
+! exec @VG_BINDIR@/valgrind --tool=callgrind $*
+--- 11,14 ----
+          esac
+  esac
+  
+! VALGRIND_LIB=@prefix@/lib/valgrind/ exec @VG_BINDIR@/valgrind --tool=callgrind $*
+diff -rc callgrind-0.10.1-orig/configure callgrind-0.10.1/configure
+*** callgrind-0.10.1-orig/configure	2005-11-25 02:00:26.000000000 +0100
+--- callgrind-0.10.1/configure	2006-01-31 13:41:48.000000000 +0100
+***************
+*** 3461,3467 ****
+     { (exit 1); exit 1; }; }
+    fi
+  else
+!   vg_exec=`which $prefix/bin/valgrind`
+    if test "x$vg_exec" = "x"; then
+      echo "$as_me:$LINENO: result: not found in $prefix/bin" >&5
+  echo "${ECHO_T}not found in $prefix/bin" >&6
+--- 3461,3467 ----
+     { (exit 1); exit 1; }; }
+    fi
+  else
+!   vg_exec=`which valgrind`
+    if test "x$vg_exec" = "x"; then
+      echo "$as_me:$LINENO: result: not found in $prefix/bin" >&5
+  echo "${ECHO_T}not found in $prefix/bin" >&6
+***************
+*** 3484,3493 ****
+  
+  
+  
+! VG_BINDIR="$prefix/bin"
+  
+  cat >>confdefs.h <<_ACEOF
+! #define VG_PREFIX "$prefix"
+  _ACEOF
+  
+  
+--- 3484,3493 ----
+  
+  
+  
+! VG_BINDIR="$vg_binpath"
+  
+  cat >>confdefs.h <<_ACEOF
+! #define VG_PREFIX "$ac_default_prefix"
+  _ACEOF
+  
+  
+***************
+*** 3495,3501 ****
+  use_pkg_config="yes"
+  echo "$as_me:$LINENO: checking for valgrind version" >&5
+  echo $ECHO_N "checking for valgrind version... $ECHO_C" >&6
+! vg_version=`$prefix/bin/valgrind --version`
+  case "${vg_version}" in
+      valgrind-3.1.*)
+  	CG_SRCDIR=build31
+--- 3495,3501 ----
+  use_pkg_config="yes"
+  echo "$as_me:$LINENO: checking for valgrind version" >&5
+  echo $ECHO_N "checking for valgrind version... $ECHO_C" >&6
+! vg_version=`$vg_binpath/valgrind --version`
+  case "${vg_version}" in
+      valgrind-3.1.*)
+  	CG_SRCDIR=build31
+***************
+*** 3522,3528 ****
+  echo "${ECHO_T}${vg_version}" >&6
+  
+  # get architecture from .pc file
+! eval "pkgdir=$libdir/pkgconfig"
+  echo "$as_me:$LINENO: checking for arch/os used in valgrind installation" >&5
+  echo $ECHO_N "checking for arch/os used in valgrind installation... $ECHO_C" >&6
+  
+--- 3522,3528 ----
+  echo "${ECHO_T}${vg_version}" >&6
+  
+  # get architecture from .pc file
+! eval "pkgdir=$ac_default_prefix/lib/pkgconfig"
+  echo "$as_me:$LINENO: checking for arch/os used in valgrind installation" >&5
+  echo $ECHO_N "checking for arch/os used in valgrind installation... $ECHO_C" >&6
+  
diff --git a/pkgs/development/tools/misc/valgrind/default.nix b/pkgs/development/tools/misc/valgrind/default.nix
index a9e2c509ecc01..03a249c338e96 100644
--- a/pkgs/development/tools/misc/valgrind/default.nix
+++ b/pkgs/development/tools/misc/valgrind/default.nix
@@ -1,9 +1,9 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "valgrind-3.0.1";
+  name = "valgrind-3.1.0";
   src = fetchurl {
-    url = http://nix.cs.uu.nl/dist/tarballs/valgrind-3.0.1.tar.bz2;
-    md5 = "c29efdb7d1a93440f5644a6769054681";
+    url = http://valgrind.org/downloads/valgrind-3.1.0.tar.bz2;
+    md5 = "d92156e9172dc6097e56c69ea9c88013";
   };
 }
diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix
index 362c6e49ad6df..345349af65c79 100644
--- a/pkgs/system/all-packages-generic.nix
+++ b/pkgs/system/all-packages-generic.nix
@@ -402,7 +402,7 @@ rec {
   };
 
   callgrind = (import ../development/tools/misc/callgrind) {
-    inherit fetchurl stdenv which perl;
+    inherit fetchurl stdenv which perl valgrind;
   };
 
   kcachegrind = (import ../development/tools/misc/kcachegrind) {
diff --git a/pkgs/system/populate-cache.nix b/pkgs/system/populate-cache.nix
index 912238a843a1d..ef6890480e477 100644
--- a/pkgs/system/populate-cache.nix
+++ b/pkgs/system/populate-cache.nix
@@ -18,6 +18,7 @@ let {
     blackdown
     bsdiff
     bzip2
+    callgrind
     cksfv
     coreutils
     darcs
@@ -57,7 +58,7 @@ let {
     jikes
     jing_tools
     jre
-    kdelibs
+    kcachegrind
     kernel
     less
     libtool