Merge pull request #45939 from rnhmjoj/scc
sc-controller: 0.4.3 -> 0.4.4
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
|
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
|
||||||
, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
|
, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
|
||||||
, evdev, pygobject3, pylibacl, pytest
|
, evdev, pygobject3, pylibacl, pytest, bluez
|
||||||
, linuxHeaders
|
, linuxHeaders
|
||||||
, libX11, libXext, libXfixes, libusb1
|
, libX11, libXext, libXfixes, libusb1, libudev
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonApplication rec {
|
buildPythonApplication rec {
|
||||||
pname = "sc-controller";
|
pname = "sc-controller";
|
||||||
version = "0.4.3";
|
version = "0.4.4";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "kozec";
|
owner = "kozec";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0w4ykl78vdppqr3d4d0h1f31wly6kis57a1gxhnrbpfrgpj0qhvj";
|
sha256 = "0ki9x28i5slpnygkpdglcvj8cssvvjyz732y1cnpzw1f0sj0kris";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ wrapGAppsHook ];
|
nativeBuildInputs = [ wrapGAppsHook ];
|
||||||
@@ -24,12 +24,17 @@ buildPythonApplication rec {
|
|||||||
|
|
||||||
checkInputs = [ pytest ];
|
checkInputs = [ pytest ];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./fix-udev.patch # fix upstream issue #401, remove with the next update
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
|
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
|
||||||
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
|
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 = ''
|
preFixup = ''
|
||||||
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
|
||||||
|
|||||||
@@ -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()
|
||||||
Reference in New Issue
Block a user