nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchFromGitHub
3, bash
4, glib
5, gdk-pixbuf
6, gettext
7, imagemagick
8, ninja
9, meson
10, sassc
11, python3Packages
12, gobject-introspection
13, wrapGAppsHook
14, libappindicator-gtk3
15, libxcb
16, qt5
17, ibus
18, usbutils
19}:
20
21python3Packages.buildPythonApplication rec {
22 name = "polychromatic";
23 version = "0.8.0";
24 format = "other";
25
26 src = fetchFromGitHub {
27 owner = "polychromatic";
28 repo = "polychromatic";
29 rev = "v${version}";
30 sha256 = "sha256-ym2pcGUWM5zCUx/lYs+WECj+wbyBtWnx04W/NRXNKlw=";
31 };
32
33 postPatch = ''
34 patchShebangs scripts
35 substituteInPlace scripts/build-styles.sh \
36 --replace '$(which sassc 2>/dev/null)' '${sassc}/bin/sassc' \
37 --replace '$(which sass 2>/dev/null)' '${sassc}/bin/sass'
38 substituteInPlace polychromatic/paths.py \
39 --replace "/usr/share/polychromatic" "$out/share/polychromatic"
40 '';
41
42 preConfigure = ''
43 scripts/build-styles.sh
44 '';
45 nativeBuildInputs = with python3Packages; [
46 gettext
47 gobject-introspection
48 meson
49 ninja
50 sassc
51 wrapGAppsHook
52 qt5.wrapQtAppsHook
53 ];
54
55 propagatedBuildInputs = with python3Packages; [
56 colorama
57 colour
58 openrazer
59 pyqt5
60 pyqtwebengine
61 requests
62 setproctitle
63 libxcb
64 openrazer-daemon
65 libappindicator-gtk3
66 ibus
67 usbutils
68 ];
69
70 dontWrapGapps = true;
71 dontWrapQtApps = true;
72
73 makeWrapperArgs = [
74 "\${gappsWrapperArgs[@]}"
75 "\${qtWrapperArgs[@]}"
76 ];
77
78 meta = with lib; {
79 homepage = "https://polychromatic.app/";
80 description = "Graphical front-end and tray applet for configuring Razer peripherals on GNU/Linux.";
81 longDescription = ''
82 Polychromatic is a frontend for OpenRazer that enables Razer devices
83 to control lighting effects and more on GNU/Linux.
84 '';
85 license = licenses.gpl3;
86 platforms = platforms.linux;
87 maintainers = with maintainers; [ evanjs ];
88 };
89}