mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
cflib: init at 0.1.28
Python library to communicate with and control the crazyflie micro quadcopters. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
This commit is contained in:
parent
14918d8f88
commit
0b95d24dab
2 changed files with 92 additions and 0 deletions
90
pkgs/development/python-modules/cflib/default.nix
Normal file
90
pkgs/development/python-modules/cflib/default.nix
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
setuptools-scm,
|
||||||
|
libusb-package,
|
||||||
|
numpy,
|
||||||
|
packaging,
|
||||||
|
pyserial,
|
||||||
|
pyusb,
|
||||||
|
scipy,
|
||||||
|
pytestCheckHook,
|
||||||
|
pyyaml,
|
||||||
|
udevCheckHook,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "cflib";
|
||||||
|
version = "0.1.28";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "bitcraze";
|
||||||
|
repo = "crazyflie-lib-python";
|
||||||
|
tag = version;
|
||||||
|
hash = "sha256-vGqwQVD80NcFJosVAmqj66uxYNoVtAqzVhVQiuWP5yM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
strictDeps = true;
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
setuptools-scm
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonRelaxDeps = [ "numpy" ];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
libusb-package
|
||||||
|
numpy
|
||||||
|
packaging
|
||||||
|
pyserial
|
||||||
|
pyusb
|
||||||
|
scipy
|
||||||
|
];
|
||||||
|
|
||||||
|
disabledTestPaths = [
|
||||||
|
# exception: Cannot find a Crazyradio Dongle (HW required)
|
||||||
|
"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/${version}";
|
||||||
|
license = lib.licenses.gpl2Only;
|
||||||
|
maintainers = [ lib.maintainers.brianmcgillion ];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
|
@ -2366,6 +2366,8 @@ self: super: with self; {
|
||||||
|
|
||||||
cfgv = callPackage ../development/python-modules/cfgv { };
|
cfgv = callPackage ../development/python-modules/cfgv { };
|
||||||
|
|
||||||
|
cflib = callPackage ../development/python-modules/cflib { };
|
||||||
|
|
||||||
cfn-flip = callPackage ../development/python-modules/cfn-flip { };
|
cfn-flip = callPackage ../development/python-modules/cfn-flip { };
|
||||||
|
|
||||||
cfn-lint = callPackage ../development/python-modules/cfn-lint { };
|
cfn-lint = callPackage ../development/python-modules/cfn-lint { };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue