summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorTor Hedin Brønner <torhedinbronner@gmail.com>2018-12-14 09:54:41 +0100
committerTor Hedin Brønner <torhedinbronner@gmail.com>2018-12-19 20:39:10 +0100
commit59e665838171cccfd419eab4a51ddcd685d67a53 (patch)
tree0800427f2231472051d33aab2feb452c5d041c1f /pkgs
parent65dfc2b272819760f7c7adf848ccff36390c0425 (diff)
downloadnixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar.gz
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar.bz2
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar.lz
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar.xz
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.tar.zst
nixpkgs-59e665838171cccfd419eab4a51ddcd685d67a53.zip
valgrind: fix build on darwin
We fixed a race condition in #51505 and #51107. This required running
autoreconfHook to pick up the `coregrind-makefile-race.patch` patch.

Unfortunately this broke darwin's postPatch fixes as autoreconfHook would run
afterwards regenerating the fixed makefiles.

Moving the postPatch fixes to preConfigure should resolve the issue.

I left `postPatch = ""` in to avoid a rebuild on linux.

(cherry picked from commit a6d4a0c53c88bf47482b17665fe2675f4cc82bb2)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index ca8d64f9132..d70ec0ed9ac 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -31,12 +31,8 @@ stdenv.mkDerivation rec {
     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).
-    ''
+      # 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' \;
@@ -60,7 +56,10 @@ stdenv.mkDerivation rec {
       echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld"
       substituteInPlace coregrind/link_tool_exe_darwin.in \
         --replace /usr/bin/ld ${cctools}/bin/ld
-    '';
+    '');
+
+  # To prevent rebuild on linux when moving darwin's postPatch fixes to preConfigure
+  postPatch = "";
 
   configureFlags =
     stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit";