Skip to content

Instantly share code, notes, and snippets.

@AcouBass
Last active May 20, 2017 14:40
Show Gist options
  • Save AcouBass/5d97b62ece412f52050f0c10f8170a51 to your computer and use it in GitHub Desktop.
Save AcouBass/5d97b62ece412f52050f0c10f8170a51 to your computer and use it in GitHub Desktop.
attempt at packaging sc-controller
sc-controller = buildPythonPackage {
name = "sc-controller";
version = "0.3.10";
src = pkgs.fetchFromGitHub {
owner = "kozec";
repo = "sc-controller";
rev = "v0.3.10";
sha256 = "0i4qg4ljnd1l1vq3n2i0q141qbfh733k0iyqcnpagh4w1glhhaa6";
};
postPatch =
''
sed -i -e "s|/usr/include|${pkgs.linuxHeaders}/include|g" scc/uinput.py
sed -i -e "s|libusb_path = None|libusb_path = '${pkgs.libusb1.out}/lib/libusb-1.0.so'|" scc/lib/libusb1.py
'';
buildInputs = with self; [ pkgs.linuxHeaders pkgs.linux pkgs.libusb1 setuptools pkgs.xorg.libXfixes pkgs.xorg.libXext ];
propagatedBuildInputs = with self; [ pkgs.gtk3 pkgs.gobjectIntrospection pygobject3 pygtk pycairo pylibacl pyusb pkgs.libusb1 (pkgs.librsvg.override { withGTK = true; }) ];
preFixup = ''
wrapProgram "$out/bin/"* \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
--prefix LD_LIBRARY_PATH : '${pkgs.lib.makeLibraryPath [ pkgs.libusb1 pkgs.xorg.libXfixes pkgs.xorg.libXext ]}' \
--prefix SCC_SHARED : $out/share/scc/
'';
meta = with stdenv.lib; {
description = "User-mode driver and GTK3 based GUI for Steam Controller.";
homepage = https://github.com/kozec/sc-controller;
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ Edd Baxter ];
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment