1 { stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
2 , withGUI ? false, makeWrapper, pkg-config, gtk2 }:
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
9 owner = "vanhauser-thc";
12 sha256 = "sha256-+UkMJmIUIt/yTGY07Q4nu1zbWQq5chTvMNQSh5U/fTU=";
16 makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
18 substituteInPlace configure \
19 --replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \
20 --replace '$INCDIRS' "${makeDirs "dev" "include"}" \
21 --replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
22 --replace "libcurses.so" "libncurses.so" \
23 --replace "-lcurses" "-lncurses"
26 nativeBuildInputs = lib.optionals withGUI [ pkg-config makeWrapper ];
29 zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql
30 ] ++ lib.optional withGUI gtk2;
32 enableParallelBuilding = true;
34 DATADIR = "/share/${pname}";
36 postInstall = lib.optionalString withGUI ''
37 wrapProgram $out/bin/xhydra \
38 --add-flags --hydra-path --add-flags "$out/bin/hydra"
42 description = "A very fast network logon cracker which support many different services";
43 homepage = "https://github.com/vanhauser-thc/thc-hydra"; # https://www.thc.org/
44 changelog = "https://github.com/vanhauser-thc/thc-hydra/raw/v${version}/CHANGES";
45 license = licenses.agpl3Plus;
46 maintainers = with maintainers; [ offline ];
47 platforms = platforms.unix;
48 badPlatforms = platforms.darwin; # fails to build since v9.4