1{
2 lib,
3 fetchFromGitHub,
4 gettext,
5 ninja,
6 meson,
7 sassc,
8 python3Packages,
9 gobject-introspection,
10 wrapGAppsHook3,
11 libayatana-appindicator,
12 libxcb,
13 qt6,
14 ibus,
15 usbutils,
16 psmisc,
17}:
18
19python3Packages.buildPythonApplication rec {
20 pname = "polychromatic";
21 version = "0.9.3";
22 format = "other";
23
24 src = fetchFromGitHub {
25 owner = "polychromatic";
26 repo = "polychromatic";
27 tag = "v${version}";
28 hash = "sha256-fw4XLaivf8kRkNaemHvd9zcVKn87ZZhP+ZDJsCJHv/4=";
29 };
30
31 postPatch = ''
32 patchShebangs scripts
33 substituteInPlace scripts/build-styles.sh \
34 --replace-fail '$(which sassc 2>/dev/null)' '${sassc}/bin/sassc' \
35 --replace-fail '$(which sass 2>/dev/null)' '${sassc}/bin/sass'
36 substituteInPlace polychromatic/paths.py \
37 --replace-fail "/usr/share/polychromatic" "$out/share/polychromatic"
38 '';
39
40 preConfigure = ''
41 scripts/build-styles.sh
42 '';
43
44 nativeBuildInputs = [
45 gettext
46 gobject-introspection
47 meson
48 ninja
49 sassc
50 wrapGAppsHook3
51 qt6.wrapQtAppsHook
52 qt6.qtbase
53 ];
54
55 buildInputs = [ qt6.qtwayland ];
56
57 propagatedBuildInputs =
58 with python3Packages;
59 [
60 colorama
61 colour
62 openrazer
63 pyqt6
64 pyqt6-webengine
65 requests
66 setproctitle
67 libxcb
68 openrazer-daemon
69 ibus
70 usbutils
71 ]
72 ++ [
73 libayatana-appindicator
74 psmisc
75 ];
76
77 dontWrapGApps = true;
78 dontWrapQtApps = true;
79
80 makeWrapperArgs = [
81 "\${gappsWrapperArgs[@]}"
82 "\${qtWrapperArgs[@]}"
83 ];
84
85 meta = with lib; {
86 homepage = "https://polychromatic.app/";
87 description = "Graphical front-end and tray applet for configuring Razer peripherals on GNU/Linux";
88 longDescription = ''
89 Polychromatic is a frontend for OpenRazer that enables Razer devices
90 to control lighting effects and more on GNU/Linux.
91 '';
92 license = licenses.gpl3;
93 platforms = platforms.linux;
94 maintainers = with maintainers; [ evanjs ];
95 mainProgram = "polychromatic-controller";
96 };
97}