2019-09-25 22:52:30 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
|
2021-01-17 03:51:22 +00:00
|
|
|
, withGUI ? false, makeWrapper, pkg-config, gtk2 }:
|
2014-09-20 23:50:43 +00:00
|
|
|
|
2019-09-21 12:40:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "thc-hydra";
|
2023-06-18 06:26:12 +00:00
|
|
|
version = "9.5";
|
2014-09-20 23:50:43 +00:00
|
|
|
|
2019-09-21 12:40:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vanhauser-thc";
|
|
|
|
repo = "thc-hydra";
|
|
|
|
rev = "v${version}";
|
2023-06-18 06:26:12 +00:00
|
|
|
sha256 = "sha256-gdMxdFrBGVHA1ZBNFW89PBXwACnXTGJ/e/Z5+xVV5F0=";
|
2014-09-20 23:50:43 +00:00
|
|
|
};
|
|
|
|
|
2019-09-21 12:40:04 +00:00
|
|
|
postPatch = let
|
|
|
|
makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
|
|
|
|
in ''
|
2016-08-11 10:49:10 +00:00
|
|
|
substituteInPlace configure \
|
2019-09-21 12:40:04 +00:00
|
|
|
--replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \
|
|
|
|
--replace '$INCDIRS' "${makeDirs "dev" "include"}" \
|
2016-08-11 17:16:45 +00:00
|
|
|
--replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
|
2016-08-11 10:49:10 +00:00
|
|
|
--replace "libcurses.so" "libncurses.so" \
|
|
|
|
--replace "-lcurses" "-lncurses"
|
2014-09-20 23:50:43 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = lib.optionals withGUI [ pkg-config makeWrapper ];
|
2019-09-21 12:40:04 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2019-09-25 22:52:30 +00:00
|
|
|
zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql
|
2019-09-21 12:40:04 +00:00
|
|
|
] ++ lib.optional withGUI gtk2;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
DATADIR = "/share/${pname}";
|
2014-09-20 23:50:43 +00:00
|
|
|
|
2016-08-11 10:49:10 +00:00
|
|
|
postInstall = lib.optionalString withGUI ''
|
|
|
|
wrapProgram $out/bin/xhydra \
|
|
|
|
--add-flags --hydra-path --add-flags "$out/bin/hydra"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-09-20 23:50:43 +00:00
|
|
|
description = "A very fast network logon cracker which support many different services";
|
2022-02-10 21:48:12 +00:00
|
|
|
homepage = "https://github.com/vanhauser-thc/thc-hydra"; # https://www.thc.org/
|
|
|
|
changelog = "https://github.com/vanhauser-thc/thc-hydra/raw/v${version}/CHANGES";
|
|
|
|
license = licenses.agpl3Plus;
|
2019-09-21 12:40:04 +00:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2022-01-26 20:45:06 +00:00
|
|
|
platforms = platforms.unix;
|
2023-06-18 06:26:12 +00:00
|
|
|
badPlatforms = platforms.darwin; # fails to build since v9.5
|
2014-09-20 23:50:43 +00:00
|
|
|
};
|
|
|
|
}
|