about summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2019-10-03 14:34:17 +0000
committerGitHub <noreply@github.com>2019-10-03 14:34:17 +0000
commitd3542aae76de40387691946b0543d46a4b18e6d6 (patch)
tree978b02c13885087b172fe810a1f6c11814d364dc /pkgs/development/tools
parent3e39e058ece53afb782e84e23109bd8390bce293 (diff)
coz: init at 0.2.0 (#68981)
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/analysis/coz/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/development/tools/analysis/coz/default.nix b/pkgs/development/tools/analysis/coz/default.nix
new file mode 100644
index 0000000000000..1ef3457e8e9c2
--- /dev/null
+++ b/pkgs/development/tools/analysis/coz/default.nix
@@ -0,0 +1,52 @@
+{ stdenv
+, fetchFromGitHub
+, libelfin
+, ncurses
+, python3
+, makeWrapper
+}:
+stdenv.mkDerivation rec {
+  pname = "coz";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "plasma-umass";
+    repo = "coz";
+    rev = version;
+    sha256 = "0a55q3s8ih1r9x6fp7wkg3n5h1yd9pcwg74k33d1r94y3j3m0znr";
+  };
+
+  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
+  ];
+
+  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
+
+    # make sure that PYTHONPATH doesn't leak from the environment
+    wrapProgram $out/bin/coz \
+      --unset PYTHONPATH
+  '';
+
+  meta = {
+    homepage = "https://github.com/plasma-umass/coz";
+    description = "Coz: Causal Profiling";
+    license = stdenv.lib.licenses.bsd2;
+    maintainers = with stdenv.lib.maintainers; [ zimbatm ];
+  };
+}