2017-10-10 23:01:42 +00:00
|
|
|
{ stdenv, buildPackages
|
|
|
|
, fetchurl, pkgconfig
|
|
|
|
, libbfd, popt, zlib, linuxHeaders, libiberty_static
|
|
|
|
, withGUI ? false, qt4 ? null
|
|
|
|
}:
|
2010-05-05 19:48:18 +00:00
|
|
|
|
|
|
|
# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
|
2012-03-03 12:15:58 +00:00
|
|
|
assert withGUI -> qt4 != null;
|
2008-06-04 21:23:30 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-08-08 21:16:47 +00:00
|
|
|
name = "oprofile-1.3.0";
|
2008-06-04 21:23:30 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/oprofile/${name}.tar.gz";
|
2018-08-08 21:16:47 +00:00
|
|
|
sha256 = "1rj76vvkhpfn9k04s7jhb813ximfcwd9h5gh18pr4fgcw6yxiplm";
|
2008-06-04 21:23:30 +00:00
|
|
|
};
|
|
|
|
|
2017-09-10 11:01:40 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace opjitconv/opjitconv.c \
|
2017-10-10 23:01:42 +00:00
|
|
|
--replace "/bin/rm" "${buildPackages.coreutils}/bin/rm" \
|
|
|
|
--replace "/bin/cp" "${buildPackages.coreutils}/bin/cp"
|
2017-09-10 11:01:40 +00:00
|
|
|
'';
|
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-10-10 23:01:42 +00:00
|
|
|
buildInputs = [ libbfd zlib popt linuxHeaders libiberty_static ]
|
2012-03-03 12:15:58 +00:00
|
|
|
++ stdenv.lib.optionals withGUI [ qt4 ];
|
2008-06-04 21:23:30 +00:00
|
|
|
|
2013-02-23 22:49:48 +00:00
|
|
|
configureFlags = [
|
2015-10-12 14:50:13 +00:00
|
|
|
"--with-kernel=${linuxHeaders}"
|
2010-05-05 19:48:18 +00:00
|
|
|
"--disable-shared" # needed because only the static libbfd is available
|
|
|
|
]
|
2012-03-03 12:15:58 +00:00
|
|
|
++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
|
2008-06-04 21:23:30 +00:00
|
|
|
|
|
|
|
meta = {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "System-wide profiler for Linux";
|
2008-06-04 21:23:30 +00: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.
|
|
|
|
'';
|
2014-06-19 04:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2008-06-04 21:23:30 +00:00
|
|
|
homepage = http://oprofile.sourceforge.net/;
|
2010-05-05 19:48:18 +00:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2013-08-16 21:44:33 +00:00
|
|
|
maintainers = [ ];
|
2008-06-04 21:23:30 +00:00
|
|
|
};
|
2009-03-30 20:22:54 +00:00
|
|
|
}
|