2010-11-29 18:42:50 +01:00
|
|
|
{ stdenv, fetchurl, binutils, popt, makeWrapper, gawk, which, gnugrep, zlib
|
2012-03-03 12:30:44 +01:00
|
|
|
, pkgconfig
|
|
|
|
, withGUI ? false , qt4 ? null}:
|
2010-05-05 21:48:18 +02:00
|
|
|
|
|
|
|
# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
|
2012-03-03 12:30:44 +01:00
|
|
|
assert withGui -> qt4 != null;
|
2008-06-04 23:23:30 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2012-03-03 12:30:44 +01:00
|
|
|
name = "oprofile-0.9.7";
|
2008-06-04 23:23:30 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/oprofile/${name}.tar.gz";
|
2012-03-03 12:30:44 +01:00
|
|
|
sha256 = "09ymfgcvp6372xnxdbq664ba8f4nzz4cxlya7wi8s1gabmym0nyb";
|
2008-06-04 23:23:30 +02:00
|
|
|
};
|
|
|
|
|
2008-09-15 17:26:01 +02:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i "utils/opcontrol" \
|
|
|
|
-e "s|OPCONTROL=.*$|OPCONTROL=\"$out/bin/opcontrol\"|g ;
|
|
|
|
s|OPDIR=.*$|OPDIR=\"$out/bin\"|g ;
|
|
|
|
s|^PATH=.*$||g"
|
|
|
|
'';
|
2008-06-04 23:23:30 +02:00
|
|
|
|
2012-03-03 12:30:44 +01:00
|
|
|
buildInputs = [ binutils zlib popt makeWrapper gawk which gnugrep pkgconfig ]
|
|
|
|
++ stdenv.lib.optionals withGui [ qt4 ];
|
2008-06-04 23:23:30 +02:00
|
|
|
|
2010-05-05 21:48:18 +02:00
|
|
|
configureFlags =
|
|
|
|
[ "--with-kernel-support"
|
|
|
|
"--disable-shared" # needed because only the static libbfd is available
|
|
|
|
]
|
2012-03-03 12:30:44 +01:00
|
|
|
++ stdenv.lib.optional withGui "--with-qt-dir=${qt4} --enable-gui=qt4";
|
2008-06-04 23:23:30 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/opcontrol" \
|
2008-09-15 17:26:01 +02:00
|
|
|
--prefix PATH : "$out/bin:${gawk}/bin:${which}/bin:${gnugrep}/bin"
|
2008-06-04 23:23:30 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2010-05-05 21:48:18 +02:00
|
|
|
description = "OProfile, a system-wide profiler for Linux";
|
2008-06-04 23:23:30 +02:00
|
|
|
longDescription = ''
|
|
|
|
OProfile is a system-wide profiler for Linux systems, capable of
|
|
|
|
profiling all running code at low overhead. It consists of a
|
|
|
|
kernel driver and a daemon for collecting sample data, and
|
|
|
|
several post-profiling tools for turning data into information.
|
|
|
|
|
|
|
|
OProfile leverages the hardware performance counters of the CPU
|
|
|
|
to enable profiling of a wide variety of interesting statistics,
|
|
|
|
which can also be used for basic time-spent profiling. All code
|
|
|
|
is profiled: hardware and software interrupt handlers, kernel
|
|
|
|
modules, the kernel, shared libraries, and applications.
|
|
|
|
'';
|
|
|
|
license = "GPLv2";
|
|
|
|
homepage = http://oprofile.sourceforge.net/;
|
2010-05-05 21:48:18 +02:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
2008-06-04 23:23:30 +02:00
|
|
|
};
|
2009-03-30 22:22:54 +02:00
|
|
|
}
|