diff options
author | Joachim Fasting <joachifm@fastmail.fm> | 2016-04-30 21:09:18 +0200 |
---|---|---|
committer | Joachim Fasting <joachifm@fastmail.fm> | 2016-04-30 22:25:46 +0200 |
commit | 3994a236bb004b8244ead60f0085a657121ed956 (patch) | |
tree | bf8c35f85eda56f9e8fd1b76255e415a8826435a /pkgs | |
parent | a84799fe8b00a2dc4c4560e529cbdfc18674e3ac (diff) | |
download | nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar.gz nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar.bz2 nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar.lz nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar.xz nixlib-3994a236bb004b8244ead60f0085a657121ed956.tar.zst nixlib-3994a236bb004b8244ead60f0085a657121ed956.zip |
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
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/security/tor/tor-arm.nix | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/pkgs/tools/security/tor/tor-arm.nix b/pkgs/tools/security/tor/tor-arm.nix index 365379c8f6a8..1857cfcbe22e 100644 --- a/pkgs/tools/security/tor/tor-arm.nix +++ b/pkgs/tools/security/tor/tor-arm.nix @@ -1,19 +1,21 @@ -{ stdenv, fetchurl, python, setuptools, lsof, nettools, makeWrapper -, pythonPackages, ncurses }: +{ stdenv, fetchurl, makeWrapper +, pythonPackages, ncurses, lsof, nettools +}: stdenv.mkDerivation rec { - name = "tor-arm-${version}"; + name = "tor-arm-${version}"; version = "1.4.5.0"; src = fetchurl { - url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2"; + url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2"; sha256 = "1yi87gdglkvi1a23hv5c3k7mc18g0rw7b05lfcw81qyxhlapf3pw"; }; - buildInputs = - [ python pythonPackages.curses setuptools lsof nettools makeWrapper ]; + nativeBuildInputs = [ makeWrapper pythonPackages.python ]; - patchPhase = '' + outputs = [ "out" "man" ]; + + postPatch = '' substituteInPlace ./setup.py --replace "/usr/bin" "$out/bin" substituteInPlace ./src/util/connections.py \ --replace "lsof -wnPi" "${lsof}/bin/lsof" @@ -22,28 +24,29 @@ stdenv.mkDerivation rec { --replace "lsof -wnPi" "${lsof}/bin/lsof" substituteInPlace ./arm --replace '"$0" = /usr/bin/arm' 'true' - substituteInPlace ./arm --replace "python" "${python}/bin/python" + substituteInPlace ./arm --replace "python" "${pythonPackages.python}/bin/python" 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 + + # fixes man page installation + substituteInPlace ./setup.py --replace "src/resoureces" "src/resources" ''; installPhase = '' mkdir -p $out/share/arm $out/bin $out/libexec - python setup.py install --prefix=$out + python setup.py install --prefix=$out --docPath $out/share/doc/arm cp -R src/TorCtl $out/libexec - for i in $(cd $out/bin && ls); do - wrapProgram $out/bin/$i \ - --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pythonPackages.curses}):$out/libexec:$PYTHONPATH" \ - --set TERMINFO "${ncurses.out}/share/terminfo" \ - --set TERM "xterm" - done + wrapProgram $out/bin/arm \ + --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pythonPackages.curses}):$out/libexec:$PYTHONPATH" \ + --set TERMINFO "${ncurses.out}/share/terminfo" \ + --set TERM "xterm" ''; meta = { - description = "Anonymizing relay monitor for Tor"; + description = "A terminal status monitor for Tor relays"; homepage = "https://www.atagar.com/arm/"; license = stdenv.lib.licenses.gpl3; platforms = stdenv.lib.platforms.unix; |