python3Packages.malduck: fix build on python 3.14

This commit is contained in:
Harinn
2026-05-18 20:00:08 +07:00
parent 061f2fd919
commit 47138f4e6e
2 changed files with 16 additions and 0 deletions
@@ -9,6 +9,7 @@
pefile,
pycryptodomex,
pyelftools,
pythonAtLeast,
setuptools,
pytestCheckHook,
typing-extensions,
@@ -27,6 +28,11 @@ buildPythonPackage rec {
hash = "sha256-Btx0HxiZWrb0TDpBokQGtBE2EDK0htONe/DwqlPgAd4=";
};
patches = lib.optionals (pythonAtLeast "3.14") [
# python 3.14 ctypes rejects `_pack_` without `_layout_ = "ms"`.
./python-3.14-ctypes-layout.patch
];
build-system = [ setuptools ];
dependencies = [
@@ -0,0 +1,10 @@
--- a/malduck/structure.py
+++ b/malduck/structure.py
@@ -53,6 +53,7 @@
fields.append((field, type_))
class Klass(ctypes.Structure):
+ _layout_ = "ms"
_pack_ = self._pack_
_fields_ = fields