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