about summary refs log tree commit diff
path: root/pkgs/by-name/ey/eyewitness/package.nix
blob: 7cda284f6be8070c84f44053665d3bdc08d308a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib
, fetchFromGitHub
, python3Packages
, cmake
, xvfb-run
, firefox-esr
, geckodriver
, makeWrapper
}:

python3Packages.buildPythonApplication rec {
  pname = "eye-witness";
  version = "20230525.1";
  format = "other";

  src = fetchFromGitHub {
    owner = "redsiege";
    repo = "EyeWitness";
    rev = "v${version}";
    hash = "sha256-nSPpPbwqagc5EadQ4AHgLhjQ0kDjmbdcwE/PL5FDL4I=";
  };

  build-system = with python3Packages; [
    setuptools
  ] ++ [
    makeWrapper
  ];

  dependencies = with python3Packages; [
    selenium
    fuzzywuzzy
    pyvirtualdisplay
    pylev
    netaddr
    pydevtool
  ] ++ [
    firefox-esr
    xvfb-run
    geckodriver
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/{bin,share/eyewitness}
    cp -R * $out/share/eyewitness

    runHook postInstall
  '';

  fixupPhase = ''
    runHook preFixup

    makeWrapper "${python3Packages.python.interpreter}" "$out/bin/eyewitness" \
      --set PYTHONPATH "$PYTHONPATH" \
      --add-flags "$out/share/eyewitness/Python/EyeWitness.py"

    runHook postFixup
  '';

  meta = with lib; {
    description = "Take screenshots of websites, and identify admin interfaces";
    homepage = "https://github.com/redsiege/EyeWitness";
    changelog = "https://github.com/redsiege/EyeWitness/blob/${src.rev}/CHANGELOG";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ tochiaha ];
    mainProgram = "eye-witness";
    platforms = platforms.all;
  };
}