Something went wrong. Try again.
lol
Something went wrong. Try again.
2.2 kB · 92 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293{ lib, buildPythonPackage, fetchFromGitHub, setuptools, setuptools-scm, libusb-package, numpy, packaging, pyusb, scipy, pytestCheckHook, pyyaml, udevCheckHook,}:
buildPythonPackage rec { pname = "cflib"; version = "0.1.31"; pyproject = true;
src = fetchFromGitHub { owner = "bitcraze"; repo = "crazyflie-lib-python"; tag = version; hash = "sha256-PYAkN52dx1qeRKoe5FwpKj1A4oJNYb7Dx8vko9Pwspw="; };
strictDeps = true;
build-system = [ setuptools setuptools-scm ];
pythonRelaxDeps = [ "numpy" "packaging" ];
dependencies = [ libusb-package numpy packaging pyusb scipy ];
disabledTestPaths = [ # exception: Cannot find a Crazyradio Dongle (HW required) "examples/radio/radio_test.py" "sys_test/single_cf_grounded/" "sys_test/swarm_test_rig/" ];
pythonImportsCheck = [ "cflib" ]; nativeCheckInputs = [ pytestCheckHook pyyaml ];
# The udevCheckHook is used to verify udev rules # requires diInstallCheck to be enabled, which is default for pythonPackages nativeInstallCheckInputs = [ udevCheckHook ];
# Install udev rules as defined # https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/installation/usb_permissions/ postInstall = '' # Install udev rules mkdir -p $out/etc/udev/rules.d
cat <<EOF > $out/etc/udev/rules.d/99-bitcraze.rules # Crazyradio (normal operation) SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev" # Bootloader SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev" # Crazyflie (over USB) SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev" EOF '';
meta = { description = "Python library for the Crazyflie quadcopter by Bitcraze"; homepage = "https://github.com/bitcraze/crazyflie-lib-python"; changelog = "https://github.com/bitcraze/crazyflie-lib-python/releases/tag/${src.tag}"; license = lib.licenses.gpl2Only; maintainers = [ lib.maintainers.brianmcgillion ]; platforms = lib.platforms.linux; };}