summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2022-10-25 12:59:10 +0000
committerAaron Jheng <wentworth@outlook.com>2022-10-25 13:10:13 +0000
commit1bac4d0f77c8d85e5fb49800a9615cf369bbbf20 (patch)
tree218db17c4e4a82df552b26af9860b4eee80e1bce /pkgs/os-specific
parent1e684b371cf05300bc2b432f958f285855bac8fb (diff)
downloadnixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar.gz
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar.bz2
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar.lz
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar.xz
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.tar.zst
nixpkgs-1bac4d0f77c8d85e5fb49800a9615cf369bbbf20.zip
perf: add python.interpreter to PATH
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/perf/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix
index 5e0b5850f01..3693c9868df 100644
--- a/pkgs/os-specific/linux/kernel/perf/default.nix
+++ b/pkgs/os-specific/linux/kernel/perf/default.nix
@@ -74,9 +74,11 @@ stdenv.mkDerivation {
   installFlags = [ "install" "install-man" "ASCIIDOC8=1" "prefix=$(out)" ];
 
   preFixup = ''
-    # pull in 'objdump' into PATH to make annotations work
+    # Pull in 'objdump' into PATH to make annotations work.
+    # The embeded Python interpreter will search PATH to calculate the Python path configuration(Should be fixed by upstream).
+    # Add python.interpreter to PATH for now.
     wrapProgram $out/bin/perf \
-      --prefix PATH : "${binutils-unwrapped}/bin"
+      --prefix PATH : ${lib.makeBinPath ([ binutils-unwrapped ] ++ (if (lib.versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ]))}
   '';
 
   meta = with lib; {