<commit_before>{ stdenv
, fetchFromGitLab
, lib
, meson
, ninja
, libGL
, libglvnd
, makeWrapper
, pkg-config
, wayland
, libxcb
, libX11
, python3
}:

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

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "mesa";
    repo = "waffle";
    rev = "v${version}";
    sha256 = "0s8gislmhccfa04zsj1yqk97lscbbnmxirr2zm4q3p8ybmpfhpqr";
  };

  buildInputs = [
    libGL
    libglvnd
    libX11
    libxcb
    wayland
  ];

  nativeBuildInputs = [
    meson
    ninja
    makeWrapper
    pkg-config
    python3
  ];

  mesonFlags = [
    "-Dgbm=disabled"
  ];

  postInstall = ''
    wrapProgram $out/bin/wflinfo \
      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}
  '';<commit_msg>waffle: Add support for non-linux platforms<commit_after>{ stdenv
, fetchFromGitLab
, lib
, meson
, ninja
, libGL
, libglvnd ? null
, makeWrapper
, pkg-config
, python3
, x11Support ? true, libxcb ? null, libX11 ? null
, waylandSupport ? true, wayland ? null
, useGbm ? true, mesa ? null, libudev ? null
}:

assert x11Support -> (libxcb != null && libX11 != null);
assert waylandSupport -> wayland != null;
assert useGbm -> (mesa != null && libudev != null);
assert with stdenv.hostPlatform; isUnix && !isDarwin -> libglvnd != null;

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

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "mesa";
    repo = "waffle";
    rev = "v${version}";
    sha256 = "0s8gislmhccfa04zsj1yqk97lscbbnmxirr2zm4q3p8ybmpfhpqr";
  };

  buildInputs = [
    libGL
  ] ++ stdenv.lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
    libglvnd
  ] ++ stdenv.lib.optionals x11Support [
    libX11
    libxcb
  ] ++ stdenv.lib.optionals waylandSupport [
    wayland
  ] ++ stdenv.lib.optionals useGbm [
    mesa
    libudev
  ];

  nativeBuildInputs = [
    meson
    ninja
    makeWrapper
    pkg-config
    python3
  ];

  postInstall = ''
    wrapProgram $out/bin/wflinfo \
      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}
  '';
{'fraction_non_alphanumeric': 0.12605042016806722, 'fraction_numerical': 0.025210084033613446, 'mean_word_length': 3.0281954887218046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '405042', 'n_tokens_mistral': 903, 'n_tokens_neox': 850, 'n_words': 161}