Files
nixpkgs/pkgs/by-name/th/thc-hydra/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

82 lines
1.8 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
zlib,
openssl,
ncurses,
libidn,
pcre2,
libssh,
libmysqlclient,
libpq,
samba,
withGUI ? false,
makeWrapper,
pkg-config,
gtk2,
}:
stdenv.mkDerivation rec {
pname = "thc-hydra";
version = "9.6";
src = fetchFromGitHub {
owner = "vanhauser-thc";
repo = "thc-hydra";
rev = "v${version}";
sha256 = "sha256-DS3Fh4a6OtqZRHubgJewB7qnJXm10sYv85R6o/NePoU=";
};
postPatch =
let
makeDirs =
output: subDir:
lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
in
''
substituteInPlace configure \
--replace-fail '$LIBDIRS' "${makeDirs "lib" "lib"}" \
--replace-fail '$INCDIRS' "${makeDirs "dev" "include"}" \
--replace-fail "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
--replace-fail "libcurses.so" "libncurses.so" \
--replace-fail "-lcurses" "-lncurses"
'';
nativeBuildInputs = lib.optionals withGUI [
pkg-config
makeWrapper
];
buildInputs = [
zlib
openssl
ncurses
libidn
pcre2
libssh
libmysqlclient
libpq
samba
]
++ lib.optional withGUI gtk2;
enableParallelBuilding = true;
DATADIR = "/share/${pname}";
postInstall = lib.optionalString withGUI ''
wrapProgram $out/bin/xhydra \
--add-flags --hydra-path --add-flags "$out/bin/hydra"
'';
meta = {
description = "Very fast network logon cracker which support many different services";
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 = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ offline ];
platforms = lib.platforms.unix;
};
}