2021-04-28 07:49:32 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, python3Packages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2020-08-03 22:34:19 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bpytop";
|
2021-12-31 12:14:48 +00:00
|
|
|
version = "1.0.68";
|
2020-08-03 22:34:19 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aristocratos";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-31 12:14:48 +00:00
|
|
|
sha256 = "sha256-NHfaWWwNpGhqu/ALcW4p4X6sktEyLbKQuNHpAUUw4LY=";
|
2020-08-03 22:34:19 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-04-28 07:49:32 +01:00
|
|
|
|
2020-08-03 22:34:19 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [ python psutil ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s#/usr/\[local/\]#$out/#g" \
|
|
|
|
-e "s#/usr/{td}#$out/#g" \
|
2020-09-07 10:09:32 +01:00
|
|
|
-e "s#THEME_DIR: str = \"\"#THEME_DIR: str = \"$out/share/bpytop/themes\"#" \
|
2020-08-03 22:34:19 +01:00
|
|
|
./bpytop.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,libexec,share/bpytop}/
|
|
|
|
cp -r ./themes $out/share/bpytop/
|
|
|
|
cp ./bpytop.py $out/libexec/
|
|
|
|
|
|
|
|
makeWrapper ${python3Packages.python.interpreter} $out/bin/bpytop \
|
|
|
|
--add-flags "$out/libexec/bpytop.py" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-08-03 22:34:19 +01:00
|
|
|
description = "A resource monitor; python port of bashtop";
|
|
|
|
homepage = src.meta.homepage;
|
2022-01-02 14:23:43 +00:00
|
|
|
license = licenses.asl20;
|
2020-08-03 22:34:19 +01:00
|
|
|
maintainers = with maintainers; [ aw ];
|
|
|
|
platforms = with platforms; linux ++ freebsd ++ darwin;
|
|
|
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/94625#issuecomment-668509399
|
2021-12-07 18:03:14 +00:00
|
|
|
broken = stdenv.isDarwin && stdenv.isx86_64;
|
2020-08-03 22:34:19 +01:00
|
|
|
};
|
|
|
|
}
|