git.iko.soy/typeable/nixpkgs
on master help sign in
linuxPackages.perf: use prefix instead of DESTDIR

Otherwise the build system computes incorrect references and looks for perf-core in /libexec. DESTDIR for normal buildsystems is never the right choice for nixpkgs.

commit0e2b222c246b1b93619d8ff1ca8c0bbb082facad authorJörg Thalheim <joerg@thalheim.io> dateTue 10 Apr 2018, 14:37 (9 years ago) parent8787c13
1 file changed+15−10
pkgs/os-specific/linux/kernel/perf.nix+15−10
pkgs/os-specific/linux/kernel/perf.nix+15−10
@@ -12,7 +12,7 @@ assert versionAtLeast kernel.version "3.12";
1212stdenv.mkDerivation {
1313 name = "perf-linux-${kernel.version}";
1414
15− inherit (kernel) src makeFlags;
15+ inherit (kernel) src;
1616
1717 preConfigure = ''
1818 cd tools/perf
@@ -24,17 +24,21 @@ stdenv.mkDerivation {
2424 substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug
2525 done
2626
27− [ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion
28− export makeFlags="DESTDIR=$out WERROR=0 $makeFlags"
29− export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DTIPDIR=\"$out/share/doc/perf-tip\""
27+ if [ -f bash_completion ]; then
28+ sed -i 's,^have perf,_have perf,' bash_completion
29+ fi
3030 '';
3131
32+ makeFlags = ["prefix=$(out)" "WERROR=0"] ++ kernel.makeFlags;
33+
3234 # perf refers both to newt and slang
33− nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
34− flex bison libiberty libaudit makeWrapper pkgconfig python perl ];
35− buildInputs =
36− [ elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
37− ] ++ stdenv.lib.optional withGtk gtk2;
35+ nativeBuildInputs = [
36+ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
37+ flex bison libiberty libaudit makeWrapper pkgconfig python perl
38+ ];
39+ buildInputs = [
40+ elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
41+ ] ++ stdenv.lib.optional withGtk gtk2;
3842
3943 # Note: we don't add elfutils to buildInputs, since it provides a
4044 # bad `ld' and other stuff.
@@ -43,6 +47,7 @@ stdenv.mkDerivation {
4347 "-Wno-error=bool-compare"
4448 "-Wno-error=deprecated-declarations"
4549 "-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
50+ "-DTIPDIR=\"$(out)/share/doc/perf-tip\""
4651 ]
4752 # gcc before 6 doesn't know these options
4853 ++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [
@@ -50,7 +55,7 @@ stdenv.mkDerivation {
5055 ];
5156
5257 separateDebugInfo = true;
53− installFlags = "install install-man ASCIIDOC8=1";
58+ installFlags = "install install-man ASCIIDOC8=1 prefix=$(out)";
5459
5560 preFixup = ''
5661 wrapProgram $out/bin/perf \