about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-08-11 13:49:10 +0300
committerNikolay Amiantov <ab@fmap.me>2016-08-11 13:49:25 +0300
commit1d726ace0ccfe7d707be8aff9871f19e6102fd21 (patch)
tree0ae62b51c2a128de5ca0d61866503fd6224a1482
parent526291231b4f57386b841c8ff148546ae1e4ce62 (diff)
downloadnixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar.gz
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar.bz2
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar.lz
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar.xz
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.tar.zst
nixlib-1d726ace0ccfe7d707be8aff9871f19e6102fd21.zip
thc-hydra: 7.5 -> 8.2
-rw-r--r--pkgs/tools/security/thc-hydra/default.nix34
1 files changed, 23 insertions, 11 deletions
diff --git a/pkgs/tools/security/thc-hydra/default.nix b/pkgs/tools/security/thc-hydra/default.nix
index a06754cb58d2..3130e65984ac 100644
--- a/pkgs/tools/security/thc-hydra/default.nix
+++ b/pkgs/tools/security/thc-hydra/default.nix
@@ -1,29 +1,41 @@
-{ stdenv, fetchurl, pkgconfig, openssl, libidn, ncurses, pcre, libssh, postgresql92 }:
+{ stdenv, lib, fetchurl, zlib, openssl, ncurses, libidn, pcre, libssh, libmysql, postgresql
+, withGUI ? false, makeWrapper, pkgconfig, gtk2 }:
 
-with stdenv.lib;
+let
+  makeDirs = output: subDir: pkgs: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) pkgs);
 
-stdenv.mkDerivation rec {
+in stdenv.mkDerivation rec {
   name = "thc-hydra-${version}";
-  version = "7.5";
+  version = "8.2";
 
   src = fetchurl {
     url = "http://www.thc.org/releases/hydra-${version}.tar.gz";
-    sha256 = "1dhavbn2mcm6c2c1qw29ipbpmczax3vhhlxzwn49c8cq471yg4vj";
+    sha256 = "1i2a5glmrxdjr80gfppx6wgakflcpj3ksgng212fjzhxr9m4k24y";
   };
 
   preConfigure = ''
-   substituteInPlace configure --replace "\$LIBDIRS" "${openssl.out}/lib ${pcre.out}/lib ${libssh.out}/lib ${postgresql92.lib}/lib"
-   substituteInPlace configure --replace "\$INCDIRS" "${openssl.dev}/include ${pcre.dev}/include ${libssh.dev}/include ${postgresql92}/include"
+    substituteInPlace configure \
+      --replace "\$LIBDIRS" "${makeDirs "lib" "lib" buildInputs}" \
+      --replace "\$INCDIRS" "${makeDirs "dev" "include" buildInputs}" \
+      --replace "/usr/include/math.h" "${stdenv.glibc.dev}/include/math.h" \
+      --replace "libcurses.so" "libncurses.so" \
+      --replace "-lcurses" "-lncurses"
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ openssl libidn ncurses pcre libssh ];
+  nativeBuildInputs = lib.optionals withGUI [ pkgconfig makeWrapper ];
+  buildInputs = [ zlib openssl ncurses libidn pcre libssh libmysql postgresql ]
+                ++ lib.optional withGUI gtk2;
 
-  meta = {
+  postInstall = lib.optionalString withGUI ''
+    wrapProgram $out/bin/xhydra \
+      --add-flags --hydra-path --add-flags "$out/bin/hydra"
+  '';
+
+  meta = with stdenv.lib; {
     description = "A very fast network logon cracker which support many different services";
     license = licenses.agpl3;
     homepage = https://www.thc.org/thc-hydra/;
     maintainers = with maintainers; [offline];
-    platforms = platforms.unix;
+    platforms = platforms.linux;
   };
 }