<commit_before>{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers
, cudaSupport ? false, cudatoolkit ? null
}:

stdenv.mkDerivation rec {
  pname = "waifu2x-converter-cpp";
  version = "5.3.4";

  src = fetchFromGitHub {
    owner = "DeadSix27";
    repo = pname;
    rev = "v${version}";
    sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
  };

  patchPhase = ''
    # https://github.com/DeadSix27/waifu2x-converter-cpp/issues/123
    sed -i 's:{"PNG",  false},:{"PNG",  true},:' src/main.cpp
  '';

  buildInputs = [
    ocl-icd opencv3 opencl-headers
  ] ++ lib.optional cudaSupport cudatoolkit;

  nativeBuildInputs = [ cmake makeWrapper ];

  preFixup = ''
    wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
  '';

  meta = {
    description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
    homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.xzfc ];
    platforms = lib.platforms.linux;
  };
}
<commit_msg>waifu2x-converter-cpp: Remove obsolete patch<commit_after>{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers
, cudaSupport ? false, cudatoolkit ? null
}:

stdenv.mkDerivation rec {
  pname = "waifu2x-converter-cpp";
  version = "5.3.4";

  src = fetchFromGitHub {
    owner = "DeadSix27";
    repo = pname;
    rev = "v${version}";
    sha256 = "<KEY>";
  };

  buildInputs = [
    ocl-icd opencv3 opencl-headers
  ] ++ lib.optional cudaSupport cudatoolkit;

  nativeBuildInputs = [ cmake makeWrapper ];

  preFixup = ''
    wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
  '';

  meta = {
    description = "Improved fork of Waifu2X C++ using OpenCL and OpenCV";
    homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.xzfc ];
    platforms = lib.platforms.linux;
  };
}

{'fraction_non_alphanumeric': 0.14419753086419754, 'fraction_numerical': 0.02962962962962963, 'mean_word_length': 3.492239467849224, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, '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': '4760093', 'n_tokens_mistral': 834, 'n_tokens_neox': 780, 'n_words': 139}