From a983d4e779dcd0fa05e5d227233cdd29702e7e89 Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Sun, 31 Oct 2021 22:14:45 -0400 Subject: [PATCH 1/2] fuzzel: refactor configure options The current configure options exposed emulates the `choices` type of the SVG and PNG backends from upstream meson_options with a freeform string, however this is error prone and require accompanying validation which unnecessarily complicates the derivation. Two alternatives were considered: 1. Splits the possible choices into separate options nad perform assertions to ensure only one is selected. 2. Expose a set of sane default configure options, and structure the derivation around this subset. Users who wish to customize the choice used can do so using `override` or `overrideAttrs`. Option 1 is not sustainable for large amounts of options which require large amount of assertions just for ensuring uniqueness of selection, and adds complexity to the configure phase. Option 2 minimally impairs the customizablity of the derivation and was chosen in part to address option checking[1]. [1] - https://github.com/NixOS/nixpkgs/pull/141836#discussion_r739910095 --- pkgs/applications/misc/fuzzel/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/fuzzel/default.nix b/pkgs/applications/misc/fuzzel/default.nix index d697e8412adc..b187dcc0e8c6 100644 --- a/pkgs/applications/misc/fuzzel/default.nix +++ b/pkgs/applications/misc/fuzzel/default.nix @@ -13,14 +13,16 @@ , tllist , fcft , enableCairo ? true -, withPNGBackend ? "libpng" -, withSVGBackend ? "librsvg" - # Optional dependencies +, svgSupport ? true +, pngSupport ? true +# Optional dependencies , cairo , librsvg , libpng }: +assert svgSupport -> enableCairo; + stdenv.mkDerivation rec { pname = "fuzzel"; version = "1.7.0"; @@ -49,15 +51,15 @@ stdenv.mkDerivation rec { tllist fcft ] ++ lib.optional enableCairo cairo - ++ lib.optional (withPNGBackend == "libpng") libpng - ++ lib.optional (withSVGBackend == "librsvg") librsvg; + ++ lib.optional pngSupport libpng + ++ lib.optional svgSupport librsvg; mesonBuildType = "release"; mesonFlags = [ "-Denable-cairo=${if enableCairo then "enabled" else "disabled"}" - "-Dpng-backend=${withPNGBackend}" - "-Dsvg-backend=${withSVGBackend}" + "-Dpng-backend=${if pngSupport then "libpng" else "none"}" + "-Dsvg-backend=${if svgSupport then "librsvg" else "none"}" ]; CFLAGS = "-Wno-error=comment"; # https://gitlab.gnome.org/GNOME/librsvg/-/issues/856 From 72dc88a9aa24586d088d037839e462098645e18f Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Sun, 28 Aug 2022 19:29:18 -0400 Subject: [PATCH 2/2] fuzzel: revert CFLAGS workaround for librsvg regression The '-Wno-error=comment' cflag was introduced in https://github.com/NixOS/nixpkgs/commit/e01c41205234a68a55903e05800e62d0de302e1a as a workaround for the librsvg build regression[1] when '-Werror' is used. The issue has been fixed since release v2.54.1[2]. [1] - https://gitlab.gnome.org/GNOME/librsvg/-/issues/856 [2] - https://gitlab.gnome.org/GNOME/librsvg/-/commit/39a6d3418c0df8ca5ea4d0df3e1b14b915c75608 --- pkgs/applications/misc/fuzzel/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/misc/fuzzel/default.nix b/pkgs/applications/misc/fuzzel/default.nix index b187dcc0e8c6..421f98b1fb62 100644 --- a/pkgs/applications/misc/fuzzel/default.nix +++ b/pkgs/applications/misc/fuzzel/default.nix @@ -62,8 +62,6 @@ stdenv.mkDerivation rec { "-Dsvg-backend=${if svgSupport then "librsvg" else "none"}" ]; - CFLAGS = "-Wno-error=comment"; # https://gitlab.gnome.org/GNOME/librsvg/-/issues/856 - meta = with lib; { description = "Wayland-native application launcher, similar to rofi’s drun mode"; homepage = "https://codeberg.org/dnkl/fuzzel";