2019-10-03 15:34:17 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libelfin
|
|
|
|
, ncurses
|
|
|
|
, python3
|
2020-06-01 14:04:29 +01:00
|
|
|
, python3Packages
|
2019-10-03 15:34:17 +01:00
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "coz";
|
2020-01-25 19:15:13 +00:00
|
|
|
version = "0.2.1";
|
2019-10-03 15:34:17 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "plasma-umass";
|
|
|
|
repo = "coz";
|
|
|
|
rev = version;
|
2020-01-25 19:15:13 +00:00
|
|
|
sha256 = "0val36yw987b1558iiyk3nqg0yy5k9y5wh49v91zj3cs58mmfyhc";
|
2019-10-03 15:34:17 +01:00
|
|
|
};
|
|
|
|
|
2020-01-25 19:15:13 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/pid_t gettid/,+2d' libcoz/ccutil/thread.h
|
|
|
|
'';
|
|
|
|
|
2019-10-03 15:34:17 +01:00
|
|
|
postConfigure = ''
|
|
|
|
# This is currently hard-coded. Will be fixed in the next release.
|
|
|
|
sed -e "s|/usr/lib/|$out/lib/|" -i ./coz
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ncurses
|
|
|
|
makeWrapper
|
2020-06-01 14:04:29 +01:00
|
|
|
python3Packages.wrapPython
|
2019-10-03 15:34:17 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libelfin
|
|
|
|
(python3.withPackages (p: [ p.docutils ]))
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/man/man1
|
|
|
|
make install prefix=$out
|
|
|
|
|
|
|
|
# fix executable includes
|
|
|
|
chmod -x $out/include/coz.h
|
|
|
|
|
2020-06-01 14:04:29 +01:00
|
|
|
wrapPythonPrograms
|
2019-10-03 15:34:17 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/plasma-umass/coz";
|
|
|
|
description = "Coz: Causal Profiling";
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ zimbatm ];
|
|
|
|
};
|
|
|
|
}
|