1{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig
2, withGUI ? false , qt4 ? null}:
3
4# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
5assert withGUI -> qt4 != null;
6
7stdenv.mkDerivation rec {
8 name = "oprofile-1.0.0";
9
10 src = fetchurl {
11 url = "mirror://sourceforge/oprofile/${name}.tar.gz";
12 sha256 = "0nn4wfvwy4nii25y6lwlrnzx9ah4nz0r93yk7hswiy6wxjs10wc4";
13 };
14
15 buildInputs = [ binutils zlib popt pkgconfig ]
16 ++ stdenv.lib.optionals withGUI [ qt4 ];
17
18 configureFlags = [
19 "--disable-shared" # needed because only the static libbfd is available
20 ]
21 ++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
22
23 meta = {
24 description = "System-wide profiler for Linux";
25 longDescription = ''
26 OProfile is a system-wide profiler for Linux systems, capable of
27 profiling all running code at low overhead. It consists of a
28 kernel driver and a daemon for collecting sample data, and
29 several post-profiling tools for turning data into information.
30
31 OProfile leverages the hardware performance counters of the CPU
32 to enable profiling of a wide variety of interesting statistics,
33 which can also be used for basic time-spent profiling. All code
34 is profiled: hardware and software interrupt handlers, kernel
35 modules, the kernel, shared libraries, and applications.
36 '';
37 license = stdenv.lib.licenses.gpl2;
38 homepage = http://oprofile.sourceforge.net/;
39
40 platforms = stdenv.lib.platforms.linux;
41 maintainers = [ ];
42 };
43}