@@ -1,4 +1,4 @@
1−{ lib, stdenv, kernel, elfutils, python, perl, newt, slang, asciidoc, xmlto
1+{ lib, stdenv, kernel, elfutils, python, perl, newt, slang, asciidoc, xmlto, makeWrapper
22, docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkgconfig, libunwind, binutils
33, libiberty, libaudit
44, zlib, withGtk ? false, gtk2 ? null }:
@@ -13,8 +13,6 @@ stdenv.mkDerivation {
1313
1414 inherit (kernel) src;
1515
16− patches = kernel.patches ++ [ ./perf-binutils-path.patch ];
17−
1816 preConfigure = ''
1917 cd tools/perf
2018 sed -i s,/usr/include/elfutils,$elfutils/include/elfutils, Makefile
@@ -26,7 +24,7 @@ stdenv.mkDerivation {
2624 # perf refers both to newt and slang
2725 # binutils is required for libbfd.
2826 nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
29− flex bison libiberty libaudit ];
27+ flex bison libiberty libaudit makeWrapper ];
3028 buildInputs = [ elfutils python perl newt slang pkgconfig libunwind binutils zlib ] ++
3129 stdenv.lib.optional withGtk gtk2;
3230
@@ -45,6 +43,11 @@ stdenv.mkDerivation {
4543
4644 installFlags = "install install-man ASCIIDOC8=1";
4745
46+ preFixup = ''
47+ wrapProgram $out/bin/perf \
48+ --prefix PATH : "${binutils}/bin"
49+ '';
50+
4851 crossAttrs = {
4952 /* I don't want cross-python or cross-perl -
5053 I don't know if cross-python even works */