dragnpkgs/pkgs/reverse-engineering/ghidra/python/pyghidra.nix

44 lines
762 B
Nix

{
lib,
python,
buildPythonPackage,
ghidra,
setuptools,
jpype1,
}: buildPythonPackage {
pname = "pyghidra";
version = "2.1.0";
pyproject = true;
src = "${ghidra.lib}/lib/ghidra/Ghidra/Features/PyGhidra/pypkg";
# TODO: make a more involved wrapper or patch this package to change the launch system
# TODO: support launching a ghidra-with-extensions package
makeWrapperArgs = [
"--set" "GHIDRA_INSTALL_DIR" "${ghidra.lib}/lib/ghidra"
];
postPatch = ''
rm -rf dist
'';
build-system = [
setuptools
];
dependencies = [
jpype1
];
pythonImportsCheck = [
"pyghidra"
];
meta = (lib.removeAttrs ghidra.meta ["description" "mainProgram"]) // {
description = "Native CPython for Ghidra";
};
}