nixpkgs-suyu/pkgs/tools/security/thc-hydra/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
2016-08-11 12:49:10 +02:00
, withGUI ? false, makeWrapper, pkgconfig, gtk2 }:
2019-09-21 14:40:04 +02:00
stdenv.mkDerivation rec {
pname = "thc-hydra";
2020-07-31 13:31:11 +02:00
version = "9.1";
2019-09-21 14:40:04 +02:00
src = fetchFromGitHub {
owner = "vanhauser-thc";
repo = "thc-hydra";
rev = "v${version}";
2020-07-31 13:31:11 +02:00
sha256 = "1533h9z5jdlazwy0z7ll2753i507wq55by7rm9lh6y59889p0hps";
};
2019-09-21 14:40:04 +02:00
postPatch = let
makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
in ''
2016-08-11 12:49:10 +02:00
substituteInPlace configure \
2019-09-21 14:40:04 +02:00
--replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \
--replace '$INCDIRS' "${makeDirs "dev" "include"}" \
--replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
2016-08-11 12:49:10 +02:00
--replace "libcurses.so" "libncurses.so" \
--replace "-lcurses" "-lncurses"
'';
2016-08-11 12:49:10 +02:00
nativeBuildInputs = lib.optionals withGUI [ pkgconfig makeWrapper ];
2019-09-21 14:40:04 +02:00
buildInputs = [
zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql
2019-09-21 14:40:04 +02:00
] ++ lib.optional withGUI gtk2;
enableParallelBuilding = true;
DATADIR = "/share/${pname}";
2016-08-11 12:49:10 +02:00
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";
2019-09-21 14:40:04 +02:00
homepage = "https://www.thc.org/thc-hydra/";
license = licenses.agpl3;
2019-09-21 14:40:04 +02:00
maintainers = with maintainers; [ offline ];
2016-08-11 12:49:10 +02:00
platforms = platforms.linux;
};
}