1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 jpype1,
6 pytest-datadir,
7 pytestCheckHook,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "pyhidra";
13 version = "1.3.0";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "dod-cyber-crime-center";
18 repo = "pyhidra";
19 tag = version;
20 hash = "sha256-8xouU+S7Apy1ySIlvOLPerTApqKy/MNdl9vuBdt+9Vk=";
21 };
22
23 build-system = [ setuptools ];
24
25 dependencies = [ jpype1 ];
26
27 nativeCheckInputs = [
28 pytest-datadir
29 pytestCheckHook
30 ];
31
32 pythonImportsCheck = [ "pyhidra" ];
33
34 disabledTests = [
35 # Tests require a running Ghidra instance
36 "test_invalid_jpype_keyword_arg"
37 "test_invalid_vm_arg_succeed"
38 "test_run_script"
39 "test_open_program"
40 "test_no_compiler"
41 "test_no_language_with_compiler"
42 "test_loader"
43 "test_invalid_loader_type"
44 "test_no_project"
45 "test_no_program"
46 "test_import_script"
47 "test_import_ghidra_base_java_packages"
48 ];
49
50 meta = {
51 description = "Provides direct access to the Ghidra API within a native CPython interpreter using jpype";
52 homepage = "https://github.com/dod-cyber-crime-center/pyhidra";
53 changelog = "https://github.com/dod-cyber-crime-center/pyhidra/blob/${src.tag}/CHANGELOG.md";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [ scoder12 ];
56 };
57}