1{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, numactl, ncurses, check }:
2
3stdenv.mkDerivation rec {
4 pname = "numatop";
5 version = "2.2";
6 src = fetchFromGitHub {
7 owner = "intel";
8 repo = "numatop";
9 rev = "v${version}";
10 sha256 = "sha256-GJvTwqgx34ZW10eIJj/xiKe3ZkAfs7GlJImz8jrnjfI=";
11 };
12
13 nativeBuildInputs = [ autoreconfHook pkg-config ];
14 buildInputs = [ numactl ncurses ];
15 nativeCheckInputs = [ check ];
16
17 patches = [
18 (fetchpatch {
19 # https://github.com/intel/numatop/pull/54
20 url = "https://github.com/intel/numatop/compare/eab0ac5253c5843aa0f0ac36e2eec7612207711b...c1001fd926c24eae2d40729492e07270ce133b72.patch";
21 sha256 = "sha256-TbMLv7TT9T8wE4uJ1a/AroyPPwrwL0eX5IBLsh9GTTM=";
22 name = "fix-string-operations.patch";
23 })
24 (fetchpatch {
25 # https://github.com/intel/numatop/pull/64
26 url = "https://github.com/intel/numatop/commit/635e2ce2ccb1ac793cc276a7fcb8a92b1ffefa5d.patch";
27 sha256 = "sha256-IevbSFJRTS5iQ5apHOVXzF67f3LJaW6j7DySFmVuyiM=";
28 name = "fix-format-strings-mvwprintw.patch";
29 })
30 ];
31
32 doCheck = true;
33
34 meta = with lib; {
35 description = "Tool for runtime memory locality characterization and analysis of processes and threads on a NUMA system";
36 mainProgram = "numatop";
37 homepage = "https://01.org/numatop";
38 license = licenses.bsd3;
39 maintainers = with maintainers; [ dtzWill ];
40 platforms = [
41 "i686-linux" "x86_64-linux"
42 "powerpc64-linux" "powerpc64le-linux"
43 ];
44 };
45}