Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / mo / mouse_m908 / package.nix
blob905b8fb1ef1e7171e13bb45462650b3386a439b8
1 { stdenv
2 , lib
3 , libusb1
4 , installShellFiles
5 , fetchFromGitHub
6 , pkg-config
7 }:
9 stdenv.mkDerivation (finalAttrs: {
10   pname = "mouse_m908";
11   version = "3.4";
13   src = fetchFromGitHub {
14     owner = "dokutan";
15     repo = "mouse_m908";
16     rev = "v${finalAttrs.version}";
17     sha256 = "sha256-sCAvjNpJYkp4G0KkDJtHOBR1vc80DZJtWR2W9gakkzQ=";
18   };
20   nativeBuildInputs = [ pkg-config installShellFiles ];
22   buildInputs = [ libusb1 ];
24   # Uses proper nix directories rather than the ones specified in the makefile
25   installPhase = ''
26     runHook preInstall
28     mkdir -p $out/bin \
29       $out/share/doc \
30       $out/share/doc/mouse_m908 \
31       $out/lib/udev/rules.d
33     cp mouse_m908 $out/bin/mouse_m908
34     cp mouse_m908.rules $out/lib/udev/rules.d
35     cp examples/* $out/share/doc/mouse_m908
36     cp README.md $out/share/doc/mouse_m908
37     cp keymap.md $out/share/doc/mouse_m908
38     installManPage mouse_m908.1
40     runHook postInstall
41   '';
43   meta = {
44     homepage = "https://github.com/dokutan/mouse_m908";
45     description = "Control various Redragon gaming mice from Linux, BSD and Haiku";
46     mainProgram = "mouse_m908";
47     license = lib.licenses.gpl3Plus;
48     platforms = [ "x86_64-linux" ];
49     maintainers = with lib.maintainers; [ kylelovestoad ];
50   };