<commit_before>{ fetchurl, stdenv, zlib, lzo, libtasn1, nettle
, guileBindings, guile, perl, psmisc }:

assert guileBindings -> guile != null;

stdenv.mkDerivation rec {

  name = "gnutls-3.0.18";

  src = fetchurl {
    url = "mirror://gnu/gnutls/${name}.tar.xz";
    sha256 = "1ynqnj1j6rrzplk2i64dik34829r0y7lwk4qlvjx993q3mj7z863";
  };

  configurePhase = ''
    ./configure --prefix="$out"                                 \
      --disable-dependency-tracking --enable-fast-install       \
      --without-p11-kit                                         \
      --with-lzo --with-libtasn1-prefix="${libtasn1}"		\
      ${if guileBindings
        then "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\""
        else ""}
  '';

  buildInputs = [ zlib lzo ]
    ++ stdenv.lib.optional guileBindings guile;

  buildNativeInputs = [ perl ];

  propagatedBuildInputs = [ nettle libtasn1 ];

  doCheck = true;

  postCheck =
    # Kill a process that's left behind.<commit_msg>GnuTLS: Allow builds on non-Linux-based OSes.<commit_after>{ fetchurl, stdenv, zlib, lzo, libtasn1, nettle
, guileBindings, guile, perl, psmisc }:

assert guileBindings -> guile != null;

stdenv.mkDerivation rec {

  name = "gnutls-3.0.18";

  src = fetchurl {
    url = "mirror://gnu/gnutls/${name}.tar.xz";
    sha256 = "1ynqnj1j6rrzplk2i64dik34829r0y7lwk4qlvjx993q3mj7z863";
  };

  configurePhase = ''
    ./configure --prefix="$out"                                 \
      --disable-dependency-tracking --enable-fast-install       \
      --without-p11-kit                                         \
      --with-lzo --with-libtasn1-prefix="${libtasn1}"		\
      ${if guileBindings
        then "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\""
        else ""}
  '';

  buildInputs = [ zlib lzo ]
    ++ stdenv.lib.optional guileBindings guile;

  buildNativeInputs = [ perl ];

  propagatedBuildInputs = [ nettle libtasn1 ];

  # XXX: Disable tests on non-Linux because of the `mini-loss-time' hack
  # below, which is Linux-specific.
  doCheck = stdenv.isLinux;

  postCheck =
    # Kill a process that's left behind.
{'fraction_non_alphanumeric': 0.13916314057357781, 'fraction_numerical': 0.032910202162670425, 'mean_word_length': 2.2193645990922843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6879401', 'n_tokens_mistral': 816, 'n_tokens_neox': 765, 'n_words': 136}