<commit_before>{ stdenv, lib, fetchurl, cmake, unzip, boost }:

stdenv.mkDerivation rec {
  name = "opencolorio-${version}";
  version = "1.1.0";

  src = fetchurl {
    url = "https://github.com/imageworks/OpenColorIO/archive/v1.0.9.zip";
    sha256 = "1vi5pcgj7gv8fp6cdnhszwfh7lh38rl2rk4c5yzsvmgcb7xf48bx";
  };

  outputs = [ "bin" "out" "dev" ];

  buildInputs = [ cmake unzip ] ++ lib.optional stdenv.isDarwin boost;

  cmakeFlags = lib.optional stdenv.isDarwin "-DOCIO_USE_BOOST_PTR=ON";

  postInstall = ''
    rm $out/lib/*.a
    mkdir -p $bin/bin; mv $out/bin $bin/
  '';

  meta = with stdenv.lib; {
    homepage = http://opencolorio.org;
    description = "A color management framework for visual effects and animation";
    license = licenses.bsd3;
    maintainers = [ maintainers.goibhniu ];
    platforms = platforms.unix;
  };
}<commit_msg>opencolorio: refactor to use system lcms2 and tinyxml<commit_after>{ stdenv, lib, fetchFromGitHub, cmake, boost, pkgconfig, lcms2, tinyxml, git }:

with lib;

stdenv.mkDerivation rec {
  name = "opencolorio-${version}";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "imageworks";
    repo = "OpenColorIO";
    rev = "v${version}";
    sha256 = "0cjsyn681xsg89lirlll5pqlsqg2vnk1278iiicmzjy2a2v8x7zq";
  };

  outputs = [ "bin" "out" "dev" ];

  # TODO: Investigate whether git can be dropped: It's only used to apply patches
  nativeBuildInputs = [ cmake pkgconfig git ];

  buildInputs = [ lcms2 tinyxml ] ++ optional stdenv.isDarwin boost;

  postPatch = ''
    substituteInPlace src/core/CMakeLists.txt --replace "-Werror" ""
    substituteInPlace src/pyglue/CMakeLists.txt --replace "-Werror" ""
  '';

  cmakeFlags = [
    "-DUSE_EXTERNAL_LCMS=ON"
    "-DUSE_EXTERNAL_TINYXML=ON"
    # External libyamlcpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517
    "-DUSE_EXTERNAL_YAML=OFF"
  ] ++ optional stdenv.isDarwin "-DOCIO_USE_BOOST_PTR=ON"
    ++ optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DOCIO_USE_SSE=OFF";

  postInstall = ''
    mkdir -p $bin/bin; mv $out/bin $bin/
  '';

  meta = with stdenv.lib; {
    homepage = http://opencolorio.org;
    description = "A color management framework for visual effects and animation";
    license = licenses.bsd3;
    maintainers = [ maintainers.goibhniu ];
    platforms = platforms.unix;
  };
}
{'fraction_non_alphanumeric': 0.13617200674536256, 'fraction_numerical': 0.026138279932546374, 'mean_word_length': 3.634765625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '3395343', 'n_tokens_mistral': 944, 'n_tokens_neox': 885, 'n_words': 179}