1 { lib, stdenv, fetchurl, fetchpatch, libpcap, pkg-config, openssl, lua5_3
11 stdenv.mkDerivation rec {
16 url = "https://nmap.org/dist/nmap-${version}.tar.bz2";
17 sha256 = "sha256-Vbz+R5PiWsyWukJ02MQijbVQuOjv1yAEs47FWi3RZlE=";
20 patches = [ ./zenmap.patch ]
21 ++ optionals stdenv.cc.isClang [(
22 # Fixes a compile error due an ambiguous reference to bind(2) in
23 # nping/EchoServer.cc, which is otherwise resolved to std::bind.
24 # https://github.com/nmap/nmap/pull/1363
26 url = "https://github.com/nmap/nmap/commit/5bbe66f1bd8cbd3718f5805139e2e8139e6849bb.diff";
27 includes = [ "nping/EchoServer.cc" ];
28 sha256 = "0xcph9mycy57yryjg253frxyz87c4135rrbndlqw1400c8jxq70c";
32 prePatch = optionalString stdenv.isDarwin ''
33 substituteInPlace libz/configure \
34 --replace /usr/bin/libtool ar \
35 --replace 'AR="libtool"' 'AR="ar"' \
36 --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
40 (if withLua then "--with-liblua=${lua5_3}" else "--without-liblua")
41 "--with-liblinear=included"
46 makeFlags = optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
47 "AR=${stdenv.cc.bintools.targetPrefix}ar"
48 "RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib"
49 "CC=${stdenv.cc.targetPrefix}gcc"
52 nativeBuildInputs = [ pkg-config ];
53 buildInputs = [ pcre libssh2 libpcap openssl ];
55 enableParallelBuilding = true;
57 doCheck = false; # fails 3 tests, probably needs the net
60 description = "A free and open source utility for network discovery and security auditing";
61 homepage = "http://www.nmap.org";
62 license = licenses.gpl2;
63 platforms = platforms.all;
64 maintainers = with maintainers; [ thoughtpolice fpletz ];