chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / wa / waybar / package.nix
blob7f5c9ad4432b0ff22f732d6d2ee3faaf6dd8af3a
2   lib,
3   stdenv,
4   bash,
5   fetchFromGitHub,
6   SDL2,
7   alsa-lib,
8   catch2_3,
9   fetchpatch,
10   fftw,
11   glib,
12   gobject-introspection,
13   gtk-layer-shell,
14   gtkmm3,
15   howard-hinnant-date,
16   hyprland,
17   iniparser,
18   jsoncpp,
19   libdbusmenu-gtk3,
20   libevdev,
21   libinotify-kqueue,
22   libinput,
23   libjack2,
24   libmpdclient,
25   libnl,
26   libpulseaudio,
27   libsigcxx,
28   libxkbcommon,
29   meson,
30   ncurses,
31   ninja,
32   pipewire,
33   pkg-config,
34   playerctl,
35   portaudio,
36   python3,
37   scdoc,
38   sndio,
39   spdlog,
40   systemdMinimal,
41   sway,
42   udev,
43   upower,
44   wayland,
45   wayland-scanner,
46   wireplumber,
47   wrapGAppsHook3,
49   cavaSupport ? true,
50   enableManpages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
51   evdevSupport ? true,
52   experimentalPatches ? true,
53   hyprlandSupport ? true,
54   inputSupport ? true,
55   jackSupport ? true,
56   mpdSupport ? true,
57   mprisSupport ? stdenv.hostPlatform.isLinux,
58   nlSupport ? true,
59   pipewireSupport ? true,
60   pulseSupport ? true,
61   rfkillSupport ? true,
62   runTests ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
63   sndioSupport ? true,
64   systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
65   swaySupport ? true,
66   traySupport ? true,
67   udevSupport ? true,
68   upowerSupport ? true,
69   wireplumberSupport ? true,
70   withMediaPlayer ? mprisSupport && false,
71   nix-update-script,
72   testers,
73   waybar,
76 let
77   # Derived from subprojects/cava.wrap
78   libcava.src = fetchFromGitHub {
79     owner = "LukashonakV";
80     repo = "cava";
81     rev = "0.10.3";
82     hash = "sha256-ZDFbI69ECsUTjbhlw2kHRufZbQMu+FQSMmncCJ5pagg=";
83   };
85 stdenv.mkDerivation (finalAttrs: {
86   pname = "waybar";
87   version = "0.11.0";
89   src = fetchFromGitHub {
90     owner = "Alexays";
91     repo = "Waybar";
92     rev = "refs/tags/${finalAttrs.version}";
93     hash = "sha256-3lc0voMU5RS+mEtxKuRayq/uJO09X7byq6Rm5NZohq8=";
94   };
96   patches = [
97     # Fix a regression introduced in release 0.11.0
98     # TODO: remove this patch when updating to the next release
99     # Issue: https://github.com/Alexays/Waybar/issues/3597
100     # PR: https://github.com/Alexays/Waybar/pull/3604
101     (fetchpatch {
102       name = "fix-tray";
103       url = "https://github.com/Alexays/Waybar/commit/0d02f6877d88551ea2be0cd151c1e6354e208b1c.patch";
104       hash = "sha256-wpdK6AY+14jt85dOQy6xkh8tNGDN2F9GA9zOfAuOaIc=";
105     })
106   ];
108   postUnpack = lib.optional cavaSupport ''
109     pushd "$sourceRoot"
110     cp -R --no-preserve=mode,ownership ${libcava.src} subprojects/cava-0.10.2
111     patchShebangs .
112     popd
113   '';
115   nativeBuildInputs = [
116     meson
117     ninja
118     pkg-config
119     wayland-scanner
120     wrapGAppsHook3
121   ] ++ lib.optional withMediaPlayer gobject-introspection ++ lib.optional enableManpages scdoc;
123   propagatedBuildInputs = lib.optionals withMediaPlayer [
124     glib
125     playerctl
126     python3.pkgs.pygobject3
127   ];
129   buildInputs =
130     [
131       gtk-layer-shell
132       gtkmm3
133       howard-hinnant-date
134       jsoncpp
135       libsigcxx
136       libxkbcommon
137       spdlog
138       wayland
139     ]
140     ++ lib.optionals cavaSupport [
141       SDL2
142       alsa-lib
143       fftw
144       iniparser
145       ncurses
146       portaudio
147     ]
148     ++ lib.optional evdevSupport libevdev
149     ++ lib.optional hyprlandSupport hyprland
150     ++ lib.optional inputSupport libinput
151     ++ lib.optional jackSupport libjack2
152     ++ lib.optional mpdSupport libmpdclient
153     ++ lib.optional mprisSupport playerctl
154     ++ lib.optional nlSupport libnl
155     ++ lib.optional pulseSupport libpulseaudio
156     ++ lib.optional sndioSupport sndio
157     ++ lib.optional swaySupport sway
158     ++ lib.optional systemdSupport systemdMinimal
159     ++ lib.optional traySupport libdbusmenu-gtk3
160     ++ lib.optional udevSupport udev
161     ++ lib.optional upowerSupport upower
162     ++ lib.optional wireplumberSupport wireplumber
163     ++ lib.optional (cavaSupport || pipewireSupport) pipewire
164     ++ lib.optional (!stdenv.hostPlatform.isLinux) libinotify-kqueue;
166   nativeCheckInputs = [ catch2_3 ];
167   doCheck = runTests;
169   mesonFlags =
170     (lib.mapAttrsToList lib.mesonEnable {
171       "cava" = cavaSupport && lib.asserts.assertMsg sndioSupport "Sndio support is required for Cava";
172       "dbusmenu-gtk" = traySupport;
173       "jack" = jackSupport;
174       "libevdev" = evdevSupport;
175       "libinput" = inputSupport;
176       "libnl" = nlSupport;
177       "libudev" = udevSupport;
178       "man-pages" = enableManpages;
179       "mpd" = mpdSupport;
180       "mpris" = mprisSupport;
181       "pipewire" = pipewireSupport;
182       "pulseaudio" = pulseSupport;
183       "rfkill" = rfkillSupport;
184       "sndio" = sndioSupport;
185       "systemd" = systemdSupport;
186       "tests" = runTests;
187       "upower_glib" = upowerSupport;
188       "wireplumber" = wireplumberSupport;
189     })
190     ++ lib.optional experimentalPatches (lib.mesonBool "experimental" true);
192   env = lib.optionalAttrs systemdSupport {
193     PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
194   };
196   postPatch = ''
197     substituteInPlace include/util/command.hpp \
198       --replace-fail /bin/sh ${lib.getExe' bash "sh"}
199   '';
201   preFixup = lib.optionalString withMediaPlayer ''
202     cp $src/resources/custom_modules/mediaplayer.py $out/bin/waybar-mediaplayer.py
204     wrapProgram $out/bin/waybar-mediaplayer.py \
205       --prefix PYTHONPATH : "$PYTHONPATH:$out/${python3.sitePackages}"
206   '';
208   passthru = {
209     updateScript = nix-update-script { };
210     tests.version = testers.testVersion {
211       package = waybar;
212       version = "v${finalAttrs.version}";
213     };
214   };
216   meta = {
217     homepage = "https://github.com/alexays/waybar";
218     description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
219     changelog = "https://github.com/alexays/waybar/releases/tag/${finalAttrs.version}";
220     license = lib.licenses.mit;
221     mainProgram = "waybar";
222     maintainers = with lib.maintainers; [
223       FlorianFranzen
224       lovesegfault
225       minijackson
226       rodrgz
227       synthetica
228       khaneliman
229     ];
230     platforms = lib.platforms.linux;
231   };