···
1
+
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
2
+
, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
3
+
, evdev, pygobject3, pylibacl, pytest
5
+
, libX11, libXext, libXfixes, libusb1
8
+
buildPythonApplication rec {
9
+
pname = "sc-controller";
10
+
version = "0.4.0.1";
12
+
src = fetchFromGitHub {
14
+
repo = "sc-controller";
15
+
rev = "v${version}";
16
+
sha256 = "0vhgiqg4r4bnn004ql80rvi23y05wlax80sj8qsr91pvqsxwv3yl";
19
+
nativeBuildInputs = [ wrapGAppsHook ];
21
+
buildInputs = [ gtk3 gobjectIntrospection libappindicator-gtk3 librsvg ];
23
+
propagatedBuildInputs = [ evdev pygobject3 pylibacl ];
25
+
checkInputs = [ pytest ];
28
+
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
29
+
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
32
+
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 ];
35
+
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
36
+
# gdk-pixbuf setup hook can not choose between propagated librsvg
37
+
# and our librsvg with GObject introspection.
38
+
GDK_PIXBUF_MODULE_FILE=$(echo ${librsvg}/lib/gdk-pixbuf-2.0/*/loaders.cache)
43
+
# scc runs these scripts as programs. (See find_binary() in scc/tools.py.)
44
+
cd $out/lib/python*/site-packages/scc/x11
45
+
patchPythonScript scc-autoswitch-daemon.py
46
+
patchPythonScript scc-osd-daemon.py
51
+
PYTHONPATH=. py.test
55
+
homepage = https://github.com/kozec/sc-controller;
56
+
# donations: https://www.patreon.com/kozec
57
+
description = "User-mode driver and GUI for Steam Controller and other controllers";
58
+
license = licenses.gpl2;
59
+
platforms = platforms.linux;
60
+
maintainers = [ maintainers.orivej ];