2018-01-03 01:01:37 +01:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
|
2018-12-02 12:41:15 +01:00
|
|
|
, gtk3, gobject-introspection, libappindicator-gtk3, librsvg
|
2018-08-27 02:14:26 +02:00
|
|
|
, evdev, pygobject3, pylibacl, pytest, bluez
|
2018-01-03 01:01:37 +01:00
|
|
|
, linuxHeaders
|
2018-09-13 07:22:39 +02:00
|
|
|
, libX11, libXext, libXfixes, libusb1, udev
|
2018-01-03 01:01:37 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "sc-controller";
|
2019-01-02 05:43:27 +01:00
|
|
|
version = "0.4.6.1";
|
2018-01-03 01:01:37 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-03-01 00:28:46 +01:00
|
|
|
owner = "kozec";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2019-01-02 05:43:27 +01:00
|
|
|
sha256 = "1kcqsnrlwl4s94j6ahgkz3w4sy9hsr95y624zab6g10w0fl5sqrc";
|
2018-01-03 01:01:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook ];
|
|
|
|
|
2018-12-02 12:41:15 +01:00
|
|
|
buildInputs = [ gtk3 gobject-introspection libappindicator-gtk3 librsvg ];
|
2018-01-03 01:01:37 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ evdev pygobject3 pylibacl ];
|
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
|
|
|
|
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
|
2018-08-27 02:14:26 +02:00
|
|
|
substituteInPlace scc/device_monitor.py --replace "find_library('bluetooth')" "'libbluetooth.so.3'"
|
2018-01-03 01:01:37 +01:00
|
|
|
'';
|
|
|
|
|
2018-09-13 07:22:39 +02:00
|
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 udev bluez ];
|
2018-01-03 01:01:37 +01:00
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
|
|
|
|
# gdk-pixbuf setup hook can not choose between propagated librsvg
|
|
|
|
# and our librsvg with GObject introspection.
|
|
|
|
GDK_PIXBUF_MODULE_FILE=$(echo ${librsvg}/lib/gdk-pixbuf-2.0/*/loaders.cache)
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
PYTHONPATH=. py.test
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2018-03-01 00:28:46 +01:00
|
|
|
homepage = https://github.com/kozec/sc-controller;
|
2018-01-03 01:01:37 +01:00
|
|
|
# donations: https://www.patreon.com/kozec
|
|
|
|
description = "User-mode driver and GUI for Steam Controller and other controllers";
|
2018-03-01 00:28:46 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ orivej rnhmjoj ];
|
2018-01-03 01:01:37 +01:00
|
|
|
};
|
|
|
|
}
|