Skip to content

Commit

Permalink
valgrind: Fix darwin build
Browse files Browse the repository at this point in the history
The bzero-patch was merged upstream in
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16103, so it does no
longer apply.

Additionally - to make the build succeed on darwin systems more recent
than our nixpkgs.darwin.xnu kernel version - we need to teach the build
the version of the xnu headers we provide, instead of letting the build
figure out the actual system version using `uname -r`.
  • Loading branch information
knedlsepp committed Sep 15, 2017
1 parent eed14ba commit c71fd76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
10 changes: 9 additions & 1 deletion pkgs/development/tools/analysis/valgrind/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

patches = stdenv.lib.optionals (stdenv.isDarwin) [ ./valgrind-bzero.patch ];
preConfigure = stdenv.lib.optionalString stdenv.isDarwin (
let OSRELEASE = ''
$(awk -F '"' '/#define OSRELEASE/{ print $2 }' \
<${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)'';
in ''
echo "Don't derive our xnu version using uname -r."
substituteInPlace configure --replace "uname -r" "echo ${OSRELEASE}"
''
);

postPatch = stdenv.lib.optionalString (stdenv.isDarwin)
# Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666).
Expand Down
37 changes: 0 additions & 37 deletions pkgs/development/tools/analysis/valgrind/valgrind-bzero.patch

This file was deleted.

0 comments on commit c71fd76

Please sign in to comment.