opencolorio: 2.1.2 -> 2.2.0

openimageio is no longer required for the apps, so remove it in
favour of openexr_3 to avoid a circular dependency
This commit is contained in:
Robert Scott 2022-12-27 17:43:34 +00:00
parent d7726df8c0
commit 8a02212d0e

View file

@ -8,6 +8,7 @@
, ilmbase
, pystring
, imath
, minizip-ng
# Only required on Linux
, glew
, freeglut
@ -21,19 +22,18 @@
# Build apps
, buildApps ? true # Utility applications
, lcms2
, openimageio2
, openexr
, openexr_3
}:
stdenv.mkDerivation rec {
pname = "opencolorio";
version = "2.1.2";
version = "2.2.0";
src = fetchFromGitHub {
owner = "AcademySoftwareFoundation";
repo = "OpenColorIO";
rev = "v${version}";
sha256 = "sha256-e1PpWjjfSjtgN9Rs/+lsA45Z9S4y4T6nqrJ02DZ4vjs=";
sha256 = "sha256-l5UUysHdP/gb4Mn5A64XEoHOkthl6Mlb95CuI0l4vXQ=";
};
patches = [
@ -43,8 +43,21 @@ stdenv.mkDerivation rec {
revert = true;
sha256 = "sha256-0DF+lwi2nfkUFG0wYvL3HYbhZS6SqGtPWoOabrFS1Eo=";
})
(fetchpatch {
name = "pkg-config-absolute-path.patch";
url = "https://github.com/AcademySoftwareFoundation/OpenColorIO/commit/332462e7f5051b7e26ee3d8c22890cd5e71e7c30.patch";
sha256 = "sha256-7xHALhnOkKszgFBgPIbiZQaORnEJ+1M6RyoZdFgjElM=";
})
];
postPatch = lib.optionalString stdenv.isDarwin ''
# these tests don't like being run headless on darwin. no builtin
# way of skipping tests so this is what we're reduced to.
substituteInPlace tests/cpu/Config_tests.cpp \
--replace 'OCIO_ADD_TEST(Config, virtual_display)' 'static void _skip_virtual_display()' \
--replace 'OCIO_ADD_TEST(Config, virtual_display_with_active_displays)' 'static void _skip_virtual_display_with_active_displays()'
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
expat
@ -52,25 +65,24 @@ stdenv.mkDerivation rec {
ilmbase
pystring
imath
minizip-ng
] ++ 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 ];
++ lib.optionals buildApps [
lcms2
openexr_3
];
cmakeFlags = [
"-DOCIO_INSTALL_EXT_PACKAGES=NONE"
] ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF"
++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";
cmakeFlags = [
"-DOCIO_INSTALL_EXT_PACKAGES=NONE"
# GPU test fails with: freeglut (GPU tests): failed to open display ''
"-DOCIO_BUILD_GPU_TESTS=OFF"
] ++ 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;
# https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1649
postPatch = ''
substituteInPlace src/OpenColorIO/CMakeLists.txt \
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR}
'';
# precision issues on non-x86
doCheck = stdenv.isx86_64;
meta = with lib; {
homepage = "https://opencolorio.org";