Merge pull request #45939 from rnhmjoj/scc
sc-controller: 0.4.3 -> 0.4.4
This commit is contained in:
commit
87ba30b5c7
2 changed files with 32 additions and 5 deletions
|
@ -1,19 +1,19 @@
|
|||
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
|
||||
, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
|
||||
, evdev, pygobject3, pylibacl, pytest
|
||||
, evdev, pygobject3, pylibacl, pytest, bluez
|
||||
, linuxHeaders
|
||||
, libX11, libXext, libXfixes, libusb1
|
||||
, libX11, libXext, libXfixes, libusb1, libudev
|
||||
}:
|
||||
|
||||
buildPythonApplication rec {
|
||||
pname = "sc-controller";
|
||||
version = "0.4.3";
|
||||
version = "0.4.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kozec";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0w4ykl78vdppqr3d4d0h1f31wly6kis57a1gxhnrbpfrgpj0qhvj";
|
||||
sha256 = "0ki9x28i5slpnygkpdglcvj8cssvvjyz732y1cnpzw1f0sj0kris";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ wrapGAppsHook ];
|
||||
|
@ -24,12 +24,17 @@ buildPythonApplication rec {
|
|||
|
||||
checkInputs = [ pytest ];
|
||||
|
||||
patches = [
|
||||
./fix-udev.patch # fix upstream issue #401, remove with the next update
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
|
||||
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
|
||||
substituteInPlace scc/device_monitor.py --replace "find_library('bluetooth')" "'libbluetooth.so.3'"
|
||||
'';
|
||||
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 ];
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 libudev bluez ];
|
||||
|
||||
preFixup = ''
|
||||
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
|
||||
|
|
22
pkgs/misc/drivers/sc-controller/fix-udev.patch
Normal file
22
pkgs/misc/drivers/sc-controller/fix-udev.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff --git a/scc/lib/eudevmonitor.py b/scc/lib/eudevmonitor.py
|
||||
index 6c1bd18..182eff2 100644
|
||||
--- a/scc/lib/eudevmonitor.py
|
||||
+++ b/scc/lib/eudevmonitor.py
|
||||
@@ -28,12 +28,11 @@ class Eudev:
|
||||
|
||||
def __init__(self):
|
||||
self._ctx = None
|
||||
- self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
|
||||
- if self._lib is None:
|
||||
- # Alternative approach for NixOS
|
||||
- try:
|
||||
- self._lib = ctypes.cdll.LoadLibrary("libudev.so")
|
||||
- except OSError:
|
||||
+ try:
|
||||
+ self._lib = ctypes.cdll.LoadLibrary("libudev.so")
|
||||
+ except OSError:
|
||||
+ self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
|
||||
+ if self._lib is None:
|
||||
raise ImportError("No library named udev")
|
||||
Eudev._setup_lib(self._lib)
|
||||
self._ctx = self._lib.udev_new()
|
Loading…
Reference in a new issue