nixpkgs/pkgs/tools/security/thc-hydra/default.nix
Dmitry Kalinkin c455adcc42
Merge branch 'master' into staging-next
Fixes eval on darwin after #69072

Resolved conflict in pkgs/tools/security/thc-hydra/default.nix
Basically had to revert a1c0e10564f9a6281e14d7a7279b8589521e2c48 which
adapts #69210 to master that doesn't yet have
329a88efa78126ae7413807ce58000eab49e82d9

Tested using maintainers/scripts/eval-release.sh before and after to see
that the fix works
2019-09-25 19:21:46 -04:00

49 lines
1.5 KiB
Nix

{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql
, withGUI ? false, makeWrapper, pkgconfig, gtk2 }:
stdenv.mkDerivation rec {
pname = "thc-hydra";
version = "9.0";
src = fetchFromGitHub {
owner = "vanhauser-thc";
repo = "thc-hydra";
rev = "v${version}";
sha256 = "09d2f55wky1iabnl871d4r6dyyvr8zhp47d9j1p6d0pvdv93kl4z";
};
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"
'';
nativeBuildInputs = lib.optionals withGUI [ pkgconfig 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 stdenv.lib; {
description = "A very fast network logon cracker which support many different services";
homepage = "https://www.thc.org/thc-hydra/";
license = licenses.agpl3;
maintainers = with maintainers; [ offline ];
platforms = platforms.linux;
};
}