Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, libmysqlclient, postgresql 2, withGUI ? false, makeWrapper, pkg-config, gtk2 }: 3 4stdenv.mkDerivation rec { 5 pname = "thc-hydra"; 6 version = "9.4"; 7 8 src = fetchFromGitHub { 9 owner = "vanhauser-thc"; 10 repo = "thc-hydra"; 11 rev = "v${version}"; 12 sha256 = "sha256-+UkMJmIUIt/yTGY07Q4nu1zbWQq5chTvMNQSh5U/fTU="; 13 }; 14 15 postPatch = let 16 makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs); 17 in '' 18 substituteInPlace configure \ 19 --replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \ 20 --replace '$INCDIRS' "${makeDirs "dev" "include"}" \ 21 --replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \ 22 --replace "libcurses.so" "libncurses.so" \ 23 --replace "-lcurses" "-lncurses" 24 ''; 25 26 nativeBuildInputs = lib.optionals withGUI [ pkg-config makeWrapper ]; 27 28 buildInputs = [ 29 zlib openssl ncurses libidn pcre libssh libmysqlclient postgresql 30 ] ++ lib.optional withGUI gtk2; 31 32 enableParallelBuilding = true; 33 34 DATADIR = "/share/${pname}"; 35 36 postInstall = lib.optionalString withGUI '' 37 wrapProgram $out/bin/xhydra \ 38 --add-flags --hydra-path --add-flags "$out/bin/hydra" 39 ''; 40 41 meta = with lib; { 42 description = "A very fast network logon cracker which support many different services"; 43 homepage = "https://github.com/vanhauser-thc/thc-hydra"; # https://www.thc.org/ 44 changelog = "https://github.com/vanhauser-thc/thc-hydra/raw/v${version}/CHANGES"; 45 license = licenses.agpl3Plus; 46 maintainers = with maintainers; [ offline ]; 47 platforms = platforms.unix; 48 badPlatforms = platforms.darwin; # fails to build since v9.4 49 }; 50}