`buildDotnetModule`: add support for installing pre-release tools (#374663)
[NixPkgs.git] / pkgs / development / python-modules / cmsis-pack-manager / default.nix
blob40a821b80eee09a22e5e49e333da6f8b176eeeb5
2   lib,
3   fetchFromGitHub,
4   rustPlatform,
5   cffi,
6   libiconv,
7   stdenv,
8   darwin,
9   buildPythonPackage,
10   appdirs,
11   pyyaml,
12   hypothesis,
13   jinja2,
14   pytestCheckHook,
15   unzip,
18 buildPythonPackage rec {
19   pname = "cmsis-pack-manager";
20   version = "0.5.2";
21   format = "pyproject";
23   src = fetchFromGitHub {
24     owner = "pyocd";
25     repo = "cmsis-pack-manager";
26     tag = "v${version}";
27     hash = "sha256-PeyJf3TGUxv8/MKIQUgWrenrK4Hb+4cvtDA2h3r6kGg=";
28   };
30   cargoDeps = rustPlatform.fetchCargoTarball {
31     inherit src;
32     hash = "sha256-dO4qw5Jx0exwb4RuOhu6qvGxQZ+LayHtXDHZKADLTEI=";
33   };
35   nativeBuildInputs = [
36     rustPlatform.cargoSetupHook
37     rustPlatform.maturinBuildHook
38   ];
39   propagatedNativeBuildInputs = [ cffi ];
40   buildInputs = [
41     libiconv
42   ] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.Security;
43   propagatedBuildInputs = [
44     appdirs
45     pyyaml
46   ];
47   nativeCheckInputs = [
48     hypothesis
49     jinja2
50     pytestCheckHook
51     unzip
52   ];
54   # remove cmsis_pack_manager source directory so that binaries can be imported
55   # from the installed wheel instead
56   preCheck = ''
57     rm -r cmsis_pack_manager
58   '';
60   disabledTests = [
61     # All require DNS.
62     "test_pull_pdscs"
63     "test_install_pack"
64     "test_pull_pdscs_cli"
65     "test_dump_parts_cli"
66   ];
68   meta = with lib; {
69     description = "Rust and Python module for handling CMSIS Pack files";
70     homepage = "https://github.com/pyocd/cmsis-pack-manager";
71     license = licenses.asl20;
72     maintainers = with maintainers; [
73       frogamic
74       sbruder
75     ];
76   };