11 # Only required on Linux
14 # Only required on Darwin
19 pythonBindings ? true, # Python bindings
22 buildApps ? true, # Utility applications
27 stdenv.mkDerivation rec {
28 pname = "opencolorio";
31 src = fetchFromGitHub {
32 owner = "AcademySoftwareFoundation";
35 hash = "sha256-7Uj1YBpunj9/32U5hpCokxfcVoRB9Oi2G9Cso+gAu5Q=";
39 # Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/25200.
40 # Needed for zlib >= 1.3 && cmake < 3.27.4.
41 ./broken-cmake-zlib-version.patch
42 # Fix incorrect line number in test
46 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
47 # these tests don't like being run headless on darwin. no builtin
48 # way of skipping tests so this is what we're reduced to.
49 substituteInPlace tests/cpu/Config_tests.cpp \
50 --replace 'OCIO_ADD_TEST(Config, virtual_display)' 'static void _skip_virtual_display()' \
51 --replace 'OCIO_ADD_TEST(Config, virtual_display_with_active_displays)' 'static void _skip_virtual_display_with_active_displays()'
54 nativeBuildInputs = [ cmake ];
63 ++ lib.optionals stdenv.hostPlatform.isLinux [
67 ++ lib.optionals stdenv.hostPlatform.isDarwin [
72 ++ lib.optionals pythonBindings [
73 python3Packages.python
74 python3Packages.pybind11
76 ++ lib.optionals buildApps [
83 "-DOCIO_INSTALL_EXT_PACKAGES=NONE"
84 "-DOCIO_USE_SSE2NEON=OFF"
85 # GPU test fails with: libglut (GPU tests): failed to open display ''
86 "-DOCIO_BUILD_GPU_TESTS=OFF"
87 "-Dminizip-ng_INCLUDE_DIR=${minizip-ng}/include/minizip-ng"
89 ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF"
90 ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";
92 # precision issues on non-x86
93 doCheck = stdenv.hostPlatform.isx86_64;
94 # Tends to fail otherwise.
95 enableParallelChecking = false;
98 homepage = "https://opencolorio.org";
99 description = "Color management framework for visual effects and animation";
100 license = licenses.bsd3;
101 maintainers = [ maintainers.rytone ];
102 platforms = platforms.unix;