From 4492a5f972ca5d5552caa7d99141290b3d889f07 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Mon, 29 May 2023 16:59:39 +0200 Subject: [PATCH] waybar: 0.9.17 -> 0.9.18 https://github.com/Alexays/Waybar/releases/tag/0.9.18 Add cava module, implemented as custom subproject like upstream: https://github.com/Alexays/Waybar/blob/master/subprojects/cava.wrap --- pkgs/applications/misc/waybar/default.nix | 34 +++++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/waybar/default.nix b/pkgs/applications/misc/waybar/default.nix index d22c9a908816..5ba7e6e013c1 100644 --- a/pkgs/applications/misc/waybar/default.nix +++ b/pkgs/applications/misc/waybar/default.nix @@ -16,6 +16,7 @@ , howard-hinnant-date , libinotify-kqueue , libxkbcommon +, cavaSupport ? true, alsa-lib, fftw, iniparser, ncurses, pipewire, portaudio, SDL2 , evdevSupport ? true, libevdev , inputSupport ? true, libinput , jackSupport ? true, libjack2 @@ -33,18 +34,37 @@ , wireplumberSupport ? true, wireplumber , withMediaPlayer ? mprisSupport && false, glib, gobject-introspection, python3 }: - +let + # Derived from subprojects/cava.wrap + libcava = rec { + version = "0.8.4"; + src = fetchFromGitHub { + owner = "LukashonakV"; + repo = "cava"; + rev = version; + hash = "sha256-66uc0CEriV9XOjSjFTt+bxghEXY1OGrpjd+7d6piJUI="; + }; + }; +in stdenv.mkDerivation rec { pname = "waybar"; - version = "0.9.17"; + version = "0.9.18"; src = fetchFromGitHub { owner = "Alexays"; repo = "Waybar"; rev = version; - hash = "sha256-sdNenmzI/yvN9w4Z83ojDJi+2QBx2hxhJQCFkc5kCZw="; + hash = "sha256-bnaYNa1jb7kZ1mtMzeOQqz4tmBG1w5YXlQWoop1Q0Yc="; }; + postUnpack = lib.optional cavaSupport '' + ( + cd "$sourceRoot" + cp -R --no-preserve=mode,ownership ${libcava.src} subprojects/cava-0.8.4 + patchShebangs . + ) + ''; + nativeBuildInputs = [ meson ninja pkg-config scdoc wrapGAppsHook ] ++ lib.optional withMediaPlayer gobject-introspection; @@ -60,6 +80,13 @@ stdenv.mkDerivation rec { buildInputs = with lib; [ wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ] ++ optional (!stdenv.isLinux) libinotify-kqueue + ++ optional cavaSupport alsa-lib + ++ optional cavaSupport iniparser + ++ optional cavaSupport fftw + ++ optional cavaSupport ncurses + ++ optional cavaSupport pipewire + ++ optional cavaSupport portaudio + ++ optional cavaSupport SDL2 ++ optional evdevSupport libevdev ++ optional inputSupport libinput ++ optional jackSupport libjack2 @@ -80,6 +107,7 @@ stdenv.mkDerivation rec { mesonFlags = (lib.mapAttrsToList (option: enable: "-D${option}=${if enable then "enabled" else "disabled"}") { + cava = cavaSupport; dbusmenu-gtk = traySupport; jack = jackSupport; libinput = inputSupport;