From 879407cf60dc01b00ed80146dfdf825610e591a7 Mon Sep 17 00:00:00 2001 From: Majiir Paktu Date: Tue, 7 Jun 2022 23:45:44 -0400 Subject: pythonPackages.streamdeck: init at 0.9.1 --- .../python-modules/streamdeck/default.nix | 36 ++++++++++++++++++++++ .../streamdeck/hardcode-libusb.patch | 13 ++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/streamdeck/default.nix create mode 100644 pkgs/development/python-modules/streamdeck/hardcode-libusb.patch (limited to 'pkgs/development/python-modules/streamdeck') diff --git a/pkgs/development/python-modules/streamdeck/default.nix b/pkgs/development/python-modules/streamdeck/default.nix new file mode 100644 index 00000000000..7d7f0071037 --- /dev/null +++ b/pkgs/development/python-modules/streamdeck/default.nix @@ -0,0 +1,36 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchPypi +, substituteAll +, pkgs +}: + +buildPythonPackage rec { + pname = "streamdeck"; + version = "0.9.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0116a376afc18f3abbf79cc1a4409f81472e19197d5641b9e97e697d105cbdc0"; + }; + + patches = [ + # substitute libusb path + (substituteAll { + src = ./hardcode-libusb.patch; + libusb = "${pkgs.hidapi}/lib/libhidapi-libusb${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) + ]; + + pythonImportsCheck = [ "StreamDeck" ]; + doCheck = false; + + meta = with lib; { + description = "Python library to control the Elgato Stream Deck"; + homepage = "https://github.com/abcminiuser/python-elgato-streamdeck"; + license = licenses.mit; + maintainers = with maintainers; [ majiir ]; + broken = stdenv.isDarwin; + }; +} diff --git a/pkgs/development/python-modules/streamdeck/hardcode-libusb.patch b/pkgs/development/python-modules/streamdeck/hardcode-libusb.patch new file mode 100644 index 00000000000..acef15b5405 --- /dev/null +++ b/pkgs/development/python-modules/streamdeck/hardcode-libusb.patch @@ -0,0 +1,13 @@ +diff --git a/src/StreamDeck/Transport/LibUSBHIDAPI.py b/src/StreamDeck/Transport/LibUSBHIDAPI.py +index 824c59c..f13754e 100644 +--- a/src/StreamDeck/Transport/LibUSBHIDAPI.py ++++ b/src/StreamDeck/Transport/LibUSBHIDAPI.py +@@ -110,7 +110,7 @@ class LibUSBHIDAPI(Transport): + + search_library_names = { + "Windows": ["hidapi.dll", "libhidapi-0.dll"], +- "Linux": ["libhidapi-libusb.so", "libhidapi-libusb.so.0"], ++ "Linux": ["@libusb@"], + "Darwin": ["libhidapi.dylib"], + } + -- cgit 1.4.1