2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper
|
2016-11-09 13:49:06 +01:00
|
|
|
, python2Packages, ncurses, lsof, nettools
|
2016-04-30 21:09:18 +02:00
|
|
|
}:
|
2014-12-10 10:59:51 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "tor-arm";
|
2014-12-10 10:59:51 +01:00
|
|
|
version = "1.4.5.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-04-30 21:09:18 +02:00
|
|
|
url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2";
|
2014-12-10 10:59:51 +01:00
|
|
|
sha256 = "1yi87gdglkvi1a23hv5c3k7mc18g0rw7b05lfcw81qyxhlapf3pw";
|
|
|
|
};
|
|
|
|
|
2016-11-09 13:49:06 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper python2Packages.python ];
|
2014-12-10 10:59:51 +01:00
|
|
|
|
2016-04-30 21:09:18 +02:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-12-10 10:59:51 +01:00
|
|
|
substituteInPlace ./setup.py --replace "/usr/bin" "$out/bin"
|
|
|
|
substituteInPlace ./src/util/connections.py \
|
|
|
|
--replace "lsof -wnPi" "${lsof}/bin/lsof"
|
|
|
|
substituteInPlace ./src/util/torTools.py \
|
|
|
|
--replace "netstat -npl" "${nettools}/bin/netstat -npl" \
|
|
|
|
--replace "lsof -wnPi" "${lsof}/bin/lsof"
|
|
|
|
|
|
|
|
substituteInPlace ./arm --replace '"$0" = /usr/bin/arm' 'true'
|
2016-11-09 13:49:06 +01:00
|
|
|
substituteInPlace ./arm --replace "python" "${python2Packages.python}/bin/python"
|
2014-12-10 10:59:51 +01:00
|
|
|
|
|
|
|
for i in ./install ./arm ./src/gui/controller.py ./src/cli/wizard.py ./src/resources/torrcOverride/override.h ./src/resources/torrcOverride/override.py ./src/resources/arm.1 ./setup.py; do
|
|
|
|
substituteInPlace $i --replace "/usr/share" "$out/share"
|
|
|
|
done
|
2016-04-30 21:09:18 +02:00
|
|
|
|
|
|
|
# fixes man page installation
|
|
|
|
substituteInPlace ./setup.py --replace "src/resoureces" "src/resources"
|
2014-12-10 10:59:51 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/arm $out/bin $out/libexec
|
2016-04-30 21:09:18 +02:00
|
|
|
python setup.py install --prefix=$out --docPath $out/share/doc/arm
|
2014-12-10 10:59:51 +01:00
|
|
|
cp -R src/TorCtl $out/libexec
|
|
|
|
|
2016-04-30 21:09:18 +02:00
|
|
|
wrapProgram $out/bin/arm \
|
2016-10-14 00:03:12 +02:00
|
|
|
--prefix PYTHONPATH : "$(toPythonPath $out):$out/libexec:$PYTHONPATH" \
|
2016-04-30 21:09:18 +02:00
|
|
|
--set TERMINFO "${ncurses.out}/share/terminfo" \
|
|
|
|
--set TERM "xterm"
|
2014-12-10 10:59:51 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2016-04-30 21:09:18 +02:00
|
|
|
description = "A terminal status monitor for Tor relays";
|
2014-12-10 10:59:51 +01:00
|
|
|
homepage = "https://www.atagar.com/arm/";
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
2014-12-10 10:59:51 +01:00
|
|
|
};
|
|
|
|
}
|