2016-04-05 20:51:02 +01:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, cmake, llvmPackages, kernel,
|
|
|
|
flex, bison, elfutils, python, pythonPackages, luajit, netperf, iperf }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-06-02 22:23:19 +01:00
|
|
|
version = "0.3.0";
|
2016-04-05 20:51:02 +01:00
|
|
|
name = "bcc-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iovisor";
|
|
|
|
repo = "bcc";
|
2017-01-01 09:27:09 +00:00
|
|
|
rev = "v${version}";
|
2017-06-02 22:23:19 +01:00
|
|
|
sha256 = "19lkqmilfjmj7bnhxlacd0waa5db8gf4lng12fy2zgji0d77vm1d";
|
2016-04-05 20:51:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper cmake llvmPackages.llvm llvmPackages.clang-unwrapped kernel
|
|
|
|
flex bison elfutils python pythonPackages.netaddr luajit netperf iperf
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags="-DBCC_KERNEL_MODULES_DIR=${kernel.dev}/lib/modules -DBCC_KERNEL_HAS_SOURCE_DIR=1";
|
2016-09-07 21:44:06 +01:00
|
|
|
|
2016-04-05 20:51:02 +01:00
|
|
|
postInstall = ''
|
2016-09-07 21:44:06 +01:00
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
rm -r $out/share/bcc/tools/{old,doc/CMakeLists.txt}
|
|
|
|
mv $out/share/bcc/tools/doc $out/share
|
|
|
|
mv $out/share/bcc/man $out/share/
|
|
|
|
|
2016-04-05 20:51:02 +01:00
|
|
|
for f in $out/share/bcc/tools\/*; do
|
2016-09-07 21:44:06 +01:00
|
|
|
ln -s $f $out/bin/$(basename $f)
|
2016-04-05 20:51:02 +01:00
|
|
|
wrapProgram $f \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/lib \
|
|
|
|
--prefix PYTHONPATH : $out/lib/python2.7/site-packages \
|
|
|
|
--prefix PYTHONPATH : :${pythonPackages.netaddr}/lib/${python.libPrefix}/site-packages
|
|
|
|
done
|
2016-09-07 21:44:06 +01:00
|
|
|
'';
|
2016-04-05 20:51:02 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Dynamic Tracing Tools for Linux";
|
|
|
|
homepage = "https://iovisor.github.io/bcc/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ragge ];
|
|
|
|
};
|
|
|
|
}
|