|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
{ stdenv, fetchurl, perl, gdb, autoconf, automake }: |
|
|
|
|
{ stdenv, fetchurl, perl, gdb }: |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec { |
|
|
|
|
stdenv.mkDerivation (rec { |
|
|
|
|
name = "valgrind-3.6.1"; |
|
|
|
|
|
|
|
|
|
src = fetchurl { |
|
|
|
@ -10,11 +10,13 @@ stdenv.mkDerivation rec { |
|
|
|
|
|
|
|
|
|
# Perl is needed for `cg_annotate'. |
|
|
|
|
# GDB is needed to provide a sane default for `--db-command'. |
|
|
|
|
buildNativeInputs = [ perl autoconf automake ]; |
|
|
|
|
buildNativeInputs = [ perl ]; |
|
|
|
|
buildInputs = stdenv.lib.optional (!stdenv.isDarwin) gdb; |
|
|
|
|
|
|
|
|
|
configureFlags = |
|
|
|
|
if stdenv.system == "x86_64-linux" then ["--enable-only64bit"] else []; |
|
|
|
|
if (stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin") |
|
|
|
|
then [ "--enable-only64bit" ] |
|
|
|
|
else []; |
|
|
|
|
|
|
|
|
|
postInstall = '' |
|
|
|
|
for i in $out/lib/valgrind/*.supp; do |
|
|
|
@ -39,8 +41,39 @@ stdenv.mkDerivation rec { |
|
|
|
|
|
|
|
|
|
license = "GPLv2+"; |
|
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ]; |
|
|
|
|
|
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ eelco ludo ]; |
|
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
(if stdenv.isDarwin |
|
|
|
|
then { |
|
|
|
|
patchPhase = |
|
|
|
|
# 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' |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
preConfigure = |
|
|
|
|
# Shamelessly drag in MIG. |
|
|
|
|
'' mkdir -p "$TMPDIR/impure-deps/bin" |
|
|
|
|
|
|
|
|
|
# MIG assumes the standard Darwin core utilities (e.g., `rm -d'), so |
|
|
|
|
# let it see the impure directories. |
|
|
|
|
cat > "$TMPDIR/impure-deps/bin/mig" <<EOF |
|
|
|
|
#!/bin/sh |
|
|
|
|
export PATH="/usr/bin:/bin:\$PATH" |
|
|
|
|
exec /usr/bin/mig "\$@" |
|
|
|
|
EOF |
|
|
|
|
chmod +x "$TMPDIR/impure-deps/bin/mig" |
|
|
|
|
|
|
|
|
|
export PATH="$TMPDIR/impure-deps/bin:$PATH" |
|
|
|
|
''; |
|
|
|
|
} |
|
|
|
|
else {})) |
|
|
|
|