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