@@ -0,0 +1,40 @@
1+{ stdenv, pythonPackages, fetchurl, makeWrapper }:
2+
3+with pythonPackages;
4+buildPythonApplication rec {
5+ pname = "photon";
6+ version = "1.0.7";
7+
8+ src = fetchurl {
9+ url = "https://github.com/s0md3v/Photon/archive/v${version}.tar.gz";
10+ sha256 = "0c5l1sbkkagfxmh8v7yvi6z58mhqbwjyr7fczb5qwxm7la42ah9y";
11+ };
12+
13+ patches = [ ./destdir.patch ];
14+ postPatch = ''
15+ substituteInPlace photon.py --replace DESTDIR $out/share/photon
16+ '';
17+
18+ dontBuild = true;
19+ doCheck = false;
20+ propagatedBuildInputs = [
21+ requests
22+ urllib3
23+ ];
24+
25+ installPhase = ''
26+ mkdir -p "$out"/{bin,share/photon}
27+ cp -R photon.py core plugins $out/share/photon
28+
29+ makeWrapper ${python.interpreter} $out/bin/photon \
30+ --set PYTHONPATH "$PYTHONPATH:$out/share/photon" \
31+ --add-flags "-O $out/share/photon/photon.py"
32+ '';
33+
34+ meta = with stdenv.lib; {
35+ description = "a lightning fast web crawler which extracts URLs, files, intel & endpoints from a target";
36+ homepage = https://github.com/s0md3v/Photon;
37+ license = licenses.gpl3;
38+ maintainers = with maintainers; [ genesis ];
39+ };
40+}