Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / misc / rivalcfg / default.nix
blob737a3839d7a020b23f0be4962d4264b284955ee6
1 { lib, fetchFromGitHub, python3Packages }:
3 python3Packages.buildPythonPackage rec {
4   pname = "rivalcfg";
5   version = "4.8.0";
7   src = fetchFromGitHub {
8     owner = "flozz";
9     repo = "rivalcfg";
10     rev = "v${version}";
11     sha256 = "sha256-fCl+XY+R+QF7jWLkqii4v0sbXr7xoX3A3upm+XoBAms=";
12   };
14   propagatedBuildInputs = with python3Packages; [ hidapi setuptools ];
16   checkInputs = [ python3Packages.pytest ];
17   checkPhase = "pytest";
19   # tests are broken
20   doCheck = false;
22   postInstall = ''
23     set -x
24     mkdir -p $out/lib/udev/rules.d
25     tmpl_udev="$out/lib/udev/rules.d/99-rivalcfg.rules"
26     tmpudev="''${tmpl_udev}.in"
27     finaludev="$tmpl_udev"
28     "$out/bin/rivalcfg" --print-udev > "$tmpudev"
29     substitute "$tmpudev" "$out/lib/udev/rules.d/99-rivalcfg.rules" \
30       --replace MODE=\"0666\" "MODE=\"0664\", GROUP=\"input\""
31     rm "$tmpudev"
32   '';
34   meta = with lib; {
35     description = "Utility program that allows you to configure SteelSeries Rival gaming mice";
36     homepage = "https://github.com/flozz/rivalcfg";
37     license = licenses.wtfpl;
38     maintainers = with maintainers; [ ornxka ];
39   };