From 65cdb52a66c84f7f89e2e31335798b4bda6470a8 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 19 Jan 2023 16:10:07 +0000 Subject: 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). --- pkgs/development/tools/analysis/valgrind/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkgs/development/tools/analysis/valgrind') 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; -- cgit 1.4.1