diff --git a/pkgs/development/python-modules/ds4drv.nix b/pkgs/development/python-modules/ds4drv.nix new file mode 100644 index 000000000000..8698a65ea11b --- /dev/null +++ b/pkgs/development/python-modules/ds4drv.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildPythonPackage +, evdev, pyudev +, bluez +}: + +buildPythonPackage rec { + name = "ds4drv-${version}"; + version = "0.5.1"; + + # PyPi only carries py3 wheel + src = fetchFromGitHub { + owner = "chrippa"; + repo = "ds4drv"; + rev = "v${version}"; + sha256 = "0vinpla0apizzykcyfis79mrm1i6fhns83nkzw85svypdhkx2g8v"; + }; + + propagatedBuildInputs = [ evdev pyudev ]; + + buildInputs = [ bluez ]; + + meta = { + description = "Userspace driver for the DualShock 4 controller"; + homepage = "https://github.com/chrippa/ds4drv"; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ae004f669471..4e6493d910c7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6590,24 +6590,8 @@ in { }; }; - ds4drv = buildPythonPackage rec { - name = "ds4drv-${version}"; - version = "0.5.0"; - src = pkgs.fetchurl { - url = "mirror://pypi/d/ds4drv/${name}.tar.gz"; - sha256 = "0dq2z1z09zxa6rn3v94vwqaaz29jwiydkss8hbjglixf20krmw3b"; - }; - - propagatedBuildInputs = with self; [ evdev pyudev ]; - - buildInputs = [ pkgs.bluez ]; - - meta = { - description = "Userspace driver for the DualShock 4 controller"; - homepage = "https://github.com/chrippa/ds4drv"; - license = licenses.mit; - }; - + ds4drv = callPackage ../development/python-modules/ds4drv.nix { + inherit (pkgs) fetchFromGitHub bluez; }; dyn = buildPythonPackage rec {