nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 gobject-introspection,
3 gtk3,
4 lib,
5 nmap,
6 python3Packages,
7 wrapGAppsHook3,
8 xterm,
9}:
10
11python3Packages.buildPythonApplication {
12 pname = "zenmap";
13 version = nmap.version;
14 pyproject = true;
15
16 src = nmap.src;
17
18 prePatch = ''
19 cd zenmap
20 '';
21
22 build-system = with python3Packages; [
23 setuptools
24 setuptools-gettext
25 ];
26
27 buildInputs = [
28 nmap
29 gtk3
30 xterm
31 ];
32
33 nativeBuildInputs = [
34 wrapGAppsHook3
35 gobject-introspection
36 ];
37
38 nativeCheckInputs = [
39 nmap
40 ];
41
42 dependencies = with python3Packages; [
43 pygobject3
44 ];
45
46 dontWrapGApps = true;
47 preFixup = ''
48 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
49 makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ nmap ]})
50 '';
51 postInstall = ''
52 # Icons
53 install -Dm 644 "zenmapCore/data/pixmaps/zenmap.png" -t "$out/share/pixmaps/"
54 # Desktop-files for application
55 install -Dm 644 "install_scripts/unix/zenmap.desktop" -t "$out/share/applications/"
56 install -Dm 644 "install_scripts/unix/zenmap-root.desktop" -t "$out/share/applications/"
57 install -Dm 755 "install_scripts/unix/su-to-zenmap.sh" -t "$out/bin/"
58 substituteInPlace "$out/bin/su-to-zenmap.sh" \
59 --replace-fail 'COMMAND="zenmap"' \
60 'COMMAND="'"$out/bin/zenmap"'"' \
61 --replace-fail 'xterm' \
62 '"${xterm}/bin/xterm"'
63 '';
64
65 checkPhase = ''
66 runHook preCheck
67
68 cd test
69 ${python3Packages.python.interpreter} run_tests.py 2>&1 | tee /dev/stderr | tail -n1 | grep '^OK$'
70
71 runHook postCheck
72 '';
73
74 meta = nmap.meta // {
75 description = "Offical nmap Security Scanner GUI";
76 homepage = "https://nmap.org/zenmap/";
77 maintainers = with lib.maintainers; [
78 dvaerum
79 mymindstorm
80 ];
81 };
82}