summary refs log blame commit diff
path: root/pkgs/development/libraries/opencolorio/default.nix
blob: 42c0de4d493c26c34882a8b9dfa3935abe7d655d (plain) (tree)
1
2
3
4
5
6
7
8


                                                                               

                         
                                  
                    
 




                                                                    

    

                                  








                                                                                 
 






                                                                                                    
 
                  


                                        




                                                                                  
                               
    
 
{ 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;
  };
}