summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2018-02-20 16:02:39 -0600
committerAustin Seipp <aseipp@pobox.com>2018-02-20 22:17:12 -0600
commitcbf6fa3cc7740bf17a6f12f253a48c386913cf62 (patch)
treeb251ba593f43e02598e03ee5b39d6dea35d9802e /pkgs/os-specific/linux/kernel
parentbd9a562402b97c992f9a985b4f5d210f20e2b623 (diff)
downloadnixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar.gz
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar.bz2
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar.lz
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar.xz
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.tar.zst
nixlib-cbf6fa3cc7740bf17a6f12f253a48c386913cf62.zip
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 <aseipp@pobox.com>
Diffstat (limited to 'pkgs/os-specific/linux/kernel')
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix9
1 files changed, 8 insertions, 1 deletions
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\""