<commit_before>{ stdenv
, lib
, fetchFromGitea
, pkg-config
, meson
, ninja
, wayland
, pixman
, cairo
, librsvg
, wayland-protocols
, wlroots
, libxkbcommon
, scdoc
, git
, tllist
, fcft
}:

stdenv.mkDerivation rec {
  pname = "fuzzel";
  version = "1.6.1";

  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "dnkl";
    repo = "fuzzel";
    rev = version;
    sha256 = "sha256-JW5sAlTprSRIdFbmSaUreGtNccERgQMGEW+WCSscYQk=";
  };

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    scdoc
    git
  ];

  buildInputs = [
    wayland
    pixman
    cairo
    librsvg
    wayland-protocols
    wlroots
    libxkbcommon
    tllist
    fcft
  ];

  meta = with lib; {
    description = "Wayland-native application launcher, similar to rofi’s drun mode";
    homepage = "https://codeberg.org/dnkl/fuzzel";
    license = licenses.mit;
    maintainers = with maintainers; [ fionera ];
    platforms = with platforms; linux;
    changelog = "https://codeberg.org/dnkl/fuzzel/releases/tag/${version}";
  };
}
<commit_msg>fuzzel: refactor dependencies<commit_after>{ stdenv
, lib
, fetchFromGitea
, pkg-config
, meson
, ninja
, wayland-scanner
, wayland
, pixman
, wayland-protocols
, libxkbcommon
, scdoc
, tllist
, fcft
, enableCairo ? true
, enablePNG ? true
, enableSVG ? true
# Optional dependencies
, cairo
, librsvg
, libpng
}:

let
  # Courtesy of sternenseemann and FRidh, commit <PASSWORD>
  mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
in

stdenv.mkDerivation rec {
  pname = "fuzzel";
  version = "1.6.1";

  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "dnkl";
    repo = "fuzzel";
    rev = version;
    sha256 = "sha256-JW5sAlTprSRIdFbmSaUreGtNccERgQMGEW+WCSscYQk=";
  };

  nativeBuildInputs = [
    pkg-config
    wayland-scanner
    meson
    ninja
    scdoc
  ];

  buildInputs = [
    wayland
    pixman
    wayland-protocols
    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; {
    description = "Wayland-native application launcher, similar to rofi’s drun mode";
    homepage = "https://codeberg.org/dnkl/fuzzel";
    license = licenses.mit;
    maintainers = with maintainers; [ fionera ];
    platforms = with platforms; linux;
    changelog = "https://codeberg.org/dnkl/fuzzel/releases/tag/${version}";
  };
}

{'fraction_non_alphanumeric': 0.1175123998473865, 'fraction_numerical': 0.007630675314765357, 'mean_word_length': 3.103286384976526, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2127351', 'n_tokens_mistral': 1034, 'n_tokens_neox': 994, 'n_words': 202}