valgrind: enable darwin build
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, fetchpatch, perl, gdb }:
|
||||
{ stdenv, fetchurl, fetchpatch, perl, gdb, llvm, cctools, xnu, bootstrap_cmds }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "valgrind-3.12.0";
|
||||
@@ -14,11 +14,13 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# Perl is needed for `cg_annotate'.
|
||||
# GDB is needed to provide a sane default for `--db-command'.
|
||||
buildInputs = [ perl ] ++ stdenv.lib.optional (!stdenv.isDarwin) gdb;
|
||||
buildInputs = [ perl gdb ] ++ stdenv.lib.optionals (stdenv.isDarwin) [ bootstrap_cmds xnu ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postPatch =
|
||||
patches = stdenv.lib.optionals (stdenv.isDarwin) [ ./valgrind-bzero.patch ];
|
||||
|
||||
postPatch = stdenv.lib.optionalString (stdenv.isDarwin)
|
||||
# Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666).
|
||||
''
|
||||
echo "getting rid of the \`-arch' GCC option..."
|
||||
@@ -27,6 +29,23 @@ stdenv.mkDerivation rec {
|
||||
|
||||
sed -i coregrind/link_tool_exe_darwin.in \
|
||||
-e 's/^my \$archstr = .*/my $archstr = "x86_64";/g'
|
||||
|
||||
echo "substitute hardcoded /usr/include/mach with ${xnu}/include/mach"
|
||||
substituteInPlace coregrind/Makefile.in \
|
||||
--replace /usr/include/mach ${xnu}/include/mach
|
||||
|
||||
echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
|
||||
find -name "Makefile.in" | while read file; do
|
||||
substituteInPlace "$file" \
|
||||
--replace dsymutil ${llvm}/bin/llvm-dsymutil
|
||||
done
|
||||
|
||||
substituteInPlace coregrind/m_debuginfo/readmacho.c \
|
||||
--replace /usr/bin/dsymutil ${llvm}/bin/llvm-dsymutil
|
||||
|
||||
echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld"
|
||||
substituteInPlace coregrind/link_tool_exe_darwin.in \
|
||||
--replace /usr/bin/ld ${cctools}/bin/ld
|
||||
'';
|
||||
|
||||
configureFlags =
|
||||
@@ -58,6 +77,6 @@ stdenv.mkDerivation rec {
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
|
||||
maintainers = [ stdenv.lib.maintainers.eelco ];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user