yambar: build with dual support, both wayland and x11 (#146568)

yambar: build with dual support for X11 and Wayland by default

If by any reason a X11-only or a Wayland-only build is needed, just `override` it!
This commit is contained in:
Amy de Buitléir
2021-11-22 22:26:27 +00:00
committed by GitHub
parent ef63ed7b10
commit daa8c59404
2 changed files with 17 additions and 19 deletions

View File

@@ -1,35 +1,34 @@
{ stdenv { lib
, lib , stdenv
, fetchFromGitea , fetchFromGitea
, pkg-config
, meson
, ninja
, scdoc
, alsa-lib , alsa-lib
, fcft , fcft
, json_c , json_c
, libmpdclient , libmpdclient
, libxcb
, libyaml , libyaml
, meson
, ninja
, pixman , pixman
, pkg-config
, scdoc
, tllist , tllist
, udev , udev
, wayland , wayland
, wayland-scanner
, wayland-protocols , wayland-protocols
, waylandSupport ? false , wayland-scanner
# Xorg backend
, libxcb
, xcbutil , xcbutil
, xcbutilcursor , xcbutilcursor
, xcbutilerrors , xcbutilerrors
, xcbutilwm , xcbutilwm
, waylandSupport ? true
, x11Support ? true
}: }:
let let
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54 # Courtesy of sternenseemann and FRidh
mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}"; mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "yambar"; pname = "yambar";
version = "1.7.0"; version = "1.7.0";
@@ -59,9 +58,10 @@ stdenv.mkDerivation rec {
pixman pixman
tllist tllist
udev udev
] ++ lib.optionals (waylandSupport) [
wayland wayland
wayland-protocols wayland-protocols
] ++ lib.optionals (!waylandSupport) [ ] ++ lib.optionals (x11Support) [
xcbutil xcbutil
xcbutilcursor xcbutilcursor
xcbutilerrors xcbutilerrors
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
mesonBuildType = "release"; mesonBuildType = "release";
mesonFlags = [ mesonFlags = [
(mesonFeatureFlag "backend-x11" (!waylandSupport)) (mesonFeatureFlag "backend-x11" x11Support)
(mesonFeatureFlag "backend-wayland" waylandSupport) (mesonFeatureFlag "backend-wayland" waylandSupport)
]; ];
@@ -84,9 +84,9 @@ stdenv.mkDerivation rec {
X11 and Wayland, that goes to great lengths to be both CPU and battery X11 and Wayland, that goes to great lengths to be both CPU and battery
efficient - polling is only done when absolutely necessary. efficient - polling is only done when absolutely necessary.
It has a number of modules that provide information in the form of It has a number of modules that provide information in the form of tags.
tags. For example, the clock module has a date tag that contains the For example, the clock module has a date tag that contains the current
current date. date.
The modules do not know how to present the information though. This is The modules do not know how to present the information though. This is
instead done by particles. And the user, you, decides which particles (and instead done by particles. And the user, you, decides which particles (and

View File

@@ -27113,8 +27113,6 @@ with pkgs;
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 {