1{ 2 lib, 3 fetchFromGitHub, 4 rustPlatform, 5 cffi, 6 libiconv, 7 buildPythonPackage, 8 appdirs, 9 pyyaml, 10 hypothesis, 11 jinja2, 12 pytestCheckHook, 13 unzip, 14}: 15 16buildPythonPackage rec { 17 pname = "cmsis-pack-manager"; 18 version = "0.5.2"; 19 format = "pyproject"; 20 21 src = fetchFromGitHub { 22 owner = "pyocd"; 23 repo = "cmsis-pack-manager"; 24 tag = "v${version}"; 25 hash = "sha256-PeyJf3TGUxv8/MKIQUgWrenrK4Hb+4cvtDA2h3r6kGg="; 26 }; 27 28 cargoDeps = rustPlatform.fetchCargoVendor { 29 inherit src; 30 hash = "sha256-OBh5WWSekrqdLLmxEXS0LfPIfy4QWKYgO+8o6PYWjN4="; 31 }; 32 33 nativeBuildInputs = [ 34 rustPlatform.cargoSetupHook 35 rustPlatform.maturinBuildHook 36 ]; 37 propagatedNativeBuildInputs = [ cffi ]; 38 buildInputs = [ 39 libiconv 40 ]; 41 propagatedBuildInputs = [ 42 appdirs 43 pyyaml 44 ]; 45 nativeCheckInputs = [ 46 hypothesis 47 jinja2 48 pytestCheckHook 49 unzip 50 ]; 51 52 # remove cmsis_pack_manager source directory so that binaries can be imported 53 # from the installed wheel instead 54 preCheck = '' 55 rm -r cmsis_pack_manager 56 ''; 57 58 disabledTests = [ 59 # All require DNS. 60 "test_pull_pdscs" 61 "test_install_pack" 62 "test_pull_pdscs_cli" 63 "test_dump_parts_cli" 64 ]; 65 66 meta = with lib; { 67 description = "Rust and Python module for handling CMSIS Pack files"; 68 homepage = "https://github.com/pyocd/cmsis-pack-manager"; 69 license = licenses.asl20; 70 maintainers = with maintainers; [ 71 frogamic 72 sbruder 73 ]; 74 }; 75}