nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at r-updates 75 lines 1.6 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 bellows, 12 click, 13 coloredlogs, 14 crc, 15 libgpiod, 16 pyserial-asyncio-fast, 17 typing-extensions, 18 zigpy, 19 20 # tests 21 pytestCheckHook, 22 pytest-asyncio, 23 pytest-mock, 24 pytest-timeout, 25}: 26 27buildPythonPackage rec { 28 pname = "universal-silabs-flasher"; 29 version = "0.1.3"; 30 pyproject = true; 31 32 src = fetchFromGitHub { 33 owner = "NabuCasa"; 34 repo = "universal-silabs-flasher"; 35 tag = "v${version}"; 36 hash = "sha256-VBMxm953xp0qt4MIfOSjFNQu2jOh52uQ9Zz94NWy3dY="; 37 }; 38 39 postPatch = '' 40 substituteInPlace pyproject.toml \ 41 --replace-fail '"setuptools-git-versioning>=2.0,<3"' "" \ 42 --replace-fail 'dynamic = ["version"]' 'version = "${version}"' 43 ''; 44 45 build-system = [ setuptools ]; 46 47 dependencies = [ 48 bellows 49 click 50 coloredlogs 51 crc 52 pyserial-asyncio-fast 53 typing-extensions 54 zigpy 55 ] 56 ++ lib.optionals (stdenv.hostPlatform.isLinux) [ libgpiod ]; 57 58 nativeCheckInputs = [ 59 pytestCheckHook 60 pytest-asyncio 61 pytest-mock 62 pytest-timeout 63 ]; 64 65 pythonImportsCheck = [ "universal_silabs_flasher" ]; 66 67 meta = { 68 changelog = "https://github.com/NabuCasa/universal-silabs-flasher/releases/tag/${src.tag}"; 69 description = "Flashes Silicon Labs radios running EmberZNet or CPC multi-pan firmware"; 70 mainProgram = "universal-silabs-flasher"; 71 homepage = "https://github.com/NabuCasa/universal-silabs-flasher"; 72 license = lib.licenses.gpl3Only; 73 maintainers = with lib.maintainers; [ hexa ]; 74 }; 75}