From 9a6484b255747b27665f9cd08d2435871a0455ed Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 11 Sep 2014 22:20:02 +0200 Subject: [PATCH] smem: Add package This is a memory reporting tool that accounts for shared memory. --- pkgs/os-specific/linux/smem/default.nix | 33 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/os-specific/linux/smem/default.nix diff --git a/pkgs/os-specific/linux/smem/default.nix b/pkgs/os-specific/linux/smem/default.nix new file mode 100644 index 000000000000..a61a54afc38e --- /dev/null +++ b/pkgs/os-specific/linux/smem/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, python }: + +stdenv.mkDerivation rec { + name = "smem-1.4"; + + src = fetchurl { + url = "http://www.selenic.com/smem/download/${name}.tar.gz"; + sha256 = "1v31vy23s7szl6vdrllq9zbg58bp36jf5xy3fikjfg6gyiwgia9f"; + }; + + buildInputs = [ python ]; + + buildPhase = + '' + gcc -O2 smemcap.c -o smemcap + ''; + + installPhase = + '' + mkdir -p $out/bin + cp smem smemcap $out/bin/ + + mkdir -p $out/share/man/man8 + cp smem.8 $out/share/man/man8/ + ''; + + meta = { + homepage = http://www.selenic.com/smem/; + description = "A memory usage reporting tool that takes shared memory into account"; + platforms = lib.platforms.linux; + maintainers = [ lib.maintainers.eelco ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d4f2f8dc7d0d..22ac7822cfca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7918,6 +7918,8 @@ let shadow = callPackage ../os-specific/linux/shadow { }; + smem = callPackage ../os-specific/linux/smem { }; + statifier = builderDefsPackage (import ../os-specific/linux/statifier) { }; sysdig = callPackage ../os-specific/linux/sysdig {