fuzzel: refactor dependencies

* Remove unnecessary dependencies, and add wayland-scanner for gluing
wayland protocol XML files.
* Added optional flags for cairo, png and svg support
respectively and specify build type.
This commit is contained in:
polykernel 2021-08-07 14:50:59 -04:00
parent 187760e07a
commit 1531e34bdf

View file

@ -4,19 +4,28 @@
, pkg-config
, meson
, ninja
, wayland-scanner
, wayland
, pixman
, cairo
, librsvg
, wayland-protocols
, wlroots
, libxkbcommon
, scdoc
, git
, tllist
, fcft
, enableCairo ? true
, enablePNG ? true
, enableSVG ? true
# Optional dependencies
, cairo
, librsvg
, libpng
}:
let
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
in
stdenv.mkDerivation rec {
pname = "fuzzel";
version = "1.6.1";
@ -31,22 +40,29 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
pkg-config
wayland-scanner
meson
ninja
scdoc
git
];
buildInputs = [
wayland
pixman
cairo
librsvg
wayland-protocols
wlroots
libxkbcommon
tllist
fcft
] ++ lib.optional enableCairo cairo
++ lib.optional enablePNG libpng
++ lib.optional enableSVG librsvg;
mesonBuildType = "release";
mesonFlags = [
(mesonFeatureFlag "enable-cairo" enableCairo)
(mesonFeatureFlag "enable-png" enablePNG)
(mesonFeatureFlag "enable-svg" enableSVG)
];
meta = with lib; {