<commit_before>{ lib, stdenv, fetchFromGitHub, fetchpatch
, cmake, halide
, libpng, libjpeg, libtiff, libraw
}:

stdenv.mkDerivation rec {
  pname = "hdr-plus-unstable";
  version = "2020-10-29";

  src = fetchFromGitHub {
    owner = "timothybrooks";
    repo = "hdr-plus";
    rev = "132bd73ccd4eaef9830124605c93f06a98607cfa";
    sha256 = "1n49ggrppf336p7n510kapzh376791bysxj3f33m3bdzksq360ps";
  };

  patches = [
    # PR #70, fixes incompatibility with Halide 10.0.0
    (fetchpatch {
      url = "https://github.com/timothybrooks/hdr-plus/pull/70/commits/077e1a476279539c72e615210762dca27984c57b.patch";
      sha256 = "1sg2l1bqs2smpfpy4flwg86fzhcc4yf7zx998v1bfhim43yyrx59";
    })
  ];

  nativeBuildInputs = [ cmake ];
<commit_msg>hdr-plus: fix build on darwin<commit_after>{ lib, stdenv, fetchFromGitHub, fetchpatch
, cmake, halide
, libpng, libjpeg, libtiff, libraw
}:

stdenv.mkDerivation rec {
  pname = "hdr-plus-unstable";
  version = "2020-10-29";

  src = fetchFromGitHub {
    owner = "timothybrooks";
    repo = "hdr-plus";
    rev = "132bd73ccd4eaef9830124605c93f06a98607cfa";
    sha256 = "1n49ggrppf336p7n510kapzh376791bysxj3f33m3bdzksq360ps";
  };

  patches = [
    # PR #70, fixes incompatibility with Halide 10.0.0
    (fetchpatch {
      url = "https://github.com/timothybrooks/hdr-plus/pull/70/commits/077e1a476279539c72e615210762dca27984c57b.patch";
      sha256 = "1sg2l1bqs2smpfpy4flwg86fzhcc4yf7zx998v1bfhim43yyrx59";
    })
  ];

  postPatch = ''
    sed -i '2a #include <array>' src/InputSource.h
  '';

  nativeBuildInputs = [ cmake ];

{'fraction_non_alphanumeric': 0.12094207511139402, 'fraction_numerical': 0.15085932527052834, 'mean_word_length': 4.006369426751593, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '246330', 'n_tokens_mistral': 810, 'n_tokens_neox': 671, 'n_words': 95}