<commit_before>{ stdenv
, fetchurl
, gettext
, intltool
, lib
, makeWrapper

, adwaita-icon-theme
, dconf
, gconf
, gdk-pixbuf
, glib
, gnome-desktop
, gnome-settings-daemon
, gsettings-desktop-schemas
, gtk
, json-glib
, libepoxy
, libice
, libsm
, libx11
, libxau
, libxcomposite
, libxext
, libxrender
, mutter
, opengl-dummy
, systemd_lib
, upower
, xorg
, xtrans

, channel
}:

# FIXME: fix Xsync support

let
  inherit (lib)
    boolEn
    boolWt
    optionals;

  sources = {
    "3.26" = {
      version = "3.26.1";
      sha256 = "d9414b368db982d3837ca106e64019f18e6cdd5b13965bea6c7d02ddf5103708";
    };
  };
  source = sources."${channel}";
in
stdenv.mkDerivation rec {
  name = "gnome-session-${source.version}";

  src = fetchurl {
    url = "mirror://gnome/sources/gnome-session/${channel}/${name}.tar.xz";
    hashOutput = false;
    inherit (source) sha256;
  };

  nativeBuildInputs = [
    gettext
    intltool
    makeWrapper
  ];

  buildInputs = [
    adwaita-icon-theme
    dconf
    gconf
    gdk-pixbuf
    glib
    gnome-desktop
    gnome-settings-daemon
    gsettings-desktop-schemas
    gtk
    json-glib
    libepoxy
    libice
    libsm
    libx11
    libxau
    libxcomposite
    libxext
    libxrender
    xorg.libXtst
    mutter  # gschemas
    opengl-dummy
    systemd_lib
    upower
    xtrans
  ];

  configureFlags = [
    "--disable-maintainer-mode"
    "--enable-compile-warnings"
    "--disable-iso-c"
    "--enable-deprecation-flags"
    "--enable-session-selector"
    # Support legacy gconf autostart
    "--${boolEn (gconf != null)}-gconf"
    "--${boolEn (systemd_lib != null)}-systemd"
    "--disable-consolekit"
    "--disable-docbook-docs"
    "--disable-man"
    "--enable-nls"
    "--disable-schemas-compile"
    "--enable-ipv6"
    "--${boolWt (xtrans != null)}-xtrans"
  ];

  preFixup = ''
    for prog in $out/bin/*; do<commit_msg>gnome-session: update xorg references<commit_after>{ stdenv
, fetchurl
, gettext
, intltool
, lib
, makeWrapper

, adwaita-icon-theme
, dconf
, gconf
, gdk-pixbuf
, glib
, gnome-desktop
, gnome-settings-daemon
, gsettings-desktop-schemas
, gtk
, json-glib
, libepoxy
, libice
, libsm
, libx11
, libxau
, libxcomposite
, libxext
, libxrender
, libxtst
, mutter
, opengl-dummy
, systemd_lib
, upower
, xtrans

, channel
}:

# FIXME: fix Xsync support

let
  inherit (lib)
    boolEn
    boolWt
    optionals;

  sources = {
    "3.26" = {
      version = "3.26.1";
      sha256 = "d9414b368db982d3837ca106e64019f18e6cdd5b13965bea6c7d02ddf5103708";
    };
  };
  source = sources."${channel}";
in
stdenv.mkDerivation rec {
  name = "gnome-session-${source.version}";

  src = fetchurl {
    url = "mirror://gnome/sources/gnome-session/${channel}/${name}.tar.xz";
    hashOutput = false;
    inherit (source) sha256;
  };

  nativeBuildInputs = [
    gettext
    intltool
    makeWrapper
  ];

  buildInputs = [
    adwaita-icon-theme
    dconf
    gconf
    gdk-pixbuf
    glib
    gnome-desktop
    gnome-settings-daemon
    gsettings-desktop-schemas
    gtk
    json-glib
    libepoxy
    libice
    libsm
    libx11
    libxau
    libxcomposite
    libxext
    libxrender
    libxtst
    mutter  # gschemas
    opengl-dummy
    systemd_lib
    upower
    xtrans
  ];

  configureFlags = [
    "--disable-maintainer-mode"
    "--enable-compile-warnings"
    "--disable-iso-c"
    "--enable-deprecation-flags"
    "--enable-session-selector"
    # Support legacy gconf autostart
    "--${boolEn (gconf != null)}-gconf"
    "--${boolEn (systemd_lib != null)}-systemd"
    "--disable-consolekit"
    "--disable-docbook-docs"
    "--disable-man"
    "--enable-nls"
    "--disable-schemas-compile"
    "--enable-ipv6"
    "--${boolWt (xtrans != null)}-xtrans"
  ];

  preFixup = ''
    for prog in $out/bin/*; do
{'fraction_non_alphanumeric': 0.13324538258575197, 'fraction_numerical': 0.0316622691292876, 'mean_word_length': 2.549625468164794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7138024', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1448, 'n_words': 252}