nixpkgs/pkgs/misc/drivers/sc-controller/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook3
, pytestCheckHook
, gtk3, gobject-introspection, libappindicator-gtk3, librsvg
, evdev, pygobject3, pylibacl, bluez, vdf
2018-01-03 03:01:37 +03:00
, linuxHeaders
, libX11, libXext, libXfixes, libusb1, udev
2018-01-03 03:01:37 +03:00
}:
buildPythonApplication rec {
pname = "sc-controller";
version = "0.4.8.17";
2018-01-03 03:01:37 +03:00
src = fetchFromGitHub {
owner = "C0rn3j";
2018-03-01 02:28:46 +03:00
repo = pname;
rev = "v${version}";
sha256 = "sha256-arBdPrFtdllWMn1KuZ+PlENiJ0oRPVbgVjbef+pv+IE=";
2018-01-03 03:01:37 +03:00
};
nativeBuildInputs = [ wrapGAppsHook3 gobject-introspection ];
buildInputs = [ gtk3 libappindicator-gtk3 librsvg ];
2018-01-03 03:01:37 +03:00
propagatedBuildInputs = [ evdev pygobject3 pylibacl vdf ];
2018-01-03 03:01:37 +03:00
nativeCheckInputs = [ pytestCheckHook ];
2018-01-03 03:01:37 +03:00
postPatch = ''
substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
substituteInPlace scc/device_monitor.py --replace "find_library('bluetooth')" "'libbluetooth.so.3'"
2018-01-03 03:01:37 +03:00
'';
LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 udev bluez ];
2018-01-03 03:01:37 +03: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; {
homepage = "https://github.com/Ryochan7/sc-controller";
2018-01-03 03:01:37 +03:00
# donations: https://www.patreon.com/kozec
description = "User-mode driver and GUI for Steam Controller and other controllers";
2018-03-01 02:28:46 +03:00
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ orivej rnhmjoj ];
2018-01-03 03:01:37 +03:00
};
}