git.iko.soy/typeable/nixpkgs
on master help sign in
perf: remove binutils patch by wrapper

starting with linux 4.12 our patch no longer applied. In order to avoid having to maintain patches for different linux kernels it is easier to use a wrapper instead.

commit887570883ed4ac5b3318565b585979eb1959c6c2 authorJörg Thalheim <joerg@thalheim.io> dateSun 23 Jul 2017, 15:16 (9 years ago) parent11f8524
2 files changed+7−16
pkgs/os-specific/linux/kernel/perf-binutils-path.patch−12 pkgs/os-specific/linux/kernel/perf.nix+7−4
pkgs/os-specific/linux/kernel/perf-binutils-path.patchdeleted−12
@@ -1,12 +0,0 @@
1−diff -ru -x '*~' linux-4.9.31-orig/tools/perf/util/annotate.c linux-4.9.31/tools/perf/util/annotate.c
2−--- linux-4.9.31-orig/tools/perf/util/annotate.c 2017-06-07 12:08:04.000000000 +0200
3−+++ linux-4.9.31/tools/perf/util/annotate.c 2017-06-12 13:10:08.811079574 +0200
4−@@ -1350,7 +1350,7 @@
5− "%s %s%s --start-address=0x%016" PRIx64
6− " --stop-address=0x%016" PRIx64
7− " -l -d %s %s -C %s 2>/dev/null|grep -v %s|expand",
8−- objdump_path ? objdump_path : "objdump",
9−+ objdump_path ? objdump_path : OBJDUMP_PATH,
10− disassembler_style ? "-M " : "",
11− disassembler_style ? disassembler_style : "",
12− map__rip_2objdump(map, sym->start),
pkgs/os-specific/linux/kernel/perf.nix+7−4
@@ -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 */