<commit_before>{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake
, eigen, opencv, ceres-solver, cgal, boost, vcg
, gmp, mpfr, glog, google-gflags, libjpeg_turbo }:

stdenv.mkDerivation rec {
  name = "openmvs-unstable-2018-05-26";

  src = fetchFromGitHub {
    owner = "cdcseacave";
    repo = "openmvs";
    rev = "939033c55b50478339084431aac2c2318041afad";
    sha256 = "12dgkwwfdp24581y3i41gsd1k9hq0aw917q0ja5s0if4qbmc8pni";
  };

  buildInputs = [ eigen opencv ceres-solver cgal boost vcg gmp mpfr glog google-gflags libjpeg_turbo ];

  nativeBuildInputs = [ cmake pkgconfig ];

  preConfigure = ''
    cmakeFlagsArray=(
      $cmakeFlagsArray
      "-DCMAKE_CXX_FLAGS=-std=c++11"
      "-DBUILD_SHARED_LIBS=ON"
      "-DBUILD_STATIC_RUNTIME=ON"
      "-DINSTALL_BIN_DIR=$out/bin"
      "-DVCG_DIR=${vcg}"
      "-DCERES_DIR=${ceres-solver}/lib/cmake/Ceres/"
    )
  '';

  cmakeDir = "./";

  dontUseCmakeBuildDir = true;

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "A library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community";
    homepage = http://cdcseacave.github.io/openMVS/;
    license = licenses.agpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ mdaiter ];
  };
}<commit_msg>openmvs: fix CGAL 4.12 dependency<commit_after>{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake
, eigen, opencv, ceres-solver, cgal, boost, vcg
, gmp, mpfr, glog, google-gflags, libjpeg_turbo }:

stdenv.mkDerivation rec {
  name = "openmvs-unstable-2018-05-26";

  src = fetchFromGitHub {
    owner = "cdcseacave";
    repo = "openmvs";
    rev = "939033c55b50478339084431aac2c2318041afad";
    sha256 = "12dgkwwfdp24581y3i41gsd1k9hq0aw917q0ja5s0if4qbmc8pni";
  };

  buildInputs = [ eigen opencv ceres-solver cgal boost vcg gmp mpfr glog google-gflags libjpeg_turbo ];

  nativeBuildInputs = [ cmake pkgconfig ];

  preConfigure = ''
    cmakeFlagsArray=(
      $cmakeFlagsArray
      "-DCMAKE_CXX_FLAGS=-std=c++11"
      "-DBUILD_SHARED_LIBS=ON"
      "-DBUILD_STATIC_RUNTIME=ON"
      "-DINSTALL_BIN_DIR=$out/bin"
      "-DVCG_DIR=${vcg}"
      "-DCGAL_ROOT=${cgal}/lib/cmake/CGAL"
      "-DCERES_DIR=${ceres-solver}/lib/cmake/Ceres/"
    )
  '';
  
  postFixup = ''
    rp=$(patchelf --print-rpath $out/bin/DensifyPointCloud)
    patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/DensifyPointCloud

    rp=$(patchelf --print-rpath $out/bin/InterfaceVisualSFM)
    patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/InterfaceVisualSFM

    rp=$(patchelf --print-rpath $out/bin/ReconstructMesh)
    patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/ReconstructMesh

    rp=$(patchelf --print-rpath $out/bin/RefineMesh)
    patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/RefineMesh

    rp=$(patchelf --print-rpath $out/bin/TextureMesh)
    patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/TextureMesh
  '';
  
  cmakeDir = "./";

  dontUseCmakeBuildDir = true;

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "A library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community";
    homepage = http://cdcseacave.github.io/openMVS/;
    license = licenses.agpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ mdaiter ];
  };
}
{'fraction_non_alphanumeric': 0.13044776119402984, 'fraction_numerical': 0.039701492537313435, 'mean_word_length': 3.6220689655172413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4037159', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1278, 'n_words': 217}