summary refs log tree commit diff
path: root/pkgs/development/libraries/opencolorio/default.nix
blob: b93e517def66671cb63816ed4aa990206d12e841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  stdenv, lib, fetchFromGitHub, symlinkJoin,
  cmake, expat, libyamlcpp, ilmbase, pystring, # Base dependencies

  glew, freeglut, # Only required on Linux
  Carbon, GLUT, Cocoa, # Only required on Darwin

  pythonBindings ? true, # Python bindings
  python3Packages,

  buildApps ? true, # Utility applications
  lcms2, openimageio2, openexr,
}:

with lib;

stdenv.mkDerivation rec {
  pname = "opencolorio";
  version = "2.0.1";

  src = fetchFromGitHub {
    owner = "AcademySoftwareFoundation";
    repo = "OpenColorIO";
    rev = "v${version}";
    sha256 = "194j9jp5c8ws0fryiz936wyinphnpzwpqnzvw9ryx6rbiwrba487";
  };

  nativeBuildInputs = [ cmake (symlinkJoin { name = "expat"; paths = [ expat.out expat.dev ]; }) ];
  buildInputs = [ expat.out libyamlcpp ilmbase pystring ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [ glew freeglut ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon GLUT Cocoa ]
    ++ lib.optionals pythonBindings [ python3Packages.python python3Packages.pybind11 ]
    ++ lib.optionals buildApps [ lcms2 openimageio2 openexr ];

    cmakeFlags = [ "-DOCIO_INSTALL_EXT_PACKAGES=NONE" ]
    ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF"
    ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";

  # TODO Investigate this: Python and GPU tests fail to load libOpenColorIO.so.2.0
  # doCheck = true;

  meta = with lib; {
    homepage = "https://opencolorio.org";
    description = "A color management framework for visual effects and animation";
    license = licenses.bsd3;
    maintainers = [ maintainers.rytone ];
    platforms = platforms.unix;
  };
}