From cbf6fa3cc7740bf17a6f12f253a48c386913cf62 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Tue, 20 Feb 2018 16:02:39 -0600 Subject: [PATCH] perf: fix some hardcoded paths with newer, more exciting hardcoded NixOS paths! In the long run it looks like we may actually need a small set of patches to Perf if that's more maintainable, in which case we would much rather check NIX_DEBUG_INFO_DIRS. Signed-off-by: Austin Seipp --- pkgs/os-specific/linux/kernel/perf.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix index 8090a7329aee..fd1672e4cf2b 100644 --- a/pkgs/os-specific/linux/kernel/perf.nix +++ b/pkgs/os-specific/linux/kernel/perf.nix @@ -16,7 +16,14 @@ stdenv.mkDerivation { preConfigure = '' cd tools/perf - sed -i s,/usr/include/elfutils,$elfutils/include/elfutils, Makefile + + substituteInPlace Makefile \ + --replace /usr/include/elfutils $elfutils/include/elfutils + + for x in util/build-id.c util/dso.c; do + substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug + done + [ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion export makeFlags="DESTDIR=$out WERROR=0 $makeFlags" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DTIPDIR=\"$out/share/doc/perf-tip\""