<commit_before>{ lib, stdenv, fetchurl, buildPackages, perl, coreutils, fetchFromGitHub
, withCryptodev ? false, cryptodev
, enableSSL2 ? false
, enableSSL3 ? false
, static ? stdenv.hostPlatform.isStatic
# Used to avoid cross compiling perl, for example, in darwin bootstrap tools.
# This will cause c_rehash to refer to perl via the environment, but otherwise
# will produce a perfectly functional openssl binary and library.
, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform
}:

stdenv.mkDerivation rec {
  pname = "quictls";
  version = "3.0.3+quick_unstable-2022-05.04";

  src = fetchFromGitHub {
    owner = "quictls";
    repo = "openssl";
    rev = "368c9d581b17f0bbe425f8dedeaa7b864a7b29ce";
    sha256 = "sha256-W3bILxhyeziWQNZUHUg/D9eV8LnmHJqEFwyzWjJrRuc=";
  };

  patches = [
    ../openssl/3.0/nix-ssl-cert-file.patch

    # openssl will only compile in KTLS if the current kernel supports it.
    # This patch disables build-time detection.
    ../openssl/3.0/openssl-disable-kernel-detection.patch

    (if stdenv.hostPlatform.isDarwin
      then ../openssl/use-etc-ssl-certs-darwin.patch
      else ../openssl/use-etc-ssl-certs.patch)
  ];

  postPatch = ''
    patchShebangs Configure
  ''
  # config is a configure script which is not installed.
  + ''
    substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env'
  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
    substituteInPlace crypto/async/arch/async_posix.h \
      --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
                '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
  '';<commit_msg>quictls: 3.0.3+quick_unstable-2022-05.04 -> 3.0.5+quick_unstable-2022-07.05<commit_after>{ lib, stdenv, fetchurl, buildPackages, perl, coreutils, fetchFromGitHub
, withCryptodev ? false, cryptodev
, enableSSL2 ? false
, enableSSL3 ? false
, static ? stdenv.hostPlatform.isStatic
# Used to avoid cross compiling perl, for example, in darwin bootstrap tools.
# This will cause c_rehash to refer to perl via the environment, but otherwise
# will produce a perfectly functional openssl binary and library.
, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform
}:

stdenv.mkDerivation rec {
  pname = "quictls";
  version = "3.0.5+quick_unstable-2022-07.05";

  src = fetchFromGitHub {
    owner = "quictls";
    repo = "openssl";
    rev = "75e940831d0570d6b020cfebf128ae500f424867";
    sha256 = "sha256-1HBGKafcCbM0RZWLvyl3vpSfGBsAcGDgjz1Nm/qclWM=";
  };

  patches = [
    ../openssl/3.0/nix-ssl-cert-file.patch

    # openssl will only compile in KTLS if the current kernel supports it.
    # This patch disables build-time detection.
    ../openssl/3.0/openssl-disable-kernel-detection.patch

    (if stdenv.hostPlatform.isDarwin
      then ../openssl/use-etc-ssl-certs-darwin.patch
      else ../openssl/use-etc-ssl-certs.patch)
  ];

  postPatch = ''
    patchShebangs Configure
  ''
  # config is a configure script which is not installed.
  + ''
    substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env'
  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
    substituteInPlace crypto/async/arch/async_posix.h \
      --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
                '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
  '';
{'fraction_non_alphanumeric': 0.1196043165467626, 'fraction_numerical': 0.03776978417266187, 'mean_word_length': 3.6027586206896554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4144654', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1154, 'n_words': 248}