git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #45939 from rnhmjoj/scc

sc-controller: 0.4.3 -> 0.4.4

commit87ba30b5c746652b4cf08f8aef39e713199b8821 authorxeji <36407913+xeji@users.noreply.github.com> dateSun 2 Sep 2018, 20:58 (8 years ago) parent146f8ba8670ee4
2 files changed+32−5
pkgs/misc/drivers/sc-controller/default.nix+10−5 pkgs/misc/drivers/sc-controller/fix-udev.patch+22
pkgs/misc/drivers/sc-controller/default.nix+10−5
@@ -1,19 +1,19 @@
11{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
22, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
3−, evdev, pygobject3, pylibacl, pytest
3+, evdev, pygobject3, pylibacl, pytest, bluez
44, linuxHeaders
5−, libX11, libXext, libXfixes, libusb1
5+, libX11, libXext, libXfixes, libusb1, libudev
66}:
77
88buildPythonApplication rec {
99 pname = "sc-controller";
10− version = "0.4.3";
10+ version = "0.4.4";
1111
1212 src = fetchFromGitHub {
1313 owner = "kozec";
1414 repo = pname;
1515 rev = "v${version}";
16− sha256 = "0w4ykl78vdppqr3d4d0h1f31wly6kis57a1gxhnrbpfrgpj0qhvj";
16+ sha256 = "0ki9x28i5slpnygkpdglcvj8cssvvjyz732y1cnpzw1f0sj0kris";
1717 };
1818
1919 nativeBuildInputs = [ wrapGAppsHook ];
@@ -24,12 +24,17 @@ buildPythonApplication rec {
2424
2525 checkInputs = [ pytest ];
2626
27+ patches = [
28+ ./fix-udev.patch # fix upstream issue #401, remove with the next update
29+ ];
30+
2731 postPatch = ''
2832 substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
2933 substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
34+ substituteInPlace scc/device_monitor.py --replace "find_library('bluetooth')" "'libbluetooth.so.3'"
3035 '';
3136
32− LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 ];
37+ LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 libudev bluez ];
3338
3439 preFixup = ''
3540 gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
pkgs/misc/drivers/sc-controller/fix-udev.patchnew file+22
@@ -0,0 +1,22 @@
1+diff --git a/scc/lib/eudevmonitor.py b/scc/lib/eudevmonitor.py
2+index 6c1bd18..182eff2 100644
3+--- a/scc/lib/eudevmonitor.py
4++++ b/scc/lib/eudevmonitor.py
5+@@ -28,12 +28,11 @@ class Eudev:
6+
7+ def __init__(self):
8+ self._ctx = None
9+- self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
10+- if self._lib is None:
11+- # Alternative approach for NixOS
12+- try:
13+- self._lib = ctypes.cdll.LoadLibrary("libudev.so")
14+- except OSError:
15++ try:
16++ self._lib = ctypes.cdll.LoadLibrary("libudev.so")
17++ except OSError:
18++ self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
19++ if self._lib is None:
20+ raise ImportError("No library named udev")
21+ Eudev._setup_lib(self._lib)
22+ self._ctx = self._lib.udev_new()