Merge pull request #38682 from Mic92/perf
linuxPackages.perf: use prefix instead of DESTDIR
This commit is contained in:
commit
1d129ed65f
|
@ -12,7 +12,7 @@ assert versionAtLeast kernel.version "3.12";
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "perf-linux-${kernel.version}";
|
name = "perf-linux-${kernel.version}";
|
||||||
|
|
||||||
inherit (kernel) src makeFlags;
|
inherit (kernel) src;
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd tools/perf
|
cd tools/perf
|
||||||
|
@ -24,17 +24,21 @@ stdenv.mkDerivation {
|
||||||
substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug
|
substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion
|
if [ -f bash_completion ]; then
|
||||||
export makeFlags="DESTDIR=$out WERROR=0 $makeFlags"
|
sed -i 's,^have perf,_have perf,' bash_completion
|
||||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DTIPDIR=\"$out/share/doc/perf-tip\""
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
makeFlags = ["prefix=$(out)" "WERROR=0"] ++ kernel.makeFlags;
|
||||||
|
|
||||||
# perf refers both to newt and slang
|
# perf refers both to newt and slang
|
||||||
nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
|
nativeBuildInputs = [
|
||||||
flex bison libiberty libaudit makeWrapper pkgconfig python perl ];
|
asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
|
||||||
buildInputs =
|
flex bison libiberty libaudit makeWrapper pkgconfig python perl
|
||||||
[ elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
|
];
|
||||||
] ++ stdenv.lib.optional withGtk gtk2;
|
buildInputs = [
|
||||||
|
elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
|
||||||
|
] ++ stdenv.lib.optional withGtk gtk2;
|
||||||
|
|
||||||
# Note: we don't add elfutils to buildInputs, since it provides a
|
# Note: we don't add elfutils to buildInputs, since it provides a
|
||||||
# bad `ld' and other stuff.
|
# bad `ld' and other stuff.
|
||||||
|
@ -43,6 +47,7 @@ stdenv.mkDerivation {
|
||||||
"-Wno-error=bool-compare"
|
"-Wno-error=bool-compare"
|
||||||
"-Wno-error=deprecated-declarations"
|
"-Wno-error=deprecated-declarations"
|
||||||
"-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
|
"-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
|
||||||
|
"-DTIPDIR=\"$(out)/share/doc/perf-tip\""
|
||||||
]
|
]
|
||||||
# gcc before 6 doesn't know these options
|
# gcc before 6 doesn't know these options
|
||||||
++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [
|
++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [
|
||||||
|
@ -50,7 +55,7 @@ stdenv.mkDerivation {
|
||||||
];
|
];
|
||||||
|
|
||||||
separateDebugInfo = true;
|
separateDebugInfo = true;
|
||||||
installFlags = "install install-man ASCIIDOC8=1";
|
installFlags = "install install-man ASCIIDOC8=1 prefix=$(out)";
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
wrapProgram $out/bin/perf \
|
wrapProgram $out/bin/perf \
|
||||||
|
|
Loading…
Reference in New Issue