<commit_before>{ stdenv
, fetchTritonPatch
, fetchurl
, intltool
, itstool
, lib
, libxml2

, audit_lib
, glib
, libgcrypt
, libx11
, libxcb
, libxdmcp
, libxklavier
, pam
}:

let
  version = "1.26.0";
in
stdenv.mkDerivation rec {
  name = "lightdm-${version}";

  src = fetchurl {
    url = "https://github.com/CanonicalLtd/lightdm/releases/download/"
      + "${version}/${name}.tar.xz";
    sha256 = "c95e14e9131b5f95ecba42faaab2cfa917371193caa54fa1b4322ad7a89334f0";
  };

  postPatch = ''
    grep -q '/usr/sbin/nologin' common/user-list.c
    sed -i common/user-list.c \
      -e 's,/usr/sbin/nologin,/usr/sbin/nologin /run/current-system/sw/bin/nologin,'
    grep -q '/usr/local/bin' src/session-child.c
    sed -i src/session-child.c \
      -e 's,/usr/local/bin:/usr/bin:/bin,/run/current-system/sw/bin,'
    grep -q '/bin/rm' src/shared-data-manager.c
    sed -i src/shared-data-manager.c \
      -e 's,/bin/rm,/run/current-system/sw/bin/rm,'
  '';

  nativeBuildInputs = [
    intltool
    itstool
    libxml2
  ];

  buildInputs = [
    audit_lib
    glib
    libgcrypt
    libx11
    libxcb
    libxdmcp
    libxklavier
    pam
  ];

  configureFlags = [
    "--localstatedir=/var"
    "--sysconfdir=/etc"
    "--disable-tests"
  ];

  preInstall = ''
    installFlagsArray+=(
      "sysconfdir=$out/etc"
      "localstatedir=$TMPDIr"
    )
  '';

  meta = with lib; {
    description = "Cross-desktop display manager";<commit_msg>lightdm: Cleanup<commit_after>{ stdenv
, fetchTritonPatch
, fetchurl
, gettext
, intltool
, itstool
, lib
, libxml2
, perl
, vala

, audit_lib
, glib
, gobject-introspection
, libgcrypt
, libx11
, libxcb
, libxdmcp
, libxklavier
, pam
}:

let
  version = "1.26.0";
in
stdenv.mkDerivation rec {
  name = "lightdm-${version}";

  src = fetchurl {
    url = "https://github.com/CanonicalLtd/lightdm/releases/download/"
      + "${version}/${name}.tar.xz";
    sha256 = "c95e14e9131b5f95ecba42faaab2cfa917371193caa54fa1b4322ad7a89334f0";
  };

  postPatch = ''
    grep -q '/usr/sbin/nologin' common/user-list.c
    sed -i common/user-list.c \
      -e 's,/usr/sbin/nologin,/usr/sbin/nologin /run/current-system/sw/bin/nologin,'

    grep -q '/usr/local/bin' src/session-child.c
    sed -i src/session-child.c \
      -e 's,/usr/local/bin:/usr/bin:/bin,/run/current-system/sw/bin,'

    grep -q '/bin/rm' src/shared-data-manager.c
    sed -i src/shared-data-manager.c \
      -e 's,/bin/rm,/run/current-system/sw/bin/rm,'
  '';

  nativeBuildInputs = [
    gettext
    intltool
    itstool
    libxml2
    perl
    vala
  ];

  buildInputs = [
    audit_lib
    glib
    gobject-introspection
    libgcrypt
    libx11
    libxcb
    libxdmcp
    libxklavier
    pam
  ];

  configureFlags = [
    "--localstatedir=/var"
    "--sysconfdir=/etc"
    "--enable-introspection"
    "--enable-vala"
    "--enable-libaudit"
    "--disable-tests"
  ];

  preInstall = ''
    installFlagsArray+=(
      "sysconfdir=$out/etc"
      "localstatedir=$TMPDIr"
    )
  '';

  meta = with lib; {
    description = "Cross-desktop display manager";
{'fraction_non_alphanumeric': 0.15374592833876222, 'fraction_numerical': 0.03257328990228013, 'mean_word_length': 2.5380184331797233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3813183', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1261, 'n_words': 187}