2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
fetchpatch,
|
|
|
|
capstone_4,
|
|
|
|
cmsis-pack-manager,
|
|
|
|
colorama,
|
|
|
|
importlib-metadata,
|
|
|
|
importlib-resources,
|
|
|
|
intelhex,
|
|
|
|
intervaltree,
|
|
|
|
lark,
|
|
|
|
natsort,
|
|
|
|
prettytable,
|
|
|
|
pyelftools,
|
|
|
|
pylink-square,
|
|
|
|
pyusb,
|
|
|
|
pyyaml,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
typing-extensions,
|
|
|
|
stdenv,
|
|
|
|
hidapi,
|
|
|
|
pytestCheckHook,
|
2022-08-21 13:32:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyocd";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.36.0";
|
|
|
|
pyproject = true;
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-k3eCrMna/wVNUPt8b3iM2UqE+A8LhfJarKuZ3Jgihkg=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# https://github.com/pyocd/pyOCD/pull/1332
|
|
|
|
(fetchpatch {
|
|
|
|
name = "libusb-package-optional.patch";
|
|
|
|
url = "https://github.com/pyocd/pyOCD/commit/0b980cf253e3714dd2eaf0bddeb7172d14089649.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-B2+50VntcQELeakJbCeJdgI1iBU+h2NkXqba+LRYa/0=";
|
2022-08-21 13:32:41 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "libusb-package>=1.0,<2.0" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
capstone_4
|
2022-08-21 13:32:41 +00:00
|
|
|
cmsis-pack-manager
|
|
|
|
colorama
|
2023-11-16 04:20:00 +00:00
|
|
|
importlib-metadata
|
|
|
|
importlib-resources
|
2022-08-21 13:32:41 +00:00
|
|
|
intelhex
|
|
|
|
intervaltree
|
2023-11-16 04:20:00 +00:00
|
|
|
lark
|
2022-08-21 13:32:41 +00:00
|
|
|
natsort
|
|
|
|
prettytable
|
|
|
|
pyelftools
|
|
|
|
pylink-square
|
|
|
|
pyusb
|
|
|
|
pyyaml
|
|
|
|
typing-extensions
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isLinux) [ hidapi ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pyocd" ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/pyocd/pyOCD/releases/tag/v${version}";
|
2022-08-21 13:32:41 +00:00
|
|
|
description = "Python library for programming and debugging Arm Cortex-M microcontrollers";
|
2023-11-16 04:20:00 +00:00
|
|
|
downloadPage = "https://github.com/pyocd/pyOCD";
|
|
|
|
homepage = "https://pyocd.io";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = licenses.asl20;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
frogamic
|
|
|
|
sbruder
|
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
}
|