2015-03-03 01:45:00 +03:00
|
|
|
{ stdenv, fetchurl, fetchpatch, perl, gdb }:
|
2004-01-21 17:50:18 +03:00
|
|
|
|
2013-12-03 18:17:01 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2015-09-28 16:52:31 +03:00
|
|
|
name = "valgrind-3.11.0";
|
2008-06-04 00:56:12 +04:00
|
|
|
|
2004-01-21 17:50:18 +03:00
|
|
|
src = fetchurl {
|
2009-03-03 12:19:50 +03:00
|
|
|
url = "http://valgrind.org/downloads/${name}.tar.bz2";
|
2015-09-28 16:52:31 +03:00
|
|
|
sha256 = "0hiv871b9bk689mv42mkhp76za78l5773glszfkdbpf1m1qn4fbc";
|
2004-01-21 17:50:18 +03:00
|
|
|
};
|
2006-10-11 20:45:55 +04:00
|
|
|
|
2015-09-28 16:52:31 +03:00
|
|
|
patches =
|
|
|
|
[ (fetchpatch {
|
|
|
|
name = "glibc-2.21.patch";
|
|
|
|
url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk"
|
|
|
|
+ "/valgrind-3.9.0-glibc-2.21.patch?h=packages/valgrind&id=41e87313b69";
|
|
|
|
sha256 = "14sgsvjjalbcqpcayyv5cndc9hfm5bigkp684b6cr6virksmlk19";
|
|
|
|
})
|
|
|
|
];
|
2015-03-03 01:45:00 +03:00
|
|
|
|
2015-08-27 17:46:30 +03:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2008-06-04 00:56:12 +04:00
|
|
|
# Perl is needed for `cg_annotate'.
|
|
|
|
# GDB is needed to provide a sane default for `--db-command'.
|
2012-12-28 22:20:09 +04:00
|
|
|
nativeBuildInputs = [ perl ];
|
2010-11-25 12:32:12 +03:00
|
|
|
buildInputs = stdenv.lib.optional (!stdenv.isDarwin) gdb;
|
2008-06-04 00:56:12 +04:00
|
|
|
|
2013-12-03 18:17:01 +04:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2014-02-26 15:39:46 +04:00
|
|
|
postPatch =
|
2013-12-03 18:17:01 +04:00
|
|
|
# Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666).
|
|
|
|
''
|
|
|
|
echo "getting rid of the \`-arch' GCC option..."
|
|
|
|
find -name Makefile\* -exec \
|
|
|
|
sed -i {} -e's/DARWIN\(.*\)-arch [^ ]\+/DARWIN\1/g' \;
|
|
|
|
|
|
|
|
sed -i coregrind/link_tool_exe_darwin.in \
|
|
|
|
-e 's/^my \$archstr = .*/my $archstr = "x86_64";/g'
|
|
|
|
'';
|
|
|
|
|
2007-02-27 13:40:15 +03:00
|
|
|
configureFlags =
|
2013-12-03 18:17:01 +04:00
|
|
|
stdenv.lib.optional (stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin") "--enable-only64bit";
|
2007-02-27 13:40:15 +03:00
|
|
|
|
2008-08-19 17:03:08 +04:00
|
|
|
postInstall = ''
|
|
|
|
for i in $out/lib/valgrind/*.supp; do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace 'obj:/lib' 'obj:*/lib' \
|
|
|
|
--replace 'obj:/usr/X11R6/lib' 'obj:*/lib' \
|
|
|
|
--replace 'obj:/usr/lib' 'obj:*/lib'
|
|
|
|
done
|
2014-11-06 23:08:18 +03:00
|
|
|
|
|
|
|
paxmark m $out/lib/valgrind/*-*-linux
|
2008-08-19 17:03:08 +04:00
|
|
|
'';
|
|
|
|
|
2006-10-11 20:45:55 +04:00
|
|
|
meta = {
|
2007-12-12 14:12:26 +03:00
|
|
|
homepage = http://www.valgrind.org/;
|
2014-08-24 18:21:08 +04:00
|
|
|
description = "Debugging and profiling tool suite";
|
2008-06-04 00:56:12 +04:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Valgrind is an award-winning instrumentation framework for
|
|
|
|
building dynamic analysis tools. There are Valgrind tools that
|
|
|
|
can automatically detect many memory management and threading
|
|
|
|
bugs, and profile your programs in detail. You can also use
|
|
|
|
Valgrind to build new tools.
|
|
|
|
'';
|
|
|
|
|
2014-06-19 08:19:00 +04:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2009-09-23 23:45:02 +04:00
|
|
|
|
2013-12-03 18:17:01 +04:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
2014-08-08 19:58:34 +04:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2006-10-11 20:45:55 +04:00
|
|
|
};
|
2004-01-21 17:50:18 +03:00
|
|
|
}
|