2024-04-26 20:24:03 +00:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook3
|
2021-08-13 14:11:37 +00:00
|
|
|
, pytestCheckHook
|
2018-12-02 11:41:15 +00:00
|
|
|
, gtk3, gobject-introspection, libappindicator-gtk3, librsvg
|
2021-08-13 14:11:37 +00:00
|
|
|
, evdev, pygobject3, pylibacl, bluez, vdf
|
2018-01-03 00:01:37 +00:00
|
|
|
, linuxHeaders
|
2018-09-13 05:22:39 +00:00
|
|
|
, libX11, libXext, libXfixes, libusb1, udev
|
2018-01-03 00:01:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "sc-controller";
|
2024-01-23 22:08:15 +00:00
|
|
|
version = "0.4.8.13";
|
2018-01-03 00:01:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-13 14:11:37 +00:00
|
|
|
owner = "Ryochan7";
|
2018-02-28 23:28:46 +00:00
|
|
|
repo = pname;
|
2024-01-23 22:08:15 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-vK/5S+GyqVfKTqn5PaPmOV/tXE9PIW57gqYxvhGaJSg=";
|
2018-01-03 00:01:37 +00:00
|
|
|
};
|
|
|
|
|
2024-04-26 20:24:03 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 gobject-introspection ];
|
2020-10-10 21:58:36 +00:00
|
|
|
|
2022-12-29 16:40:14 +00:00
|
|
|
buildInputs = [ gtk3 libappindicator-gtk3 librsvg ];
|
2018-01-03 00:01:37 +00:00
|
|
|
|
2021-08-13 14:11:37 +00:00
|
|
|
propagatedBuildInputs = [ evdev pygobject3 pylibacl vdf ];
|
2018-01-03 00:01:37 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2018-01-03 00:01:37 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
|
|
|
|
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
|
2018-08-27 00:14:26 +00:00
|
|
|
substituteInPlace scc/device_monitor.py --replace "find_library('bluetooth')" "'libbluetooth.so.3'"
|
2018-01-03 00:01:37 +00:00
|
|
|
'';
|
|
|
|
|
2018-09-13 05:22:39 +00:00
|
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 udev bluez ];
|
2018-01-03 00:01:37 +00:00
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
(
|
|
|
|
# scc runs these scripts as programs. (See find_binary() in scc/tools.py.)
|
|
|
|
cd $out/lib/python*/site-packages/scc/x11
|
|
|
|
patchPythonScript scc-autoswitch-daemon.py
|
|
|
|
patchPythonScript scc-osd-daemon.py
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-08-13 14:11:37 +00:00
|
|
|
homepage = "https://github.com/Ryochan7/sc-controller";
|
2018-01-03 00:01:37 +00:00
|
|
|
# donations: https://www.patreon.com/kozec
|
|
|
|
description = "User-mode driver and GUI for Steam Controller and other controllers";
|
2018-02-28 23:28:46 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ orivej rnhmjoj ];
|
2018-01-03 00:01:37 +00:00
|
|
|
};
|
|
|
|
}
|