nixpkgs/pkgs/misc/drivers/sc-controller/fix-udev.patch

23 lines
712 B
Diff
Raw Normal View History

2018-08-21 08:56:52 +00:00
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()