about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/perf.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-04-10 14:37:35 +0100
committerJörg Thalheim <joerg@thalheim.io>2018-04-10 14:41:04 +0100
commit0e2b222c246b1b93619d8ff1ca8c0bbb082facad (patch)
tree5e1f0f585f26f44e2ba1427a931d6af414138da1 /pkgs/os-specific/linux/kernel/perf.nix
parent8787c131ed21e9132cd2deba7c63d865feecf415 (diff)
downloadnixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar.gz
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar.bz2
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar.lz
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar.xz
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.tar.zst
nixlib-0e2b222c246b1b93619d8ff1ca8c0bbb082facad.zip
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.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/perf.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix25
1 files changed, 15 insertions, 10 deletions
diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix
index 06552eb35799..b386bebddf39 100644
--- a/pkgs/os-specific/linux/kernel/perf.nix
+++ b/pkgs/os-specific/linux/kernel/perf.nix
@@ -12,7 +12,7 @@ assert versionAtLeast kernel.version "3.12";
 stdenv.mkDerivation {
   name = "perf-linux-${kernel.version}";
 
-  inherit (kernel) src makeFlags;
+  inherit (kernel) src;
 
   preConfigure = ''
     cd tools/perf
@@ -24,17 +24,21 @@ stdenv.mkDerivation {
       substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug
     done
 
-    [ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion
-    export makeFlags="DESTDIR=$out WERROR=0 $makeFlags"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DTIPDIR=\"$out/share/doc/perf-tip\""
+    if [ -f bash_completion ]; then
+      sed -i 's,^have perf,_have perf,' bash_completion
+    fi
   '';
 
+  makeFlags = ["prefix=$(out)" "WERROR=0"] ++ kernel.makeFlags;
+
   # perf refers both to newt and slang
-  nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
-      flex bison libiberty libaudit makeWrapper pkgconfig python perl ];
-  buildInputs =
-    [ elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
-    ] ++ stdenv.lib.optional withGtk gtk2;
+  nativeBuildInputs = [
+    asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
+    flex bison libiberty libaudit makeWrapper pkgconfig python perl
+  ];
+  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
   # bad `ld' and other stuff.
@@ -43,6 +47,7 @@ stdenv.mkDerivation {
       "-Wno-error=bool-compare"
       "-Wno-error=deprecated-declarations"
       "-DOBJDUMP_PATH=\"${binutils}/bin/objdump\""
+      "-DTIPDIR=\"$(out)/share/doc/perf-tip\""
     ]
     # gcc before 6 doesn't know these options
     ++ stdenv.lib.optionals (hasPrefix "gcc-6" stdenv.cc.cc.name) [
@@ -50,7 +55,7 @@ stdenv.mkDerivation {
     ];
 
   separateDebugInfo = true;
-  installFlags = "install install-man ASCIIDOC8=1";
+  installFlags = "install install-man ASCIIDOC8=1 prefix=$(out)";
 
   preFixup = ''
     wrapProgram $out/bin/perf \