658d3e9af8
These packages were announced as published under Apple Public Source License 2.0 ('apsl20' short handle) but they are actually published under the Apache License 2.0 ('asl20' short handle)
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, python3Packages
|
|
, fetchFromGitHub
|
|
, makeWrapper
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "bpytop";
|
|
version = "1.0.68";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aristocratos";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-NHfaWWwNpGhqu/ALcW4p4X6sktEyLbKQuNHpAUUw4LY=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
propagatedBuildInputs = with python3Packages; [ python psutil ];
|
|
|
|
dontBuild = true;
|
|
|
|
postPatch = ''
|
|
sed -i -e "s#/usr/\[local/\]#$out/#g" \
|
|
-e "s#/usr/{td}#$out/#g" \
|
|
-e "s#THEME_DIR: str = \"\"#THEME_DIR: str = \"$out/share/bpytop/themes\"#" \
|
|
./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"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A resource monitor; python port of bashtop";
|
|
homepage = src.meta.homepage;
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ aw ];
|
|
platforms = with platforms; linux ++ freebsd ++ darwin;
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/94625#issuecomment-668509399
|
|
broken = stdenv.isDarwin && stdenv.isx86_64;
|
|
};
|
|
}
|