···
1
-
{ lib, stdenv, fetchpatch, kernel, elfutils, python2, python3, python3Packages, perl, newt, slang, asciidoc, xmlto, makeWrapper
2
-
, docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkg-config, libunwind, binutils-unwrapped
3
-
, libiberty, audit, libbfd, libbfd_2_38, libopcodes, libopcodes_2_38, openssl, systemtap, numactl
17
+
, docbook_xml_dtd_45
23
+
, binutils-unwrapped
5
-
, withGtk ? false, gtk2
6
-
, withZstd ? true, zstd
7
-
, withLibcap ? true, libcap
42
+
d3-flame-graph-templates = stdenv.mkDerivation rec {
43
+
pname = "d3-flame-graph-templates";
47
+
url = "https://registry.npmjs.org/d3-flame-graph/-/d3-flame-graph-${version}.tgz";
48
+
sha256 = "sha256-W5/Vh5jarXUV224aIiTB2TnBFYT3naEIcG2945QjY8Q=";
52
+
install -D -m 0755 -t $out/share/d3-flame-graph/ ./dist/templates/*
···
./5.19-binutils-2.39-support.patch
71
+
patchShebangs scripts tools/perf/pmu-events/jevents.py
73
+
substituteInPlace tools/perf/scripts/python/flamegraph.py \
74
+
--replace "/usr/share/d3-flame-graph/d3-flamegraph-base.html" \
75
+
"${d3-flame-graph-templates}/share/d3-flame-graph/d3-flamegraph-base.html"
···
38
-
makeFlags = ["prefix=$(out)" "WERROR=0"] ++ kernel.makeFlags;
93
+
makeFlags = [ "prefix=$(out)" "WERROR=0" ] ++ kernel.makeFlags;
hardeningDisable = [ "format" ];
# perf refers both to newt and slang
44
-
asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
45
-
flex bison libiberty audit makeWrapper pkg-config python3
48
-
elfutils newt slang libunwind zlib openssl systemtap.stapBuild numactl
120
+
systemtap.stapBuild
] ++ (if (lib.versionAtLeast kernel.version "5.19")
51
-
then [ libbfd libopcodes ]
52
-
else [ libbfd_2_38 libopcodes_2_38 ])
53
-
++ lib.optional withGtk gtk2
54
-
++ (if (lib.versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ])
55
-
++ lib.optional withZstd zstd
56
-
++ lib.optional withLibcap libcap
57
-
++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3Packages.setuptools;
125
+
then [ libbfd libopcodes ]
126
+
else [ libbfd_2_38 libopcodes_2_38 ])
127
+
++ lib.optional withGtk gtk2
128
+
++ (if (lib.versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ])
129
+
++ lib.optional withZstd zstd
130
+
++ lib.optional withLibcap libcap
131
+
++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3Packages.setuptools;
NIX_CFLAGS_COMPILE = toString [
···
"-Wno-error=deprecated-declarations"
"-Wno-error=stringop-truncation"
67
-
patchShebangs scripts tools/perf/pmu-events/jevents.py
doCheck = false; # requires "sparse"
doInstallCheck = false; # same