at 23.05-pre 72 lines 1.4 kB view raw
1{ lib 2, buildPythonPackage 3, fetchPypi 4, fetchpatch 5, capstone 6, cmsis-pack-manager 7, colorama 8, intelhex 9, intervaltree 10, natsort 11, prettytable 12, pyelftools 13, pylink-square 14, pyusb 15, pyyaml 16, typing-extensions 17, stdenv 18, hidapi 19, pytestCheckHook 20}: 21 22buildPythonPackage rec { 23 pname = "pyocd"; 24 version = "0.34.1"; 25 26 src = fetchPypi { 27 inherit pname version; 28 sha256 = "sha256-Fpa2IEsLOQ8ylGI/5D6h+22j1pvrvE9IMIyhCtyM6qU="; 29 }; 30 31 patches = [ 32 # https://github.com/pyocd/pyOCD/pull/1332 33 (fetchpatch { 34 name = "libusb-package-optional.patch"; 35 url = "https://github.com/pyocd/pyOCD/commit/0b980cf253e3714dd2eaf0bddeb7172d14089649.patch"; 36 sha256 = "sha256-B2+50VntcQELeakJbCeJdgI1iBU+h2NkXqba+LRYa/0="; 37 }) 38 ]; 39 40 propagatedBuildInputs = [ 41 capstone 42 cmsis-pack-manager 43 colorama 44 intelhex 45 intervaltree 46 natsort 47 prettytable 48 pyelftools 49 pylink-square 50 pyusb 51 pyyaml 52 typing-extensions 53 ] ++ lib.optionals (!stdenv.isLinux) [ 54 hidapi 55 ]; 56 57 checkInputs = [ pytestCheckHook ]; 58 59 pythonImportsCheck = [ "pyocd" ]; 60 61 postPatch = '' 62 substituteInPlace setup.cfg \ 63 --replace "libusb-package>=1.0,<2.0" "" 64 ''; 65 66 meta = with lib; { 67 description = "Python library for programming and debugging Arm Cortex-M microcontrollers"; 68 homepage = "https://pyocd.io/"; 69 license = licenses.asl20; 70 maintainers = with maintainers; [ frogamic sbruder ]; 71 }; 72}