11 # Only required on Linux
14 # Only required on Darwin
19 , pythonBindings ? true # Python bindings
22 , buildApps ? true # Utility applications
28 stdenv.mkDerivation rec {
29 pname = "opencolorio";
32 src = fetchFromGitHub {
33 owner = "AcademySoftwareFoundation";
36 sha256 = "sha256-e1PpWjjfSjtgN9Rs/+lsA45Z9S4y4T6nqrJ02DZ4vjs=";
41 name = "darwin-no-hidden-l.patch";
42 url = "https://github.com/AcademySoftwareFoundation/OpenColorIO/commit/48bab7c643ed8d108524d718e5038d836f906682.patch";
44 sha256 = "sha256-0DF+lwi2nfkUFG0wYvL3HYbhZS6SqGtPWoOabrFS1Eo=";
48 nativeBuildInputs = [ cmake ];
55 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ glew freeglut ]
56 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon GLUT Cocoa ]
57 ++ lib.optionals pythonBindings [ python3Packages.python python3Packages.pybind11 ]
58 ++ lib.optionals buildApps [ lcms2 openimageio2 openexr ];
61 "-DOCIO_INSTALL_EXT_PACKAGES=NONE"
62 ] ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF"
63 ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";
65 # TODO Investigate this: Python and GPU tests fail to load libOpenColorIO.so.2.0
68 # https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1649
70 substituteInPlace src/OpenColorIO/CMakeLists.txt \
71 --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \
72 --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR}
76 homepage = "https://opencolorio.org";
77 description = "A color management framework for visual effects and animation";
78 license = licenses.bsd3;
79 maintainers = [ maintainers.rytone ];
80 platforms = platforms.unix;