2013-03-24 12:45:00 +01:00
|
|
|
{ fetchurl, stdenv, kernelDev, pkgconfig, gtkmm, boost, pcre }:
|
2008-09-12 22:00:00 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-03-24 12:45:00 +01:00
|
|
|
name = "exmap-0.10-${kernelDev.version}";
|
2008-09-12 22:00:00 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.berthels.co.uk/exmap/download/${name}.tgz";
|
|
|
|
sha256 = "0z00dhl6bdmaz7p9wlvnj0izf0zlrlkv34fz449kxyislpzzxmgn";
|
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "kernel/Makefile" \
|
|
|
|
--replace '/lib/modules/$(shell uname -r)/build' \
|
2013-03-24 12:45:00 +01:00
|
|
|
${kernelDev}/lib/modules/*/build
|
2008-09-12 22:00:00 +02:00
|
|
|
|
|
|
|
# The `proc_root' variable (the root of `/proc') is no longer exported
|
|
|
|
# since 2.6.26. Fortunately, one can pass `NULL' instead of `&proc_root'.
|
|
|
|
# See http://lkml.org/lkml/2008/3/30/57 .
|
|
|
|
substituteInPlace "kernel/exmap.c" \
|
|
|
|
--replace "&proc_root" "NULL"
|
|
|
|
|
|
|
|
substituteInPlace "src/Makefile" --replace "-Werror" ""
|
|
|
|
'';
|
|
|
|
|
2013-03-24 12:45:00 +01:00
|
|
|
buildInputs = [ kernelDev pkgconfig gtkmm boost pcre ];
|
2008-09-12 22:00:00 +02:00
|
|
|
|
|
|
|
buildPhase = "make build";
|
|
|
|
|
|
|
|
# XXX: The tests can only be run one the `exmap' module is loaded.
|
|
|
|
doCheck = false;
|
|
|
|
#checkPhase = "make test"
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/share/${name}"
|
2008-09-12 22:00:00 +02:00
|
|
|
cp kernel/*.ko "$out/share/${name}"
|
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/bin"
|
2008-09-12 22:00:00 +02:00
|
|
|
cp src/{gexmap,exmtool,elftool,showproc} "$out/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Exmap, a tool showing the physical memory usage of processes";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Exmap is a utility which takes a snapshot of how the physical
|
|
|
|
memory and swap space are currently used by all the processes on
|
|
|
|
your system. It examines which page of memory are shared between
|
|
|
|
which processes, so that it can share the cost of the pages
|
|
|
|
fairly when calculating usage totals.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://www.berthels.co.uk/exmap/;
|
|
|
|
|
|
|
|
license = "GPLv2+";
|
|
|
|
};
|
|
|
|
}
|