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 , pkg-config
, meson , meson
, ninja , ninja
, wayland-scanner
, wayland , wayland
, pixman , pixman
, cairo
, librsvg
, wayland-protocols , wayland-protocols
, wlroots
, libxkbcommon , libxkbcommon
, scdoc , scdoc
, git
, tllist , tllist
, fcft , 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 { stdenv.mkDerivation rec {
pname = "fuzzel"; pname = "fuzzel";
version = "1.6.1"; version = "1.6.1";
@ -31,22 +40,29 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
wayland-scanner
meson meson
ninja ninja
scdoc scdoc
git
]; ];
buildInputs = [ buildInputs = [
wayland wayland
pixman pixman
cairo
librsvg
wayland-protocols wayland-protocols
wlroots
libxkbcommon libxkbcommon
tllist tllist
fcft 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; { meta = with lib; {