1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 file,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "sqlmap";
13 version = "1.9.9";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-7h9683YdzKT+oDToy9GW1+k7LoaHqBBZeLlXiCDelFA=";
21 };
22
23 postPatch = ''
24 substituteInPlace sqlmap/thirdparty/magic/magic.py --replace "ctypes.util.find_library('magic')" \
25 "'${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
26
27 # the check for the last update date does not work in Nix,
28 # since the timestamp of the all files in the nix store is reset to the unix epoch
29 echo 'LAST_UPDATE_NAGGING_DAYS = float("inf")' >> sqlmap/lib/core/settings.py
30 '';
31
32 build-system = [ setuptools ];
33
34 # No tests in archive
35 doCheck = false;
36
37 pythonImportsCheck = [ "sqlmap" ];
38
39 meta = with lib; {
40 description = "Automatic SQL injection and database takeover tool";
41 homepage = "https://sqlmap.org";
42 changelog = "https://github.com/sqlmapproject/sqlmap/releases/tag/${version}";
43 license = licenses.gpl2Plus;
44 maintainers = with maintainers; [ bennofs ];
45 mainProgram = "sqlmap";
46 };
47}