summary refs log tree commit diff
path: root/pkgs/development/tools/analysis/valgrind
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-01-19 16:10:07 +0000
committerAlyssa Ross <hi@alyssa.is>2023-01-20 01:06:05 +0000
commit65cdb52a66c84f7f89e2e31335798b4bda6470a8 (patch)
tree397388f66e335558b5e1aca0affc3d2baedc100d /pkgs/development/tools/analysis/valgrind
parent6e310cb6d78f0c7eba3a1e19012e9305947b05d6 (diff)
valgrind-light: fix build for FreeBSD
This is very similar to what we do for Darwin directly below, but
we look up the FreeBSD version at eval time instead.

The .0 is prepended because our current FreeBSD system doubles only
include the major version.  Valgrind ignores everything after the
dot anyway (but it wants the dot to be there).
Diffstat (limited to 'pkgs/development/tools/analysis/valgrind')
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index ea45813303a6e..3bec558803b4e 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -50,7 +50,10 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   separateDebugInfo = stdenv.isLinux;
 
-  preConfigure = lib.optionalString stdenv.isDarwin (
+  preConfigure = lib.optionalString stdenv.isFreeBSD ''
+    substituteInPlace configure --replace '`uname -r`' \
+        ${toString stdenv.hostPlatform.parsed.kernel.version}.0
+  '' + lib.optionalString stdenv.isDarwin (
     let OSRELEASE = ''
       $(awk -F '"' '/#define OSRELEASE/{ print $2 }' \
       <${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)'';
@@ -75,7 +78,7 @@ stdenv.mkDerivation rec {
     '');
 
   configureFlags =
-    lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit"
+    lib.optional stdenv.hostPlatform.isx86_64 "--enable-only64bit"
     ++ lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include";
 
   doCheck = true;