Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

tor-arm: build recipe improvements

- Fix install of man page
- Remove redundant for loop
- Access python interpreter via pythonPackages
- Remove redundant build inputs (captured via replacement anyway)
- Fix install location of sample rc file. For whatever reason, the
install script ends up thinking it needs to use tor-arm, so override
it
- Clarify meta.description

+19 -16
+19 -16
pkgs/tools/security/tor/tor-arm.nix
··· 1 - { stdenv, fetchurl, python, setuptools, lsof, nettools, makeWrapper 2 - , pythonPackages, ncurses }: 1 + { stdenv, fetchurl, makeWrapper 2 + , pythonPackages, ncurses, lsof, nettools 3 + }: 3 4 4 5 stdenv.mkDerivation rec { 5 - name = "tor-arm-${version}"; 6 + name = "tor-arm-${version}"; 6 7 version = "1.4.5.0"; 7 8 8 9 src = fetchurl { 9 - url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2"; 10 + url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2"; 10 11 sha256 = "1yi87gdglkvi1a23hv5c3k7mc18g0rw7b05lfcw81qyxhlapf3pw"; 11 12 }; 12 13 13 - buildInputs = 14 - [ python pythonPackages.curses setuptools lsof nettools makeWrapper ]; 14 + nativeBuildInputs = [ makeWrapper pythonPackages.python ]; 15 + 16 + outputs = [ "out" "man" ]; 15 17 16 - patchPhase = '' 18 + postPatch = '' 17 19 substituteInPlace ./setup.py --replace "/usr/bin" "$out/bin" 18 20 substituteInPlace ./src/util/connections.py \ 19 21 --replace "lsof -wnPi" "${lsof}/bin/lsof" ··· 22 24 --replace "lsof -wnPi" "${lsof}/bin/lsof" 23 25 24 26 substituteInPlace ./arm --replace '"$0" = /usr/bin/arm' 'true' 25 - substituteInPlace ./arm --replace "python" "${python}/bin/python" 27 + substituteInPlace ./arm --replace "python" "${pythonPackages.python}/bin/python" 26 28 27 29 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 28 30 substituteInPlace $i --replace "/usr/share" "$out/share" 29 31 done 32 + 33 + # fixes man page installation 34 + substituteInPlace ./setup.py --replace "src/resoureces" "src/resources" 30 35 ''; 31 36 32 37 installPhase = '' 33 38 mkdir -p $out/share/arm $out/bin $out/libexec 34 - python setup.py install --prefix=$out 39 + python setup.py install --prefix=$out --docPath $out/share/doc/arm 35 40 cp -R src/TorCtl $out/libexec 36 41 37 - for i in $(cd $out/bin && ls); do 38 - wrapProgram $out/bin/$i \ 39 - --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pythonPackages.curses}):$out/libexec:$PYTHONPATH" \ 40 - --set TERMINFO "${ncurses.out}/share/terminfo" \ 41 - --set TERM "xterm" 42 - done 42 + wrapProgram $out/bin/arm \ 43 + --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pythonPackages.curses}):$out/libexec:$PYTHONPATH" \ 44 + --set TERMINFO "${ncurses.out}/share/terminfo" \ 45 + --set TERM "xterm" 43 46 ''; 44 47 45 48 meta = { 46 - description = "Anonymizing relay monitor for Tor"; 49 + description = "A terminal status monitor for Tor relays"; 47 50 homepage = "https://www.atagar.com/arm/"; 48 51 license = stdenv.lib.licenses.gpl3; 49 52 platforms = stdenv.lib.platforms.unix;