1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 setuptools,
7 setuptools-scm,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "dissect-cstruct";
14 version = "4.3";
15 pyproject = true;
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "fox-it";
21 repo = "dissect.cstruct";
22 tag = version;
23 hash = "sha256-Y6maLjugnso3cc9zyiZ/6AdrftYAAImYNBDXPJdTuWc=";
24 };
25
26 patches = [
27 (fetchpatch {
28 name = "fix-test_types_enum.patch";
29 url = "https://github.com/fox-it/dissect.cstruct/commit/b6c73136828fc2ae59b51d1f68529002d7c37131.diff";
30 hash = "sha256-hicMolFu/qAw9QkOyug4PNm2Do2PxuXNXPB+/JHOaFg=";
31 })
32 ];
33
34 build-system = [
35 setuptools
36 setuptools-scm
37 ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 pythonImportsCheck = [ "dissect.cstruct" ];
42
43 meta = with lib; {
44 description = "Dissect module implementing a parser for C-like structures";
45 homepage = "https://github.com/fox-it/dissect.cstruct";
46 changelog = "https://github.com/fox-it/dissect.cstruct/releases/tag/${version}";
47 license = licenses.agpl3Only;
48 maintainers = with maintainers; [ fab ];
49 };
50}