python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / masscan / default.nix
blobb7924936d6caf0bf57197077b0297dcc26a68055
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , installShellFiles
5 , makeWrapper
6 , libpcap
7 }:
9 stdenv.mkDerivation rec {
10   pname = "masscan";
11   version = "1.3.2";
13   src = fetchFromGitHub {
14     owner = "robertdavidgraham";
15     repo = "masscan";
16     rev = version;
17     sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
18   };
20   postPatch = lib.optionalString stdenv.isDarwin ''
21     # Fix broken install command
22     substituteInPlace Makefile --replace "-pm755" "-pDm755"
23   '';
25   nativeBuildInputs = [ makeWrapper installShellFiles ];
27   makeFlags = [
28     "PREFIX=$(out)"
29     "GITVER=${version}"
30     "CC=${stdenv.cc.targetPrefix}cc"
31   ];
33   enableParallelBuilding = true;
35   postInstall = ''
36     installManPage doc/masscan.?
38     install -Dm444 -t $out/etc/masscan            data/exclude.conf
39     install -Dm444 -t $out/share/doc/masscan      doc/*.{html,js,md}
40     install -Dm444 -t $out/share/licenses/masscan LICENSE
42     wrapProgram $out/bin/masscan \
43       --prefix LD_LIBRARY_PATH : "${libpcap}/lib"
44   '';
46   doInstallCheck = true;
48   installCheckPhase = ''
49     $out/bin/masscan --selftest
50   '';
52   meta = with lib; {
53     description = "Fast scan of the Internet";
54     homepage = "https://github.com/robertdavidgraham/masscan";
55     changelog = "https://github.com/robertdavidgraham/masscan/releases/tag/${version}";
56     license = licenses.agpl3Only;
57     platforms = platforms.unix;
58     maintainers = with maintainers; [ rnhmjoj ];
59   };