10 stdenv.mkDerivation rec {
14 src = fetchFromGitHub {
15 owner = "robertdavidgraham";
18 sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
22 # Patches the missing "--resume" functionality
24 name = "resume.patch";
25 url = "https://github.com/robertdavidgraham/masscan/commit/90791550bbdfac8905917a109ed74024161f14b3.patch";
26 sha256 = "sha256-A7Fk3MBNxaad69MrUYg7fdMG77wba5iESDTIRigYslw=";
30 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
31 # Fix broken install command
32 substituteInPlace Makefile --replace "-pm755" "-pDm755"
35 nativeBuildInputs = [ makeWrapper installShellFiles ];
40 "CC=${stdenv.cc.targetPrefix}cc"
43 enableParallelBuilding = true;
46 installManPage doc/masscan.?
48 install -Dm444 -t $out/etc/masscan data/exclude.conf
49 install -Dm444 -t $out/share/doc/masscan doc/*.{html,js,md}
50 install -Dm444 -t $out/share/licenses/masscan LICENSE
52 wrapProgram $out/bin/masscan \
53 --prefix LD_LIBRARY_PATH : "${libpcap}/lib"
56 doInstallCheck = true;
58 installCheckPhase = ''
59 $out/bin/masscan --selftest
63 description = "Fast scan of the Internet";
64 mainProgram = "masscan";
65 homepage = "https://github.com/robertdavidgraham/masscan";
66 changelog = "https://github.com/robertdavidgraham/masscan/releases/tag/${version}";
67 license = licenses.agpl3Only;
68 platforms = platforms.unix;
69 maintainers = with maintainers; [ rnhmjoj ];