Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / openant / default.nix
blob71f699e0552af4ae383f80e0d860b41523bb1260
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pyusb
5 }:
7 buildPythonPackage {
8   pname = "openant-unstable";
9   version = "2017-02-11";
11   src = fetchFromGitHub {
12     owner = "Tigge";
13     repo = "openant";
14     rev = "ed89281e37f65d768641e87356cef38877952397";
15     sha256 = "1g81l9arqdy09ijswn3sp4d6i3z18d44lzyb78bwnvdb14q22k19";
16   };
18   # Removes some setup.py hacks intended to install udev rules.
19   # We do the job ourselves in postInstall below.
20   postPatch = ''
21     sed -i -e '/cmdclass=.*/d' setup.py
22   '';
24   postInstall = ''
25     install -dm755 "$out/etc/udev/rules.d"
26     install -m644 resources/ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules"
27   '';
29   propagatedBuildInputs = [ pyusb ];
31   meta = with lib; {
32     homepage = "https://github.com/Tigge/openant";
33     description = "ANT and ANT-FS Python Library";
34     license = licenses.mit;
35     platforms = platforms.unix;
36   };