From 6fd8fb98d92940ab377794c6675df31c2c02846f Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 14:37:10 -0400 Subject: [PATCH] pythonPackages.openant: refactor move to python-modules --- .../python-modules/openant/default.nix | 38 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 31 +-------------- 2 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 pkgs/development/python-modules/openant/default.nix diff --git a/pkgs/development/python-modules/openant/default.nix b/pkgs/development/python-modules/openant/default.nix new file mode 100644 index 000000000000..9b88a71c5cc0 --- /dev/null +++ b/pkgs/development/python-modules/openant/default.nix @@ -0,0 +1,38 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, pyusb +}: + +buildPythonPackage rec { + pname = "openant-unstable"; + version = "2017-02-11"; + + src = fetchFromGitHub { + owner = "Tigge"; + repo = "openant"; + rev = "ed89281e37f65d768641e87356cef38877952397"; + sha256 = "1g81l9arqdy09ijswn3sp4d6i3z18d44lzyb78bwnvdb14q22k19"; + }; + + # Removes some setup.py hacks intended to install udev rules. + # We do the job ourselves in postInstall below. + postPatch = '' + sed -i -e '/cmdclass=.*/d' setup.py + ''; + + postInstall = '' + install -dm755 "$out/etc/udev/rules.d" + install -m644 resources/ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules" + ''; + + propagatedBuildInputs = [ pyusb ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/Tigge/openant"; + description = "ANT and ANT-FS Python Library"; + license = licenses.mit; + platforms = platforms.linux; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c9977ca48cd0..44716eeb131f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1411,36 +1411,7 @@ in { wakeonlan = callPackage ../development/python-modules/wakeonlan { }; - openant = buildPythonPackage rec { - name = "openant-unstable-2017-02-11"; - - meta = with stdenv.lib; { - homepage = "https://github.com/Tigge/openant"; - description = "ANT and ANT-FS Python Library"; - license = licenses.mit; - platforms = platforms.linux; - }; - - src = pkgs.fetchFromGitHub { - owner = "Tigge"; - repo = "openant"; - rev = "ed89281e37f65d768641e87356cef38877952397"; - sha256 = "1g81l9arqdy09ijswn3sp4d6i3z18d44lzyb78bwnvdb14q22k19"; - }; - - # Removes some setup.py hacks intended to install udev rules. - # We do the job ourselves in postInstall below. - postPatch = '' - sed -i -e '/cmdclass=.*/d' setup.py - ''; - - postInstall = '' - install -dm755 "$out/etc/udev/rules.d" - install -m644 resources/ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules" - ''; - - propagatedBuildInputs = with self; [ pyusb ]; - }; + openant = callPackage ../development/python-modules/openant { }; opencv = toPythonModule (pkgs.opencv.override { enablePython = true;