nixpkgs/pkgs/tools/security/thc-hydra/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

52 lines
1.7 KiB
Nix

{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
, withGUI ? false, makeWrapper, pkg-config, gtk2 }:
stdenv.mkDerivation rec {
pname = "thc-hydra";
version = "9.5";
src = fetchFromGitHub {
owner = "vanhauser-thc";
repo = "thc-hydra";
rev = "v${version}";
sha256 = "sha256-gdMxdFrBGVHA1ZBNFW89PBXwACnXTGJ/e/Z5+xVV5F0=";
};
postPatch = let
makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs);
in ''
substituteInPlace configure \
--replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \
--replace '$INCDIRS' "${makeDirs "dev" "include"}" \
--replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \
--replace "libcurses.so" "libncurses.so" \
--replace "-lcurses" "-lncurses"
'';
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-undef-prefix";
nativeBuildInputs = lib.optionals withGUI [ pkg-config makeWrapper ];
buildInputs = [
zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql
] ++ 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 = with lib; {
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 = licenses.agpl3Plus;
maintainers = with maintainers; [ offline ];
platforms = platforms.unix;
};
}