Merge pull request #33201 from rnhmjoj/steamcontroller

Add Steam controller userspace driver
This commit is contained in:
Frederik Rietdijk 2017-12-30 11:55:47 +00:00 committed by GitHub
commit bb729316dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,26 @@
{ stdenv, lib, buildPythonPackage, fetchPypi, libusb1 }:
buildPythonPackage rec {
pname = "libusb1";
version = "1.6.4";
src = fetchPypi {
inherit pname version;
sha256 = "03b7xrz8vqg8w0za5r503jhcmbd1ls5610jcja1rqz833nf0v4wc";
};
postPatch = lib.optionalString stdenv.isLinux ''
substituteInPlace usb1/libusb1.py --replace \
"ctypes.util.find_library(base_name)" \
"'${libusb1}/lib/libusb${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
buildInputs = [ libusb1 ];
meta = with stdenv.lib; {
homepage = https://github.com/vpelletier/python-libusb1;
description = "Python ctype-based wrapper around libusb1";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ rnhmjoj ];
};
}

View File

@ -0,0 +1,35 @@
{ stdenv, lib, fetchFromGitHub, python3Packages, libusb1, linuxHeaders
, GyroplotSupport ? false
}:
with python3Packages;
buildPythonApplication rec {
name = "steamcontroller-${version}";
version = "2017-08-11";
src = fetchFromGitHub {
owner = "ynsta";
repo = "steamcontroller";
rev = "80928ce237925e0d0d7a65a45b481435ba6b931e";
sha256 = "0lv9j2zv8fmkmc0x9r7fa8zac2xrwfczms35qz1nfa1hr84wniid";
};
postPatch = ''
substituteInPlace src/uinput.py --replace \
"/usr/include" "${linuxHeaders}/include"
'';
buildInputs = [ libusb1 ];
propagatedBuildInputs =
[ psutil python3Packages.libusb1 ]
++ lib.optionals GyroplotSupport [ pyqtgraph pyside ];
meta = with stdenv.lib; {
description = "A standalone Steam controller driver";
homepage = https://github.com/ynsta/steamcontroller;
license = licenses.mit;
maintainers = with maintainers; [ rnhmjoj ];
platforms = platforms.linux;
};
}

View File

@ -19734,6 +19734,8 @@ with pkgs;
splix = callPackage ../misc/cups/drivers/splix { };
steamcontroller = callPackage ../misc/drivers/steamcontroller { };
streamripper = callPackage ../applications/audio/streamripper { };
sqsh = callPackage ../development/tools/sqsh { };

View File

@ -4016,6 +4016,8 @@ in {
libtmux = callPackage ../development/python-modules/libtmux { };
libusb1 = callPackage ../development/python-modules/libusb1 { inherit (pkgs) libusb1; };
linuxfd = callPackage ../development/python-modules/linuxfd { };
locket = buildPythonPackage rec {