yambar: refactor derivation and split backends as separate packages

* Use fetchFromGitea instead of fetchgit, submodules are unnecessary
  as we wlr-protocols are vendored.
* Split into xorg and wayland backends based on an option flag, (By
  default, the xorg backend is used, this might be a breaking change)
* Adhere to syntax style guide for long lists.
This commit is contained in:
polykernel 2021-08-07 23:46:29 -04:00
parent 68c0c7f623
commit 82076fcde4
2 changed files with 34 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{ stdenv { stdenv
, lib , lib
, fetchgit , fetchFromGitea
, pkg-config , pkg-config
, meson , meson
, ninja , ninja
@ -9,50 +9,75 @@
, fcft , fcft
, json_c , json_c
, libmpdclient , libmpdclient
, libxcb
, libyaml , libyaml
, pixman , pixman
, tllist , tllist
, udev , udev
, wayland , wayland
, wayland-scanner
, wayland-protocols , wayland-protocols
, waylandSupport ? false
# Xorg backend
, libxcb
, xcbutil , xcbutil
, xcbutilcursor , xcbutilcursor
, xcbutilerrors , xcbutilerrors
, xcbutilwm , xcbutilwm
}: }:
let
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "yambar"; pname = "yambar";
version = "1.6.2"; version = "1.6.2";
src = fetchgit { src = fetchFromGitea {
url = "https://codeberg.org/dnkl/yambar.git"; domain = "codeberg.org";
owner = "dnkl";
repo = "yambar";
rev = version; rev = version;
sha256 = "sha256-oUNkaWrYIcsK2u+aeRg6DHmH4M1VZ0leNSM0lV9Yy1Y="; sha256 = "sha256-GPKR2BYl3ebxxXbVfH/oZLs7639EYwWU4ZsilJn0Ss8=";
}; };
nativeBuildInputs = [ pkg-config meson ninja scdoc ]; nativeBuildInputs = [
pkg-config
meson
ninja
scdoc
wayland-scanner
];
buildInputs = [ buildInputs = [
alsa-lib alsa-lib
fcft fcft
json_c json_c
libmpdclient libmpdclient
libxcb
libyaml libyaml
pixman pixman
tllist tllist
udev udev
wayland wayland
wayland-protocols wayland-protocols
] ++ lib.optionals (!waylandSupport) [
xcbutil xcbutil
xcbutilcursor xcbutilcursor
xcbutilerrors xcbutilerrors
xcbutilwm xcbutilwm
]; ];
mesonBuildType = "release";
mesonFlags = [
(mesonFeatureFlag "backend-x11" (!waylandSupport))
(mesonFeatureFlag "backend-wayland" waylandSupport)
];
meta = with lib; { meta = with lib; {
homepage = "https://codeberg.org/dnkl/yambar"; homepage = "https://codeberg.org/dnkl/yambar";
changelog = "https://codeberg.org/dnkl/yambar/releases/tag/${version}";
description = "Modular status panel for X11 and Wayland"; description = "Modular status panel for X11 and Wayland";
longDescription = '' longDescription = ''
yambar is a lightweight and configurable status panel (bar, for short) for yambar is a lightweight and configurable status panel (bar, for short) for

View file

@ -26246,6 +26246,8 @@ in
yambar = callPackage ../applications/misc/yambar { }; yambar = callPackage ../applications/misc/yambar { };
yambar-wayland = callPackage ../applications/misc/yambar { waylandSupport = true; };
polyphone = libsForQt514.callPackage ../applications/audio/polyphone { }; polyphone = libsForQt514.callPackage ../applications/audio/polyphone { };
portfolio = callPackage ../applications/office/portfolio { portfolio = callPackage ../applications/office/portfolio {