16 stdenv.mkDerivation rec {
21 url = "https://nmap.org/dist/nmap-${version}.tar.bz2";
22 hash = "sha256-4Uq1MOR7Wv2I8ciiusf4nNj+a0eOItJVxbm923ocV3g=";
25 prePatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
26 substituteInPlace libz/configure \
27 --replace /usr/bin/libtool ar \
28 --replace 'AR="libtool"' 'AR="ar"' \
29 --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
33 (if withLua then "--with-liblua=${lua5_4}" else "--without-liblua")
39 install -m 444 -D nselib/data/passwords.lst $out/share/wordlists/nmap.lst
42 postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
43 install_name_tool -change liblinear.so.5 ${liblinear.out}/lib/liblinear.5.dylib $out/bin/nmap
46 makeFlags = lib.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 ];
62 enableParallelBuilding = true;
64 doCheck = false; # fails 3 tests, probably needs the net
67 description = "Free and open source utility for network discovery and security auditing";
68 homepage = "http://www.nmap.org";
69 changelog = "https://nmap.org/changelog.html#${version}";
70 license = lib.licenses.gpl2Only;
71 platforms = lib.platforms.all;
72 maintainers = with lib.maintainers; [