├── oiio_python ├── __init__.py ├── loaders │ ├── oiio_loader.py │ ├── ocio_loader.py │ ├── ocio_loader_win.py │ └── oiio_loader_win.py ├── recipes │ ├── dependencies │ │ ├── libtiff │ │ │ ├── test_package │ │ │ │ ├── test_package.c │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── conanfile.py │ │ │ ├── conandata.yml │ │ │ ├── patches │ │ │ │ └── 4.5.1-0001-cmake-dependencies.patch │ │ │ └── conanfile.py │ │ ├── libraw │ │ │ ├── test_package │ │ │ │ ├── test_package.cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── conanfile.py │ │ │ ├── conandata.yml │ │ │ ├── CMakeLists.txt │ │ │ └── conanfile.py │ │ ├── libuhdr │ │ │ ├── test_package │ │ │ │ ├── test_package.cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── conanfile.py │ │ │ ├── conandata.yml │ │ │ ├── patches │ │ │ │ └── 1.3.0-0001-fix-policy.patch │ │ │ └── conanfile.py │ │ ├── libjxl │ │ │ ├── test_package │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── test_package.c │ │ │ │ └── conanfile.py │ │ │ ├── conandata.yml │ │ │ ├── conan_deps.cmake │ │ │ └── conanfile.py │ │ └── bzip2 │ │ │ ├── patches │ │ │ └── 0001-fix-sys-stat-include.patch │ │ │ ├── conandata.yml │ │ │ ├── test_package │ │ │ ├── test_package.c │ │ │ ├── CMakeLists.txt │ │ │ └── conanfile.py │ │ │ ├── CMakeLists.txt │ │ │ └── conanfile.py │ ├── opencolorio │ │ ├── test_package │ │ │ ├── test_package.cpp │ │ │ ├── CMakeLists.txt │ │ │ └── conanfile.py │ │ ├── patches │ │ │ ├── 2.2.1-0003-strlen.patch │ │ │ ├── 2.2.1-0004-bindwin.patch │ │ │ ├── 2.2.1-0001-fix-cmake-source-dir-and-targets.patch │ │ │ ├── 2.4.0-0001-fix-cmake-source-dir-and-targets.patch │ │ │ └── 2.2.1-0002-fix-pystring.patch │ │ ├── conandata.yml │ │ └── conanfile.py │ └── openimageio │ │ ├── test_package │ │ ├── test_package.cpp │ │ ├── CMakeLists.txt │ │ └── conanfile.py │ │ └── conandata.yml └── tool_wrappers │ ├── oiio_tools.py │ ├── oiio_tools_win.py │ ├── ocio_tools.py │ └── ocio_tools_win.py ├── setuputils ├── __init__.py ├── linux_before_all.sh ├── build_dependencies.py ├── build_packages.py ├── build_utils.py └── macos_fix_shared_libs.py ├── .github └── workflows │ ├── build_linux_wheels.yml │ ├── build_linux_aarch64_wheels.yml │ ├── build_wheels.yml │ └── build_static_wheels.yml ├── licenses ├── giflib-LICENSE ├── imath-LICENSE ├── libtiff-LICENSE ├── openexr-LICENSE ├── fmt-LICENSE ├── opencolorio-LICENSE ├── hdf5-LICENSE ├── libwebp-LICENSE ├── pystring-LICENSE ├── ptex-LICENSE ├── pybind11-LICENSE ├── freetype-LICENSE ├── openjpeg-LICENSE ├── libpng-LICENSE ├── libjpegturbo-LICENSE ├── onetbb-LICENSE └── openimageio-LICENSE ├── pyproject.toml ├── test.py ├── MANIFEST.in ├── .gitignore ├── publish_on_pypi.py ├── setup.py ├── README.md └── LICENSE /oiio_python/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /oiio_python/loaders/oiio_loader.py: -------------------------------------------------------------------------------- 1 | from .OpenImageIO import * 2 | from .OpenImageIO import __version__ 3 | -------------------------------------------------------------------------------- /oiio_python/loaders/ocio_loader.py: -------------------------------------------------------------------------------- 1 | from .PyOpenColorIO import * 2 | from .PyOpenColorIO import __version__ 3 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/test_package/test_package.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | TIFF* tif = TIFFOpen("foo.tif", "w"); 6 | TIFFClose(tif); 7 | return 0; 8 | } -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/test_package/test_package.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << libraw_version() << "\n"; 7 | return 0; 8 | } -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/test_package/test_package.cpp: -------------------------------------------------------------------------------- 1 | #include "ultrahdr_api.h" 2 | #include 3 | 4 | int main() { 5 | std::cout << "libultrahdr: " << UHDR_LIB_VERSION_STR << std::endl; 6 | return 0; 7 | } -------------------------------------------------------------------------------- /setuputils/__init__.py: -------------------------------------------------------------------------------- 1 | # Pylint: disable=missing-module-docstring,import-error 2 | from .build_dependencies import build_dependencies 3 | from .build_packages import build_packages 4 | from .macos_fix_shared_libs import relink_and_delocate 5 | -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/test_package/test_package.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "OpenColorIO " << OCIO_NAMESPACE::GetVersion() << "\n"; 7 | return 0; 8 | } -------------------------------------------------------------------------------- /oiio_python/loaders/ocio_loader_win.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | _ocio_site_dir = Path(__file__).parent.resolve() 5 | with os.add_dll_directory(_ocio_site_dir.as_posix()): 6 | from .PyOpenColorIO import * 7 | from .PyOpenColorIO import __version__ 8 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(test_package LANGUAGES C) 3 | 4 | find_package(TIFF REQUIRED) 5 | 6 | add_executable(${PROJECT_NAME} test_package.c) 7 | target_link_libraries(${PROJECT_NAME} PRIVATE TIFF::TIFF) -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(test_package C) 3 | 4 | find_package(libjxl REQUIRED CONFIG) 5 | 6 | add_executable(${PROJECT_NAME} test_package.c) 7 | target_link_libraries(${PROJECT_NAME} PRIVATE libjxl::libjxl) -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(test_package CXX) 3 | 4 | find_package(libuhdr CONFIG REQUIRED) 5 | 6 | add_executable(${PROJECT_NAME} test_package.cpp) 7 | target_link_libraries(${PROJECT_NAME} PRIVATE libuhdr::libuhdr) 8 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/patches/0001-fix-sys-stat-include.patch: -------------------------------------------------------------------------------- 1 | --- a/bzip2.c 2 | +++ b/bzip2.c 3 | @@ -128,7 +128,7 @@ 4 | #if BZ_LCCWIN32 5 | # include 6 | # include 7 | -# include 8 | +# include 9 | 10 | # define NORETURN /**/ 11 | # define PATH_SEP '\\' -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(test_package LANGUAGES CXX) 3 | 4 | find_package(libraw REQUIRED CONFIG) 5 | 6 | add_executable(${PROJECT_NAME} test_package.cpp) 7 | target_link_libraries(${PROJECT_NAME} PRIVATE libraw::libraw) 8 | target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(test_package LANGUAGES CXX) 3 | 4 | find_package(OpenColorIO REQUIRED CONFIG) 5 | 6 | add_executable(${PROJECT_NAME} test_package.cpp) 7 | target_link_libraries(${PROJECT_NAME} PRIVATE OpenColorIO::OpenColorIO) 8 | target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) -------------------------------------------------------------------------------- /oiio_python/recipes/openimageio/test_package/test_package.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "OpenImageIO " << OIIO_VERSION_STRING << std::endl; 7 | std::string formats = OIIO::get_string_attribute("format_list"); 8 | std::cout << "Supported formats:\n" << formats << std::endl; 9 | return 0; 10 | } -------------------------------------------------------------------------------- /oiio_python/loaders/oiio_loader_win.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | _oiio_site_dir: Path = Path(__file__).parent.resolve() 5 | _ocio_site_dir: Path = _oiio_site_dir.parent / "PyOpenColorIO" 6 | with os.add_dll_directory(_oiio_site_dir.as_posix()), os.add_dll_directory( 7 | _ocio_site_dir.as_posix() 8 | ): 9 | from .OpenImageIO import * 10 | from .OpenImageIO import __version__ 11 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "4.7.0": 3 | url: "https://download.osgeo.org/libtiff/tiff-4.7.0.tar.xz" 4 | sha256: "273a0a73b1f0bed640afee4a5df0337357ced5b53d3d5d1c405b936501f71017" 5 | patches: 6 | "4.7.0": 7 | - patch_file: "patches/4.5.1-0001-cmake-dependencies.patch" 8 | patch_description: "CMake: robust handling of dependencies" 9 | patch_type: "conan" 10 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "1.3.0": 3 | url: "https://github.com/google/libultrahdr/archive/refs/tags/v1.3.0.tar.gz" 4 | sha256: "bf425e10a1a36507d47eb2711018e90effe11c76db8ecd4f10f4e1af9cb5288c" 5 | patches: 6 | "1.3.0": 7 | - patch_file: "patches/1.3.0-0001-fix-policy.patch" 8 | patch_description: "Fix CMAKE Policy preventing Windows build" 9 | patch_type: "conan" -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/test_package/test_package.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "jxl/decode.h" 5 | #include "jxl/thread_parallel_runner.h" 6 | 7 | int main() 8 | { 9 | JxlDecoder *dec = NULL; 10 | void *runner = NULL; 11 | dec = JxlDecoderCreate(NULL); 12 | 13 | // Allways True 14 | if (JxlDecoderSubscribeEvents(dec, JXL_DEC_BASIC_INFO) == JXL_DEC_SUCCESS) 15 | { 16 | printf("Test"); 17 | } 18 | } -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "1.0.8": 3 | url: "https://github.com/libarchive/bzip2/archive/refs/tags/bzip2-1.0.8.tar.gz" 4 | sha256: "db106b740252669664fd8f3a1c69fe7f689d5cd4b132f82ba82b9afba27627df" 5 | "1.0.6": 6 | url: "https://sourceware.org/pub/bzip2/bzip2-1.0.6.tar.gz" 7 | sha256: "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" 8 | patches: 9 | "1.0.6": 10 | - patch_file: "patches/0001-fix-sys-stat-include.patch" -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/test_package/test_package.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "bzlib.h" 4 | 5 | 6 | int main(void) { 7 | char buffer [256] = {0}; 8 | unsigned int size = 256; 9 | const char* version = BZ2_bzlibVersion(); 10 | printf("Bzip2 version: %s\n", version); 11 | BZ2_bzBuffToBuffCompress(buffer, &size, "conan-package-manager", 21, 1, 0, 1); 12 | printf("Bzip2 compressed: %s\n", buffer); 13 | return EXIT_SUCCESS; 14 | } -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/patches/1.3.0-0001-fix-policy.patch: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2 | +++ CMakeLists.txt 3 | @@ -18,9 +18,9 @@ 4 | 5 | # CMP0091: MSVC runtime library flags are selected by an abstraction. 6 | # New in CMake 3.15. https://cmake.org/cmake/help/latest/policy/CMP0091.html 7 | -if(POLICY CMP0091) 8 | - cmake_policy(SET CMP0091 OLD) 9 | -endif() 10 | +# if(POLICY CMP0091) 11 | +# cmake_policy(SET CMP0091 OLD) 12 | +# endif() 13 | 14 | set(UHDR_MAJOR_VERSION 1) 15 | set(UHDR_MINOR_VERSION 3) -------------------------------------------------------------------------------- /oiio_python/recipes/openimageio/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(test_package CXX) 3 | 4 | find_package(OpenImageIO REQUIRED CONFIG) 5 | find_package(fmt REQUIRED CONFIG) 6 | 7 | add_executable(${PROJECT_NAME} test_package.cpp) 8 | target_link_libraries(${PROJECT_NAME} PRIVATE OpenImageIO::OpenImageIO 9 | OpenImageIO::OpenImageIO_Util 10 | fmt::fmt) 11 | target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "0.10.3": 3 | url: "https://github.com/libjxl/libjxl/archive/v0.10.3.zip" 4 | sha256: "a9e2103f61ab79f5561b506ad03fcba33207263284b1a796eba3ca826ab0a75f" 5 | "0.10.2": 6 | url: "https://github.com/libjxl/libjxl/archive/v0.10.2.zip" 7 | sha256: "910ab4245eebe0fba801a057f5fbc4fe96dad7c9979880bb49ad3e2623a911a2" 8 | "0.8.2": 9 | url: "https://github.com/libjxl/libjxl/archive/v0.8.2.zip" 10 | sha256: "1f2ccc06f07c4f6cf4aa6c7763ba0598f12a7544d597f02beb07f615eb08ccf0" -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/patches/2.2.1-0003-strlen.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/OpenColorIO/FileRules.cpp b/src/OpenColorIO/FileRules.cpp 2 | index 61a5e0f..e0df0d0 100644 3 | --- a/src/OpenColorIO/FileRules.cpp 4 | +++ b/src/OpenColorIO/FileRules.cpp 5 | @@ -62,7 +62,7 @@ std::string ConvertToRegularExpression(const char * globPattern, bool ignoreCase 6 | 7 | if (ignoreCase) 8 | { 9 | - const size_t length = strlen(globPattern); 10 | + const size_t length = std::strlen(globPattern); 11 | bool respectCase = false; 12 | for (size_t i = 0; i < length; ++i) 13 | { -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/patches/2.2.1-0004-bindwin.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/bindings/python/PyUtils.h b/src/bindings/python/PyUtils.h 2 | index e4a525d..2ac48eb 100644 3 | --- a/src/bindings/python/PyUtils.h 4 | +++ b/src/bindings/python/PyUtils.h 5 | @@ -1,6 +1,14 @@ 6 | // SPDX-License-Identifier: BSD-3-Clause 7 | // Copyright Contributors to the OpenColorIO Project. 8 | 9 | +#ifdef _WIN32 10 | + #include 11 | + namespace pybind11 { 12 | + typedef ::SSIZE_T SSIZE_T; 13 | + } 14 | +#endif 15 | + 16 | + 17 | #ifndef INCLUDED_OCIO_PYUTILS_H 18 | #define INCLUDED_OCIO_PYUTILS_H 19 | 20 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "0.21.1": 3 | url: "https://github.com/LibRaw/LibRaw/archive/0.21.1.tar.gz" 4 | sha256: "b63d7ffa43463f74afcc02f9083048c231349b41cc9255dec0840cf8a67b52e0" 5 | "0.21.2": 6 | url: "https://github.com/LibRaw/LibRaw/archive/0.21.2.tar.gz" 7 | sha256: "7ac056e0d9e814d808f6973a950bbf45e71b53283eed07a7ea87117a6c0ced96" 8 | "0.21.3": 9 | url: "https://github.com/LibRaw/LibRaw/archive/0.21.3.tar.gz" 10 | sha256: "dc3d8b54e333d9d5441336049db255d14b27f19bd326a306cf5aea866806780a" 11 | "0.21.4": 12 | url: "https://github.com/LibRaw/LibRaw/archive/0.21.4.tar.gz" 13 | sha256: "8baeb5253c746441fadad62e9c5c43ff4e414e41b0c45d6dcabccb542b2dff4b" 14 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/test_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(test_package LANGUAGES C) 3 | 4 | find_package(BZip2 REQUIRED) 5 | 6 | add_executable(test_package test_package.c) 7 | target_link_libraries(test_package PRIVATE BZip2::BZip2) 8 | 9 | # Test whether variables from https://cmake.org/cmake/help/latest/module/FindBZip2.html are properly defined 10 | set(_custom_vars 11 | BZIP2_FOUND 12 | BZIP2_NEED_PREFIX 13 | BZIP2_INCLUDE_DIRS 14 | BZIP2_INCLUDE_DIR 15 | BZIP2_LIBRARIES 16 | BZIP2_VERSION_STRING 17 | ) 18 | foreach(_custom_var ${_custom_vars}) 19 | if(DEFINED ${_custom_var}) 20 | message(STATUS "${_custom_var}: ${${_custom_var}}") 21 | else() 22 | message(FATAL_ERROR "${_custom_var} not defined") 23 | endif() 24 | endforeach() -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.build import can_run 5 | from conan.tools.cmake import CMake, cmake_layout 6 | 7 | 8 | class LibultrahdrTestConan(ConanFile): 9 | settings = "os", "arch", "compiler", "build_type" 10 | generators = "CMakeDeps", "CMakeToolchain" 11 | 12 | def requirements(self): 13 | self.requires(self.tested_reference_str) 14 | 15 | def layout(self): 16 | cmake_layout(self) 17 | 18 | def build_requirements(self): 19 | self.tool_requires("cmake/[>=3.19 <4]") 20 | 21 | def build(self): 22 | cmake = CMake(self) 23 | cmake.configure() 24 | cmake.build() 25 | 26 | def test(self): 27 | if can_run(self): 28 | cmd = os.path.join(self.cpp.build.bindir, "test_package") 29 | self.run(cmd, env="conanrun") 30 | -------------------------------------------------------------------------------- /oiio_python/tool_wrappers/oiio_tools.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | from pathlib import Path 5 | 6 | HERE = Path(__file__).parent.resolve() 7 | 8 | 9 | def _run_tool(tool_name: str) -> None: 10 | tool_path = HERE / "tools" / tool_name 11 | env = os.environ.copy() 12 | try: 13 | subprocess.run([str(tool_path)] + sys.argv[1:], check=True, env=env) 14 | except subprocess.CalledProcessError as e: 15 | print(f"Error: {tool_name} failed with return code {e.returncode}.") 16 | 17 | 18 | def iconvert() -> None: 19 | _run_tool("iconvert") 20 | 21 | 22 | def idiff() -> None: 23 | _run_tool("idiff") 24 | 25 | 26 | def igrep() -> None: 27 | _run_tool("igrep") 28 | 29 | 30 | def iinfo() -> None: 31 | _run_tool("iinfo") 32 | 33 | 34 | def maketx() -> None: 35 | _run_tool("maketx") 36 | 37 | 38 | def oiiotool() -> None: 39 | _run_tool("oiiotool") 40 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.build import can_run 5 | from conan.tools.cmake import CMake, cmake_layout 6 | 7 | 8 | class TestPackageConan(ConanFile): 9 | settings = "os", "arch", "compiler", "build_type" 10 | generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" 11 | test_type = "explicit" 12 | 13 | def requirements(self): 14 | self.requires(self.tested_reference_str) 15 | 16 | def layout(self): 17 | cmake_layout(self) 18 | 19 | def build_requirements(self): 20 | self.tool_requires("cmake/[>=3.19 <4]") 21 | 22 | def build(self): 23 | cmake = CMake(self) 24 | cmake.configure() 25 | cmake.build() 26 | 27 | def test(self): 28 | if can_run(self): 29 | bin_path = os.path.join(self.cpp.build.bindir, "test_package") 30 | self.run(bin_path, env="conanrun") 31 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.build import can_run 5 | from conan.tools.cmake import CMake, cmake_layout 6 | 7 | 8 | class TestPackageConan(ConanFile): 9 | settings = "os", "arch", "compiler", "build_type" 10 | generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" 11 | test_type = "explicit" 12 | 13 | def requirements(self): 14 | self.requires(self.tested_reference_str) 15 | 16 | def layout(self): 17 | cmake_layout(self) 18 | 19 | def build_requirements(self): 20 | self.tool_requires("cmake/[>=3.19 <4]") 21 | 22 | def build(self): 23 | cmake = CMake(self) 24 | cmake.configure() 25 | cmake.build() 26 | 27 | def test(self): 28 | if can_run(self): 29 | bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") 30 | self.run(bin_path, env="conanrun") 31 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.build import can_run 5 | from conan.tools.cmake import CMake, cmake_layout 6 | 7 | 8 | class TestPackageConan(ConanFile): 9 | settings = "os", "arch", "compiler", "build_type" 10 | generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" 11 | test_type = "explicit" 12 | 13 | def layout(self): 14 | cmake_layout(self) 15 | 16 | def requirements(self): 17 | self.requires(self.tested_reference_str) 18 | 19 | def build_requirements(self): 20 | self.tool_requires("cmake/[>=3.19 <4]") 21 | 22 | def build(self): 23 | cmake = CMake(self) 24 | cmake.configure() 25 | cmake.build() 26 | 27 | def test(self): 28 | if can_run(self): 29 | bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") 30 | self.run(bin_path, env="conanrun") 31 | -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile # type: ignore 4 | from conan.tools.build import can_run # type: ignore 5 | from conan.tools.cmake import CMake, cmake_layout # type: ignore 6 | 7 | 8 | class TestPackageConan(ConanFile): 9 | settings = "os", "arch", "compiler", "build_type" 10 | generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" 11 | test_type = "explicit" 12 | 13 | def requirements(self): 14 | self.requires(self.tested_reference_str) 15 | 16 | def layout(self): 17 | cmake_layout(self) 18 | 19 | def build_requirements(self): 20 | self.tool_requires("cmake/[>=3.19 <4]") 21 | 22 | def build(self): 23 | cmake = CMake(self) 24 | cmake.configure() 25 | cmake.build() 26 | 27 | def test(self): 28 | if can_run(self): 29 | bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") 30 | self.run(bin_path, env="conanrun") 31 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=E1101,C0114,C0115,C0116 2 | 3 | import os 4 | 5 | from conan import ConanFile 6 | from conan.tools.build import can_run 7 | from conan.tools.cmake import CMake, cmake_layout 8 | 9 | 10 | class TestPackageConan(ConanFile): 11 | settings = "os", "arch", "compiler", "build_type" 12 | generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" 13 | test_type = "explicit" 14 | 15 | def requirements(self): 16 | self.requires(self.tested_reference_str) 17 | 18 | def layout(self): 19 | cmake_layout(self) 20 | 21 | def build(self): 22 | cmake = CMake(self) 23 | cmake.configure() 24 | cmake.build() 25 | 26 | def build_requirements(self): 27 | self.tool_requires("cmake/[>=3.19 <4]") 28 | 29 | def test(self): 30 | if can_run(self): 31 | bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") 32 | self.run(bin_path, env="conanrun") 33 | -------------------------------------------------------------------------------- /oiio_python/recipes/openimageio/test_package/conanfile.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=E1101,C0114,C0115,C0116 2 | import os 3 | 4 | from conan import ConanFile 5 | from conan.tools.build import can_run # type: ignore 6 | from conan.tools.cmake import CMake, cmake_layout # type: ignore 7 | 8 | 9 | class TestPackageConan(ConanFile): 10 | settings = "os", "compiler", "build_type", "arch" 11 | generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" 12 | test_type = "explicit" 13 | 14 | def requirements(self): 15 | self.requires(self.tested_reference_str) 16 | 17 | def layout(self): 18 | cmake_layout(self) 19 | 20 | def build_requirements(self): 21 | self.tool_requires("cmake/[>=3.19 <4]") 22 | 23 | def build(self): 24 | cmake = CMake(self) 25 | cmake.configure() 26 | cmake.build() 27 | 28 | def test(self): 29 | if not can_run(self): 30 | bin_path = os.path.join(self.cpp.build.bindir, "test_package") 31 | self.run(bin_path, env="conanrun") 32 | -------------------------------------------------------------------------------- /oiio_python/tool_wrappers/oiio_tools_win.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | from pathlib import Path 5 | 6 | HERE = Path(__file__).parent.resolve() 7 | 8 | 9 | def _run_tool(tool_name: str) -> None: 10 | tool_path = HERE / "tools" / tool_name 11 | oiio_bin_path = HERE 12 | ocio_bin_path = HERE.parent / "PyOpenColorIO" 13 | 14 | env = os.environ.copy() 15 | env["PATH"] = os.environ["PATH"] + os.pathsep + str(ocio_bin_path) + os.pathsep + str(oiio_bin_path) 16 | try: 17 | subprocess.run([str(tool_path)] + sys.argv[1:], check=True, env=env) 18 | except subprocess.CalledProcessError as e: 19 | print(f"Error: {tool_name} failed with return code {e.returncode}.") 20 | 21 | 22 | def iconvert() -> None: 23 | _run_tool("iconvert") 24 | 25 | 26 | def idiff() -> None: 27 | _run_tool("idiff") 28 | 29 | 30 | def igrep() -> None: 31 | _run_tool("igrep") 32 | 33 | 34 | def iinfo() -> None: 35 | _run_tool("iinfo") 36 | 37 | 38 | def maketx() -> None: 39 | _run_tool("maketx") 40 | 41 | 42 | def oiiotool() -> None: 43 | _run_tool("oiiotool") 44 | -------------------------------------------------------------------------------- /.github/workflows/build_linux_wheels.yml: -------------------------------------------------------------------------------- 1 | name: Build Linux Wheels 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build_wheels: 8 | name: Build ${{ matrix.linking }} wheels on ${{ matrix.distrib }} 9 | runs-on: ubuntu-22.04 10 | strategy: 11 | matrix: 12 | distrib: [manylinux, musllinux] 13 | linking: [dynamic, static] 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: Build wheels 19 | uses: pypa/cibuildwheel@v2.23.2 20 | env: 21 | CIBW_ENVIRONMENT_PASS_LINUX: OIIO_STATIC CIBUILDWHEEL MUSLLINUX_BUILD 22 | MUSLLINUX_BUILD: ${{ matrix.distrib == 'musllinux' && '1' || '0' }} 23 | OIIO_STATIC: ${{ matrix.linking == 'static' && '1' || '0' }} 24 | CIBW_BUILD: ${{ matrix.distrib == 'manylinux' && '*manylinux_x86*' || '*musllinux_x86*' }} 25 | 26 | with: 27 | output-dir: wheelhouse 28 | 29 | - uses: actions/upload-artifact@v4 30 | with: 31 | name: cibw-${{ matrix.linking }}-wheels-${{ matrix.distrib }}-${{ strategy.job-index }} 32 | path: ./wheelhouse/*.whl 33 | -------------------------------------------------------------------------------- /.github/workflows/build_linux_aarch64_wheels.yml: -------------------------------------------------------------------------------- 1 | name: Build Linux aarch64 Wheels 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build_wheels: 8 | name: Build ${{ matrix.linking }} wheels on ${{ matrix.distrib }} 9 | runs-on: ubuntu-22.04-arm 10 | strategy: 11 | matrix: 12 | distrib: [manylinux, musllinux] 13 | linking: [dynamic, static] 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: Build wheels 19 | uses: pypa/cibuildwheel@v2.23.2 20 | env: 21 | CIBW_ENVIRONMENT_PASS_LINUX: OIIO_STATIC CIBUILDWHEEL MUSLLINUX_BUILD 22 | MUSLLINUX_BUILD: ${{ matrix.distrib == 'musllinux' && '1' || '0' }} 23 | OIIO_STATIC: ${{ matrix.linking == 'static' && '1' || '0' }} 24 | CIBW_BUILD: ${{ matrix.distrib == 'manylinux' && '*manylinux*' || '*musllinux*' }} 25 | 26 | with: 27 | output-dir: wheelhouse 28 | 29 | - uses: actions/upload-artifact@v4 30 | with: 31 | name: cibw-aarch64-${{ matrix.linking }}-wheels-${{ matrix.distrib }}-${{ strategy.job-index }} 32 | path: ./wheelhouse/*.whl 33 | -------------------------------------------------------------------------------- /licenses/giflib-LICENSE: -------------------------------------------------------------------------------- 1 | The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/patches/4.5.1-0001-cmake-dependencies.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cmake/JPEGCodec.cmake b/cmake/JPEGCodec.cmake 2 | index 8455a3ec..09fe975a 100644 3 | --- a/cmake/JPEGCodec.cmake 4 | +++ b/cmake/JPEGCodec.cmake 5 | @@ -42,25 +42,7 @@ endif() 6 | if (JPEG_SUPPORT) 7 | # Check for jpeg12_read_scanlines() which has been added in libjpeg-turbo 2.2 8 | # for dual 8/12 bit mode. 9 | - include(CheckCSourceCompiles) 10 | - include(CMakePushCheckState) 11 | - cmake_push_check_state(RESET) 12 | - set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}") 13 | - set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}") 14 | - check_c_source_compiles( 15 | - " 16 | - #include 17 | - #include 18 | - #include \"jpeglib.h\" 19 | - int main() 20 | - { 21 | - jpeg_read_scanlines(0,0,0); 22 | - jpeg12_read_scanlines(0,0,0); 23 | - return 0; 24 | - } 25 | - " 26 | - HAVE_JPEGTURBO_DUAL_MODE_8_12) 27 | - cmake_pop_check_state() 28 | + set(HAVE_JPEGTURBO_DUAL_MODE_8_12 FALSE) 29 | endif() 30 | 31 | if (NOT HAVE_JPEGTURBO_DUAL_MODE_8_12) -------------------------------------------------------------------------------- /oiio_python/tool_wrappers/ocio_tools.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | from pathlib import Path 5 | 6 | HERE = Path(__file__).parent.resolve() 7 | 8 | 9 | def _run_tool(tool_name: str) -> None: 10 | tool_path = HERE / "tools" / tool_name 11 | env = os.environ.copy() 12 | try: 13 | subprocess.run([str(tool_path)] + sys.argv[1:], check=True, env=env) 14 | except subprocess.CalledProcessError as e: 15 | print(f"Error: {tool_name} failed with return code {e.returncode}.") 16 | 17 | 18 | def ocioarchive() -> None: 19 | _run_tool("ocioarchive") 20 | 21 | 22 | def ociobakelut() -> None: 23 | _run_tool("ociobakelut") 24 | 25 | 26 | def ociocheck() -> None: 27 | _run_tool("ociocheck") 28 | 29 | 30 | def ociochecklut() -> None: 31 | _run_tool("ociochecklut") 32 | 33 | 34 | def ocioconvert() -> None: 35 | _run_tool("ocioconvert") 36 | 37 | 38 | def ociolutimage() -> None: 39 | _run_tool("ociolutimage") 40 | 41 | 42 | def ociomakeclf() -> None: 43 | _run_tool("ociomakeclf") 44 | 45 | 46 | def ocioperf() -> None: 47 | _run_tool("ocioperf") 48 | 49 | 50 | def ociowrite() -> None: 51 | _run_tool("ociowrite") 52 | -------------------------------------------------------------------------------- /licenses/imath-LICENSE: -------------------------------------------------------------------------------- 1 | IMath is Copyright © 2002-2009 Michael J. Fromberger 2 | You may use it subject to the following Licensing Terms: 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /licenses/libtiff-LICENSE: -------------------------------------------------------------------------------- 1 | # LibTIFF license 2 | 3 | Copyright © 1988-1997 Sam Leffler\ 4 | Copyright © 1991-1997 Silicon Graphics, Inc. 5 | 6 | Permission to use, copy, modify, distribute, and sell this software and 7 | its documentation for any purpose is hereby granted without fee, provided 8 | that (i) the above copyright notices and this permission notice appear in 9 | all copies of the software and related documentation, and (ii) the names of 10 | Sam Leffler and Silicon Graphics may not be used in any advertising or 11 | publicity relating to the software without the specific, prior written 12 | permission of Sam Leffler and Silicon Graphics. 13 | 14 | THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 16 | WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 17 | 18 | IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 19 | ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 20 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 21 | WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 22 | LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 23 | OF THIS SOFTWARE. -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(bzip2 LANGUAGES C) 3 | 4 | include(GNUInstallDirs) 5 | 6 | option(BZ2_BUILD_EXE "Build bzip2 command-line utility" ON) 7 | 8 | add_library( 9 | bz2 10 | ${BZ2_SRC_DIR}/blocksort.c 11 | ${BZ2_SRC_DIR}/bzlib.c 12 | ${BZ2_SRC_DIR}/compress.c 13 | ${BZ2_SRC_DIR}/crctable.c 14 | ${BZ2_SRC_DIR}/decompress.c 15 | ${BZ2_SRC_DIR}/huffman.c 16 | ${BZ2_SRC_DIR}/randtable.c 17 | ) 18 | 19 | target_include_directories(bz2 PUBLIC ${BZ2_SRC_DIR}) 20 | set_target_properties( 21 | bz2 22 | PROPERTIES 23 | PUBLIC_HEADER "${BZ2_SRC_DIR}/bzlib.h" 24 | SOVERSION ${BZ2_VERSION_MAJOR} 25 | VERSION ${BZ2_VERSION_STRING} 26 | WINDOWS_EXPORT_ALL_SYMBOLS ON 27 | ) 28 | 29 | install( 30 | TARGETS bz2 31 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 32 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 33 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 34 | PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 35 | ) 36 | 37 | if(BZ2_BUILD_EXE) 38 | add_executable(bzip2 ${BZ2_SRC_DIR}/bzip2.c) 39 | target_link_libraries(bzip2 PRIVATE bz2) 40 | install(TARGETS bzip2 DESTINATION ${CMAKE_INSTALL_BINDIR}) 41 | endif() -------------------------------------------------------------------------------- /oiio_python/tool_wrappers/ocio_tools_win.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | from pathlib import Path 5 | 6 | HERE = Path(__file__).parent.resolve() 7 | 8 | 9 | def _run_tool(tool_name: str) -> None: 10 | tool_path = HERE / "tools" / tool_name 11 | ocio_bin_path = HERE 12 | env = os.environ.copy() 13 | env["PATH"] = os.environ["PATH"] + os.pathsep + str(ocio_bin_path) 14 | try: 15 | subprocess.run([str(tool_path)] + sys.argv[1:], check=True, env=env) 16 | except subprocess.CalledProcessError as e: 17 | print(f"Error: {tool_name} failed with return code {e.returncode}.") 18 | 19 | 20 | def ocioarchive() -> None: 21 | _run_tool("ocioarchive") 22 | 23 | 24 | def ociobakelut() -> None: 25 | _run_tool("ociobakelut") 26 | 27 | 28 | def ociocheck() -> None: 29 | _run_tool("ociocheck") 30 | 31 | 32 | def ociochecklut() -> None: 33 | _run_tool("ociochecklut") 34 | 35 | 36 | def ocioconvert() -> None: 37 | _run_tool("ocioconvert") 38 | 39 | 40 | def ociolutimage() -> None: 41 | _run_tool("ociolutimage") 42 | 43 | 44 | def ociomakeclf() -> None: 45 | _run_tool("ociomakeclf") 46 | 47 | 48 | def ocioperf() -> None: 49 | _run_tool("ocioperf") 50 | 51 | 52 | def ociowrite() -> None: 53 | _run_tool("ociowrite") 54 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/conan_deps.cmake: -------------------------------------------------------------------------------- 1 | find_package(Brotli REQUIRED CONFIG) 2 | find_package(HWY REQUIRED CONFIG) 3 | find_package(LCMS2 REQUIRED CONFIG) 4 | 5 | # Add wrapper targets for the project to link against 6 | add_library(brotlicommon INTERFACE) 7 | target_link_libraries(brotlicommon INTERFACE brotli::brotli) 8 | set_target_properties(brotlicommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") 9 | set_target_properties(brotlicommon PROPERTIES INCLUDE_DIRECTORIES "${Brotli_INCLUDE_DIRS}") 10 | add_library(brotlidec ALIAS brotlicommon) 11 | add_library(brotlienc ALIAS brotlicommon) 12 | add_library(brotlicommon-static ALIAS brotlicommon) 13 | add_library(brotlidec-static ALIAS brotlicommon) 14 | add_library(brotlienc-static ALIAS brotlicommon) 15 | 16 | add_library(hwy INTERFACE) 17 | target_link_libraries(hwy INTERFACE highway::highway) 18 | set_target_properties(hwy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") 19 | set_target_properties(hwy PROPERTIES INCLUDE_DIRECTORIES "${HWY_INCLUDE_DIRS}") 20 | 21 | add_library(lcms2 INTERFACE) 22 | target_link_libraries(lcms2 INTERFACE lcms::lcms) 23 | set_target_properties(lcms2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") 24 | set_target_properties(lcms2 PROPERTIES INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIRS}") -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | "2.4.0": 3 | url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.4.0.tar.gz" 4 | sha256: "0ff3966b9214da0941b2b1cbdab3975a00a51fc6f3417fa860f98f5358f2c282" 5 | 6 | "2.2.1": 7 | url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/v2.2.1.tar.gz" 8 | sha256: "36f27c5887fc4e5c241805c29b8b8e68725aa05520bcaa7c7ec84c0422b8580e" 9 | 10 | patches: 11 | 12 | "2.4.0": 13 | - patch_file: "patches/2.4.0-0001-fix-cmake-source-dir-and-targets.patch" 14 | patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" 15 | patch_type: "conan" 16 | "2.2.1": 17 | - patch_file: "patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch" 18 | patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" 19 | patch_type: "conan" 20 | - patch_file: "patches/2.2.1-0002-fix-pystring.patch" 21 | patch_description: "fix include path for pystring" 22 | patch_type: "conan" 23 | - patch_file: "patches/2.2.1-0003-strlen.patch" 24 | patch_description: "add std namespace for strlen" 25 | patch_type: "portability" 26 | - patch_file: "patches/2.2.1-0004-bindwin.patch" 27 | patch_description: "Fix Python bindings on Widnows" 28 | patch_type: "portability" 29 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | build-backend = "setuptools.build_meta" 3 | requires = [ 4 | "setuptools>=64", 5 | "wheel", 6 | "conan==2.4.0", 7 | "numpy>=1.21.2,<2.3.0", 8 | ] 9 | 10 | # =======================[ CIBUILDWHEEL ]====================== 11 | 12 | [tool.cibuildwheel] 13 | build-frontend = {name = "build"} 14 | skip = [ 15 | "pp*", # Disable building PyPy wheels on all platforms 16 | "*-win32", # Skip 32-bit builds 17 | "*-manylinux_i686", # Skip 32-bit builds 18 | ] 19 | test-command = "python {project}/test.py" 20 | 21 | 22 | [tool.cibuildwheel.macos] 23 | before-all = [ 24 | "python {project}/setuputils/build_dependencies.py", 25 | ] 26 | repair-wheel-command = [ 27 | "export REPAIR_LIBRARY=$PROJECT_ROOT/oiio_python/libs:$DYLD_LIBRARY_PATH", 28 | "DYLD_LIBRARY_PATH=$REPAIR_LIBRARY delocate-wheel -w {dest_dir} -v {wheel} -e \"$HOME/.conan2\"", 29 | ] 30 | 31 | [tool.cibuildwheel.linux] 32 | before-all = [ 33 | "chmod +x {project}/setuputils/linux_before_all.sh", 34 | "bash {project}/setuputils/linux_before_all.sh", 35 | "python {project}/setuputils/build_dependencies.py", 36 | ] 37 | repair-wheel-command = [ 38 | "export LD_LIBRARY_PATH=/project/oiio_python/libs:$LD_LIBRARY_PATH", 39 | "auditwheel repair -w {dest_dir} {wheel}", 40 | ] 41 | 42 | [tool.cibuildwheel.windows] 43 | before-all = [ 44 | "python {project}/setuputils/build_dependencies.py", 45 | ] -------------------------------------------------------------------------------- /setuputils/linux_before_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | # Function to install packages in a manylinux environment 7 | install_manylinux() { 8 | echo "Detected manylinux environment" 9 | # Install packages using yum 10 | # Perl required to build OpenSSL 11 | yum install -y perl-core perl-devel libatomic devtoolset-10-libatomic-devel 12 | # Install cpanminus manually 13 | curl -L https://cpanmin.us | perl - App::cpanminus 14 | # Update Perl List::Util module using cpan 15 | cpanm List::Util 16 | } 17 | 18 | # Function to install packages in a musl-linux environment (e.g., Alpine) 19 | install_musllinux() { 20 | echo "Detected musl-linux environment" 21 | # Install packages using apk 22 | apk add --no-cache perl perl-dev 23 | # Configure cpan to be non-interactive 24 | echo 'o conf init / no' | cpan 25 | echo 'o conf commit' | cpan 26 | # Update Perl List::Util module using cpan 27 | cpan -fi List::Util 28 | # Add libatomic 29 | apk add --no-cache libatomic libatomic_ops-dev libatomic_ops-static 30 | apk add --no-cache ninja ninja-build 31 | } 32 | 33 | # Detect the environment: Check for presence of apk or yum 34 | if command -v apk >/dev/null 2>&1; then 35 | install_musllinux 36 | elif command -v yum >/dev/null 2>&1; then 37 | install_manylinux 38 | else 39 | echo "Unsupported Linux distribution" 40 | exit 1 41 | fi 42 | -------------------------------------------------------------------------------- /licenses/openexr-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Contributors to the OpenEXR Project. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /licenses/fmt-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. -------------------------------------------------------------------------------- /licenses/opencolorio-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Contributors to the OpenColorIO Project. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the copyright holder nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /licenses/hdf5-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright ©2013 The Gonum Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | * Redistributions of source code must retain the above copyright 6 | notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | * Neither the name of the Gonum project nor the names of its authors and 11 | contributors may be used to endorse or promote products derived from this 12 | software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /licenses/libwebp-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Google Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google nor the names of its contributors may 16 | be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /licenses/pystring-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-present Contributors to the Pystring project. 2 | All Rights Reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | 4 | import numpy as np 5 | import OpenImageIO as oiio 6 | import PyOpenColorIO as ocio 7 | 8 | 9 | def test_tools(): 10 | tools = [ 11 | ["iconvert", "--help"], 12 | ["idiff", "--help"], 13 | ["igrep", "--help"], 14 | ["iinfo", "--help"], 15 | ["maketx", "--help"], 16 | ["oiiotool", "--help"], 17 | ["ocioarchive", "--h"], 18 | ["ociobakelut", "--h"], 19 | ["ociocheck", "--h"], 20 | ["ociochecklut", "--h"], 21 | ["ocioconvert", "--h"], 22 | ["ociolutimage", "--h"], 23 | ["ociomakeclf", "--h"], 24 | ["ocioperf", "--h"], 25 | ["ociowrite", "--v"], 26 | ] 27 | 28 | for tool in tools: 29 | subprocess.run(tool, check=True) 30 | 31 | 32 | def test_numpy(): 33 | rand_img = np.random.rand(128, 128, 3).astype(np.float32) 34 | buf = oiio.ImageBuf(rand_img) 35 | pixels = buf.get_pixels(oiio.FLOAT, oiio.ROI(0, 128, 0, 128, 0, 1)) 36 | assert np.allclose(pixels, rand_img) 37 | buf = oiio.ImageBuf(pixels) 38 | 39 | 40 | def main(): 41 | # Test tools 42 | if os.getenv("OIIO_STATIC") != "1": 43 | test_tools() 44 | 45 | test_numpy() 46 | 47 | config = ocio.GetCurrentConfig() 48 | print("Config: ", config) 49 | colorSpaceNames = [cs.getName() for cs in config.getColorSpaces()] 50 | print("Color Spaces: ", colorSpaceNames) 51 | 52 | # Print version 53 | print("OpenImageIO Version: ", oiio.__version__) 54 | print("OpenColorIO Version: ", ocio.__version__) 55 | 56 | 57 | if __name__ == "__main__": 58 | main() 59 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # Include specific file types from all subdirectories of 'oiio_python' 2 | recursive-include oiio_python *.py *.txt *.cpp *.yml *.patch *.md 3 | recursive-include setuputils *.py 4 | include test.py 5 | 6 | # Add a license file explicitly 7 | include LICENSE 8 | include LICENSE-GPL 9 | recursive-include licenses * 10 | 11 | 12 | # Include specific file types from all subdirectories of 'oiio_python' 13 | recursive-include oiio_python *.py *.txt *.cpp *.yml *.patch *.md 14 | 15 | # Explicitly include files and subdirectories under OpenImageIO and PyOpenColorIO 16 | recursive-exclude oiio_python/OpenImageIO * 17 | recursive-exclude oiio_python/PyOpenColorIO * 18 | 19 | # Include tools and licenses directories under OpenImageIO and PyOpenColorIO 20 | recursive-exclude oiio_python/OpenImageIO/tools * 21 | recursive-exclude oiio_python/OpenImageIO/licenses * 22 | recursive-exclude oiio_python/PyOpenColorIO/tools * 23 | recursive-exclude oiio_python/PyOpenColorIO/licenses * 24 | 25 | # Exclude specific directories and files 26 | recursive-exclude oiio_python/recipes/dependencies/libraw/src 27 | recursive-exclude oiio_python/recipes/dependencies/libraw/build 28 | recursive-exclude oiio_python/recipes/dependencies/libraw/test_package/build 29 | 30 | recursive-exclude oiio_python/recipes/dependencies/opencolorio/src 31 | recursive-exclude oiio_python/recipes/dependencies/opencolorio/build 32 | recursive-exclude oiio_python/recipes/dependencies/opencolorio/test_package/build 33 | 34 | recursive-exclude oiio_python/recipes/openimageio/src 35 | recursive-exclude oiio_python/recipes/openimageio/build 36 | recursive-exclude oiio_python/recipes/openimageio/test_package/build 37 | -------------------------------------------------------------------------------- /licenses/ptex-LICENSE: -------------------------------------------------------------------------------- 1 | PTEX SOFTWARE 2 | Copyright 2014 Disney Enterprises, Inc. All rights reserved 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in 13 | the documentation and/or other materials provided with the 14 | distribution. 15 | 16 | * The names "Disney", "Walt Disney Pictures", "Walt Disney Animation 17 | Studios" or the names of its contributors may NOT be used to 18 | endorse or promote products derived from this software without 19 | specific prior written permission from Walt Disney Pictures. 20 | 21 | Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND 22 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 23 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 24 | FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED. 25 | IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR 26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -------------------------------------------------------------------------------- /licenses/pybind11-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Wenzel Jakob , All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | 3. Neither the name of the copyright holder nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of 29 | external contributions to this project including patches, pull requests, etc. -------------------------------------------------------------------------------- /.github/workflows/build_wheels.yml: -------------------------------------------------------------------------------- 1 | name: Build Multiplatform Wheels 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build_wheels: 8 | name: Build wheels on ${{ matrix.os }} 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | matrix: 12 | # macos-13 is an intel runner, macos-14 is apple silicon 13 | os: [windows-latest, macos-13, macos-14] 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | # By default, Python 3.8 is not ARM64 compatible on macOS 19 | - name: Set up Python 3.8 on macOS arm64 20 | if: runner.os == 'macOS' && matrix.os == 'macos-14' 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: 3.8 24 | 25 | - name: Set MACOSX_DEPLOYMENT_TARGET for macOS x86_64 26 | if: runner.os == 'macOS' && matrix.os == 'macos-13' 27 | run: | 28 | echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV 29 | echo "CIBW_PLATFORM=macos" >> $GITHUB_ENV 30 | 31 | - name: Set MACOSX_DEPLOYMENT_TARGET for macOS arm64 32 | if: runner.os == 'macOS' && matrix.os == 'macos-14' 33 | run: | 34 | echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV 35 | echo "CIBW_PLATFORM=macos" >> $GITHUB_ENV 36 | 37 | - name: Set CIBW_PLATFORM for Windows 38 | if: runner.os == 'Windows' 39 | run: echo "CIBW_PLATFORM=windows" >> $GITHUB_ENV 40 | 41 | - name: Build wheels 42 | uses: pypa/cibuildwheel@v2.23.3 43 | env: 44 | MACOSX_DEPLOYMENT_TARGET: ${{ env.MACOSX_DEPLOYMENT_TARGET }} 45 | CIBW_PLATFORM: ${{ env.CIBW_PLATFORM }} 46 | PROJECT_ROOT: ${{ github.workspace }} 47 | with: 48 | output-dir: wheelhouse 49 | 50 | - uses: actions/upload-artifact@v4 51 | with: 52 | name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} 53 | path: ./wheelhouse/*.whl 54 | -------------------------------------------------------------------------------- /.github/workflows/build_static_wheels.yml: -------------------------------------------------------------------------------- 1 | name: Build Static Multiplatform Wheels 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build_wheels: 8 | name: Build wheels on ${{ matrix.os }} 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | matrix: 12 | # macos-13 is an intel runner, macos-14 is apple silicon 13 | os: [windows-latest, macos-13, macos-14] 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | # By default, Python 3.8 is not ARM64 compatible on macOS 19 | - name: Set up Python 3.8 on macOS arm64 20 | if: runner.os == 'macOS' && matrix.os == 'macos-14' 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: 3.8 24 | 25 | - name: Set MACOSX_DEPLOYMENT_TARGET for macOS x86_64 26 | if: runner.os == 'macOS' && matrix.os == 'macos-13' 27 | run: | 28 | echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV 29 | echo "CIBW_PLATFORM=macos" >> $GITHUB_ENV 30 | 31 | - name: Set MACOSX_DEPLOYMENT_TARGET for macOS arm64 32 | if: runner.os == 'macOS' && matrix.os == 'macos-14' 33 | run: | 34 | echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV 35 | echo "CIBW_PLATFORM=macos" >> $GITHUB_ENV 36 | 37 | - name: Set CIBW_PLATFORM for Windows 38 | if: runner.os == 'Windows' 39 | run: echo "CIBW_PLATFORM=windows" >> $GITHUB_ENV 40 | 41 | - name: Build wheels 42 | uses: pypa/cibuildwheel@v2.23.3 43 | env: 44 | MACOSX_DEPLOYMENT_TARGET: ${{ env.MACOSX_DEPLOYMENT_TARGET }} 45 | CIBW_PLATFORM: ${{ env.CIBW_PLATFORM }} 46 | PROJECT_ROOT: ${{ github.workspace }} 47 | OIIO_STATIC: 1 48 | CIBW_ENVIRONMENT: OIIO_STATIC=1 49 | with: 50 | output-dir: wheelhouse 51 | 52 | - uses: actions/upload-artifact@v4 53 | with: 54 | name: cibw-static-wheels-${{ matrix.os }}-${{ strategy.job-index }} 55 | path: ./wheelhouse/*.whl 56 | -------------------------------------------------------------------------------- /licenses/freetype-LICENSE: -------------------------------------------------------------------------------- 1 | FREETYPE LICENSES 2 | ----------------- 3 | 4 | The FreeType 2 font engine is copyrighted work and cannot be used 5 | legally without a software license. In order to make this project 6 | usable to a vast majority of developers, we distribute it under two 7 | mutually exclusive open-source licenses. 8 | 9 | This means that *you* must choose *one* of the two licenses described 10 | below, then obey all its terms and conditions when using FreeType 2 in 11 | any of your projects or products. 12 | 13 | - The FreeType License, found in the file `docs/FTL.TXT`, which is 14 | similar to the original BSD license *with* an advertising clause 15 | that forces you to explicitly cite the FreeType project in your 16 | product's documentation. All details are in the license file. 17 | This license is suited to products which don't use the GNU General 18 | Public License. 19 | 20 | Note that this license is compatible to the GNU General Public 21 | License version 3, but not version 2. 22 | 23 | - The GNU General Public License version 2, found in 24 | `docs/GPLv2.TXT` (any later version can be used also), for 25 | programs which already use the GPL. Note that the FTL is 26 | incompatible with GPLv2 due to its advertisement clause. 27 | 28 | The contributed BDF and PCF drivers come with a license similar to 29 | that of the X Window System. It is compatible to the above two 30 | licenses (see files `src/bdf/README` and `src/pcf/README`). The same 31 | holds for the source code files `src/base/fthash.c` and 32 | `include/freetype/internal/fthash.h`; they were part of the BDF driver 33 | in earlier FreeType versions. 34 | 35 | The gzip module uses the zlib license (see `src/gzip/zlib.h`) which 36 | too is compatible to the above two licenses. 37 | 38 | The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code 39 | taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses 40 | the 'Old MIT' license, compatible to the above two licenses. 41 | 42 | The MD5 checksum support (only used for debugging in development 43 | builds) is in the public domain. 44 | 45 | 46 | --- end of LICENSE.TXT --- -------------------------------------------------------------------------------- /licenses/openjpeg-LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * The copyright in this software is being made available under the 2-clauses 3 | * BSD License, included below. This software may be subject to other third 4 | * party and contributor rights, including patent rights, and no such rights 5 | * are granted under this license. 6 | * 7 | * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium 8 | * Copyright (c) 2002-2014, Professor Benoit Macq 9 | * Copyright (c) 2003-2014, Antonin Descampe 10 | * Copyright (c) 2003-2009, Francois-Olivier Devaux 11 | * Copyright (c) 2005, Herve Drolon, FreeImage Team 12 | * Copyright (c) 2002-2003, Yannick Verschueren 13 | * Copyright (c) 2001-2003, David Janssens 14 | * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France 15 | * Copyright (c) 2012, CS Systemes d'Information, France 16 | * 17 | * All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions 21 | * are met: 22 | * 1. Redistributions of source code must retain the above copyright 23 | * notice, this list of conditions and the following disclaimer. 24 | * 2. Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in the 26 | * documentation and/or other materials provided with the distribution. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' 29 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 34 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 36 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 37 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | */ -------------------------------------------------------------------------------- /oiio_python/recipes/openimageio/conandata.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | 3.0.10.0: 3 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.10.0.tar.gz 4 | sha256: c424637af66fc6d04f202156c3f7cf4a5484ccbe07966d3d8a1fde27c7472721 5 | 3.0.8.1: 6 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.8.1.tar.gz 7 | sha256: 1b9b0d27e802243c1aa490b951580d10e8be645459f8080bfa0ed6f213e1082a 8 | 3.0.7.0: 9 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.7.0.tar.gz 10 | sha256: 2798e398b6ffd836ba7810e8ea510902a4aabc4a373ca0523a3f0d830c5eb103 11 | 3.0.6.0: 12 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.6.0.tar.gz 13 | sha256: 670f8753d5604beb4a17e5279fb1948fa978bc72d8e0991103ddbbfea54df1b5 14 | 3.0.4.0: 15 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.4.0.tar.gz 16 | sha256: dd481071d532c1ab38242011bb7af16f6ec7d915c58cada9fb78ed72b402ebc5 17 | 3.0.2.0: 18 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.2.0.tar.gz 19 | sha256: 93f8bb261dada2458de6c690e730d3e5dfd3cda44fc2e76cff2dc4cf1ecb05ff 20 | 3.0.1.0: 21 | url: https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.1.0.tar.gz 22 | sha256: 7f84c2b9c13be74c4a187fefe3844b391374ba329aa63fbbca21fa232e43c87b 23 | patches: 24 | 3.0.10.0: 25 | - patch_file: patches/3.0.10.0-001-fix-conan-build.patch 26 | patch_description: Fix build with Conan 27 | patch_type: conan 28 | 3.0.8.1: 29 | - patch_file: patches/3.0.8.1-001-fix-conan-build.patch 30 | patch_description: Fix build with Conan 31 | patch_type: conan 32 | 3.0.7.0: 33 | - patch_file: patches/3.0.7.0-001-fix-conan-build.patch 34 | patch_description: Fix build with Conan 35 | patch_type: conan 36 | 3.0.6.0: 37 | - patch_file: patches/3.0.6.0-001-fix-conan-build.patch 38 | patch_description: Fix build with Conan 39 | patch_type: conan 40 | 3.0.4.0: 41 | - patch_file: patches/3.0.4.0-001-fix-conan-build.patch 42 | patch_description: Fix build with Conan 43 | patch_type: conan 44 | 3.0.2.0: 45 | - patch_file: patches/3.0.2.0-001-fix-conan-build.patch 46 | patch_description: Fix build with Conan 47 | patch_type: conan 48 | 3.0.1.0: 49 | - patch_file: patches/3.0.1.0-001-fix-conan-build.patch 50 | patch_description: Fix build with Conan 51 | patch_type: conan 52 | 53 | -------------------------------------------------------------------------------- /setuputils/build_dependencies.py: -------------------------------------------------------------------------------- 1 | """Build script for installing and building dependencies using Conan.""" 2 | 3 | import os 4 | import platform 5 | import subprocess 6 | import sys 7 | from pathlib import Path 8 | 9 | project = Path(__file__).parent.parent.resolve() 10 | sys.path.insert(0, project.as_posix()) 11 | 12 | from setuputils.build_utils import build_cleanup # pylint: disable=C0413 13 | from setuputils.build_utils import conan_install_package, conan_profile_ensure 14 | 15 | os.environ["CONAN_CMAKE_TOOLCHAIN_ARGS"] = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" 16 | 17 | 18 | def build_dependencies() -> None: 19 | """Build all required dependencies using Conan with appropriate profile.""" 20 | if platform.system() == "Windows": 21 | conan_profile_ensure(cpp_std="17") 22 | else: 23 | conan_profile_ensure(cpp_std="gnu17") 24 | 25 | profile_name = "default_oiio_build" 26 | 27 | # LibRaw 28 | libraw_dep_dir = project / "oiio_python" / "recipes" / "dependencies" / "libraw" 29 | libraw_version = "0.21.4" 30 | conan_install_package(libraw_dep_dir, libraw_version, profile=profile_name) 31 | build_cleanup(libraw_dep_dir) 32 | 33 | # LibTiff 34 | libtiff_dep_dir = project / "oiio_python" / "recipes" / "dependencies" / "libtiff" 35 | libtiff_version = "4.7.0" 36 | conan_install_package(libtiff_dep_dir, libtiff_version, profile=profile_name) 37 | build_cleanup(libtiff_dep_dir) 38 | 39 | # Libultrahdr 40 | libuhdr_dep_dir = project / "oiio_python" / "recipes" / "dependencies" / "libuhdr" 41 | libuhdr_version = "1.3.0" 42 | conan_install_package(libuhdr_dep_dir, libuhdr_version, profile=profile_name) 43 | build_cleanup(libuhdr_dep_dir) 44 | 45 | # libjxl 46 | libuhdr_dep_dir = project / "oiio_python" / "recipes" / "dependencies" / "libjxl" 47 | libuhdr_version = "0.10.2" 48 | conan_install_package(libuhdr_dep_dir, libuhdr_version, profile=profile_name) 49 | build_cleanup(libuhdr_dep_dir) 50 | 51 | # bzip2 on linux 52 | if platform.system() == "Linux": 53 | bzip2_dep_dir = project / "oiio_python" / "recipes" / "dependencies" / "bzip2" 54 | bzip2_version = "1.0.8" 55 | conan_install_package(bzip2_dep_dir, bzip2_version, profile=profile_name) 56 | build_cleanup(bzip2_dep_dir) 57 | 58 | 59 | def _main() -> None: 60 | python_exe = sys.executable 61 | cmd = [python_exe, "-m", "pip", "install", "conan==2.4.0"] 62 | subprocess.run(cmd, check=True) 63 | build_dependencies() 64 | 65 | 66 | if __name__ == "__main__": 67 | _main() 68 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(LibRaw LANGUAGES CXX) 3 | 4 | option(LIBRAW_BUILD_THREAD_SAFE "Build raw_r library with -pthread enabled" OFF) 5 | option(LIBRAW_WITH_JPEG "Build with libjpeg" ON) 6 | option(LIBRAW_WITH_LCMS "Build with LCMS" ON) 7 | option(LIBRAW_WITH_JASPER "Build with Jasper" ON) 8 | 9 | if(RAW_LIB_VERSION_STRING VERSION_LESS 0.21) 10 | set(libraw_LIB_SRCS ${LIBRAW_SRC_DIR}/internal/dcraw_common.cpp 11 | ${LIBRAW_SRC_DIR}/internal/dcraw_fileio.cpp 12 | ${LIBRAW_SRC_DIR}/internal/demosaic_packs.cpp 13 | ${LIBRAW_SRC_DIR}/src/libraw_cxx.cpp 14 | ${LIBRAW_SRC_DIR}/src/libraw_c_api.cpp 15 | ${LIBRAW_SRC_DIR}/src/libraw_datastream.cpp 16 | ) 17 | else() 18 | file(GLOB_RECURSE libraw_LIB_SRCS CONFIGURE_DEPENDS "${LIBRAW_SRC_DIR}/src/*.cpp") 19 | 20 | # Exclude placeholder (stub) implementations 21 | file(GLOB_RECURSE exclude_libraw_LIB_SRCS CONFIGURE_DEPENDS "${LIBRAW_SRC_DIR}/src/*_ph.cpp") 22 | list(REMOVE_ITEM libraw_LIB_SRCS ${exclude_libraw_LIB_SRCS}) 23 | endif() 24 | 25 | if(LIBRAW_WITH_JPEG) 26 | find_package(JPEG REQUIRED) 27 | endif() 28 | if(LIBRAW_WITH_LCMS) 29 | find_package(lcms REQUIRED CONFIG) 30 | endif() 31 | if(LIBRAW_WITH_JASPER) 32 | find_package(Jasper REQUIRED) 33 | endif() 34 | 35 | add_library(raw ${libraw_LIB_SRCS}) 36 | target_compile_features(raw PUBLIC cxx_std_11) 37 | target_include_directories(raw PUBLIC "${LIBRAW_SRC_DIR}") 38 | if(WIN32) 39 | target_link_libraries(raw PUBLIC ws2_32) 40 | if(BUILD_SHARED_LIBS) 41 | target_compile_definitions(raw PUBLIC LIBRAW_BUILDLIB) 42 | else() 43 | target_compile_definitions(raw PUBLIC LIBRAW_NODLL) 44 | endif() 45 | endif() 46 | if(MSVC) 47 | target_compile_options(raw PUBLIC /wd4018 /wd4101 /wd4244 /wd4251 /wd4267 /wd4996) 48 | endif() 49 | if(LIBRAW_WITH_JPEG) 50 | target_compile_definitions(raw PUBLIC USE_JPEG USE_JPEG8) 51 | target_link_libraries(raw PUBLIC JPEG::JPEG) 52 | endif () 53 | if (LIBRAW_WITH_LCMS) 54 | target_compile_definitions(raw PUBLIC USE_LCMS2) 55 | target_link_libraries(raw PUBLIC lcms::lcms) 56 | endif () 57 | if (LIBRAW_WITH_JASPER) 58 | target_compile_definitions(raw PUBLIC USE_JASPER) 59 | target_link_libraries(raw PUBLIC Jasper::Jasper) 60 | endif () 61 | 62 | include(GNUInstallDirs) 63 | if(LIBRAW_BUILD_THREAD_SAFE) 64 | add_library(raw_r ${libraw_LIB_SRCS}) 65 | target_link_libraries(raw_r INTERFACE raw) 66 | target_compile_options(raw_r PRIVATE -pthread) 67 | target_link_options(raw_r PRIVATE -pthread) 68 | target_include_directories(raw_r PUBLIC "${LIBRAW_SRC_DIR}") 69 | install( 70 | TARGETS raw_r 71 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 72 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 73 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 74 | ) 75 | endif() 76 | 77 | install(DIRECTORY "${LIBRAW_SRC_DIR}/libraw" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 78 | install( 79 | TARGETS raw 80 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 81 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 82 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 83 | ) -------------------------------------------------------------------------------- /setuputils/build_packages.py: -------------------------------------------------------------------------------- 1 | """Build script for OpenImageIO and OpenColorIO Python packages.""" 2 | 3 | import os 4 | import platform 5 | import shutil 6 | from pathlib import Path 7 | 8 | from setuputils.build_utils import ( 9 | build_cleanup, 10 | conan_install_package, 11 | conan_profile_ensure, 12 | ) 13 | 14 | project = Path(__file__).parent.parent.resolve() 15 | 16 | 17 | def build_packages(build_static_version: bool = False) -> None: 18 | """Build OpenImageIO and OpenColorIO packages using conan.""" 19 | 20 | if platform.system() == "Windows": 21 | conan_profile_ensure(cpp_std="17") 22 | else: 23 | conan_profile_ensure(cpp_std="gnu17") 24 | 25 | profile_name = "default_oiio_build" 26 | 27 | ocio_pkg_dir = project / "oiio_python" / "PyOpenColorIO" 28 | oiio_pkg_dir = project / "oiio_python" / "OpenImageIO" 29 | 30 | for package_dir in [ocio_pkg_dir, oiio_pkg_dir]: 31 | if package_dir.exists(): 32 | shutil.rmtree(package_dir) 33 | package_dir.mkdir() 34 | 35 | libs_dir = project / "oiio_python" / "libs" 36 | if libs_dir.exists(): 37 | shutil.rmtree(libs_dir) 38 | libs_dir.mkdir() 39 | 40 | os.environ["OCIO_PKG_DIR"] = ocio_pkg_dir.as_posix() 41 | os.environ["OIIO_PKG_DIR"] = oiio_pkg_dir.as_posix() 42 | os.environ["OIIO_LIBS_DIR"] = libs_dir.as_posix() 43 | 44 | # OpenColorIO 45 | ocio_dep_dir = project / "oiio_python" / "recipes" / "opencolorio" 46 | ocio_version = "2.4.0" 47 | conan_install_package(ocio_dep_dir, ocio_version, profile=profile_name) 48 | build_cleanup(ocio_dep_dir) 49 | 50 | # OpenImageIO 51 | oiio_dir = project / "oiio_python" / "recipes" / "openimageio" 52 | oiio_version = "3.0.10.0" 53 | conan_install_package(oiio_dir, oiio_version, profile=profile_name) 54 | build_cleanup(oiio_dir) 55 | 56 | # Clean loaders 57 | loaders_dir = project / "oiio_python" / "loaders" 58 | if (oiio_pkg_dir / "__init__.py").exists(): 59 | os.remove(oiio_pkg_dir / "__init__.py") 60 | 61 | if (ocio_pkg_dir / "__init__.py").exists(): 62 | os.remove(ocio_pkg_dir / "__init__.py") 63 | # Copy loaders 64 | if platform.system() == "Windows": 65 | shutil.copyfile( 66 | loaders_dir / "ocio_loader_win.py", ocio_pkg_dir / "__init__.py" 67 | ) 68 | shutil.copyfile( 69 | loaders_dir / "oiio_loader_win.py", oiio_pkg_dir / "__init__.py" 70 | ) 71 | else: 72 | shutil.copyfile(loaders_dir / "ocio_loader.py", ocio_pkg_dir / "__init__.py") 73 | shutil.copyfile(loaders_dir / "oiio_loader.py", oiio_pkg_dir / "__init__.py") 74 | 75 | if not build_static_version: 76 | # Copy tool wrappers 77 | wrappers_dir = project / "oiio_python" / "tool_wrappers" 78 | if platform.system() == "Windows": 79 | shutil.copyfile( 80 | wrappers_dir / "oiio_tools_win.py", oiio_pkg_dir / "_tool_wrapper.py" 81 | ) 82 | shutil.copyfile( 83 | wrappers_dir / "ocio_tools_win.py", ocio_pkg_dir / "_tool_wrapper.py" 84 | ) 85 | else: 86 | shutil.copyfile( 87 | wrappers_dir / "oiio_tools.py", oiio_pkg_dir / "_tool_wrapper.py" 88 | ) 89 | shutil.copyfile( 90 | wrappers_dir / "ocio_tools.py", ocio_pkg_dir / "_tool_wrapper.py" 91 | ) 92 | -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 17e188d..91af0ec 100755 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -332,7 +332,7 @@ install( 6 | FILE ${OCIO_TARGETS_EXPORT_NAME} 7 | ) 8 | 9 | -if (NOT BUILD_SHARED_LIBS) 10 | +if (0) 11 | # Install custom macros used in the find modules. 12 | install(FILES 13 | ${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake 14 | diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake 15 | index 5455a08..eb91a37 100644 16 | --- a/share/cmake/modules/FindExtPackages.cmake 17 | +++ b/share/cmake/modules/FindExtPackages.cmake 18 | @@ -138,7 +138,7 @@ endif() 19 | 20 | # minizip-ng 21 | # https://github.com/zlib-ng/minizip-ng 22 | -find_package(minizip-ng 3.0.7 REQUIRED) 23 | +find_package(minizip 3.0.7 REQUIRED) 24 | 25 | if(OCIO_BUILD_APPS) 26 | 27 | @@ -149,7 +149,7 @@ if(OCIO_BUILD_APPS) 28 | 29 | # lcms2 30 | # https://github.com/mm2/Little-CMS 31 | - find_package(lcms2 2.2 REQUIRED) 32 | + find_package(lcms 2.2 REQUIRED) 33 | endif() 34 | 35 | if(OCIO_BUILD_OPENFX) 36 | @@ -214,7 +214,7 @@ if(OCIO_BUILD_APPS) 37 | # OpenEXR 38 | # https://github.com/AcademySoftwareFoundation/openexr 39 | set(_OpenEXR_ExternalProject_VERSION "3.1.5") 40 | - find_package(OpenEXR 3.0) 41 | + find_package(OpenEXR CONFIG) 42 | 43 | if(OpenEXR_FOUND AND TARGET OpenEXR::OpenEXR) 44 | add_library(OpenColorIO::ImageIOBackend ALIAS OpenEXR::OpenEXR) 45 | diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake 46 | index 175d89c..2d34a65 100644 47 | --- a/share/cmake/utils/CppVersion.cmake 48 | +++ b/share/cmake/utils/CppVersion.cmake 49 | @@ -16,8 +16,6 @@ elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) 50 | "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") 51 | endif() 52 | 53 | -set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") 54 | - 55 | include(CheckCXXCompilerFlag) 56 | 57 | # As CheckCXXCompilerFlag implicitly uses CMAKE_CXX_FLAGS some custom flags could trigger unrelated 58 | diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt 59 | index 1c4d774..da70227 100755 60 | --- a/src/OpenColorIO/CMakeLists.txt 61 | +++ b/src/OpenColorIO/CMakeLists.txt 62 | @@ -289,7 +289,7 @@ target_link_libraries(OpenColorIO 63 | "$" 64 | "$" 65 | yaml-cpp 66 | - MINIZIP::minizip-ng 67 | + MINIZIP::minizip 68 | ) 69 | 70 | if(APPLE) 71 | diff --git a/src/apps/ocioarchive/CMakeLists.txt b/src/apps/ocioarchive/CMakeLists.txt 72 | index 6b868d1..820e36c 100644 73 | --- a/src/apps/ocioarchive/CMakeLists.txt 74 | +++ b/src/apps/ocioarchive/CMakeLists.txt 75 | @@ -19,7 +19,7 @@ target_link_libraries(ocioarchive 76 | PRIVATE 77 | apputils 78 | OpenColorIO 79 | - MINIZIP::minizip-ng 80 | + MINIZIP::minizip 81 | ) 82 | 83 | install(TARGETS ocioarchive 84 | diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt 85 | index a50e87e..37174ea 100755 86 | --- a/src/apps/ociobakelut/CMakeLists.txt 87 | +++ b/src/apps/ociobakelut/CMakeLists.txt 88 | @@ -28,7 +28,7 @@ set_target_properties(ociobakelut 89 | target_link_libraries(ociobakelut 90 | PRIVATE 91 | apputils 92 | - lcms2::lcms2 93 | + lcms::lcms 94 | OpenColorIO 95 | ) 96 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project specific 2 | package/ 3 | oiio_python/libs/ 4 | oiio_python/OpenImageIO/* 5 | oiio_python/PyOpenColorIO/* 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *$py.class 11 | 12 | # C extensions 13 | *.so 14 | 15 | # Distribution / packaging 16 | .Python 17 | build/ 18 | develop-eggs/ 19 | dist/ 20 | downloads/ 21 | eggs/ 22 | .eggs/ 23 | lib/ 24 | lib64/ 25 | parts/ 26 | sdist/ 27 | var/ 28 | wheels/ 29 | share/python-wheels/ 30 | *.egg-info/ 31 | .installed.cfg 32 | *.egg 33 | MANIFEST 34 | 35 | # PyInstaller 36 | # Usually these files are written by a python script from a template 37 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 38 | *.manifest 39 | *.spec 40 | 41 | # Installer logs 42 | pip-log.txt 43 | pip-delete-this-directory.txt 44 | 45 | # Unit test / coverage reports 46 | htmlcov/ 47 | .tox/ 48 | .nox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | *.py,cover 56 | .hypothesis/ 57 | .pytest_cache/ 58 | cover/ 59 | 60 | # Translations 61 | *.mo 62 | *.pot 63 | 64 | # Django stuff: 65 | *.log 66 | local_settings.py 67 | db.sqlite3 68 | db.sqlite3-journal 69 | 70 | # Flask stuff: 71 | instance/ 72 | .webassets-cache 73 | 74 | # Scrapy stuff: 75 | .scrapy 76 | 77 | # Sphinx documentation 78 | docs/_build/ 79 | 80 | # PyBuilder 81 | .pybuilder/ 82 | target/ 83 | 84 | # Jupyter Notebook 85 | .ipynb_checkpoints 86 | 87 | # IPython 88 | profile_default/ 89 | ipython_config.py 90 | 91 | # pyenv 92 | # For a library or package, you might want to ignore these files since the code is 93 | # intended to run in multiple environments; otherwise, check them in: 94 | # .python-version 95 | 96 | # pipenv 97 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 98 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 99 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 100 | # install all needed dependencies. 101 | #Pipfile.lock 102 | 103 | # poetry 104 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 105 | # This is especially recommended for binary packages to ensure reproducibility, and is more 106 | # commonly ignored for libraries. 107 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 108 | #poetry.lock 109 | 110 | # pdm 111 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 112 | #pdm.lock 113 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 114 | # in version control. 115 | # https://pdm.fming.dev/#use-with-ide 116 | .pdm.toml 117 | 118 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 119 | __pypackages__/ 120 | 121 | # Celery stuff 122 | celerybeat-schedule 123 | celerybeat.pid 124 | 125 | # SageMath parsed files 126 | *.sage.py 127 | 128 | # Environments 129 | .env 130 | .venv 131 | env/ 132 | venv/ 133 | ENV/ 134 | env.bak/ 135 | venv.bak/ 136 | 137 | # Spyder project settings 138 | .spyderproject 139 | .spyproject 140 | 141 | # Rope project settings 142 | .ropeproject 143 | 144 | # mkdocs documentation 145 | /site 146 | 147 | # mypy 148 | .mypy_cache/ 149 | .dmypy.json 150 | dmypy.json 151 | 152 | # Pyre type checker 153 | .pyre/ 154 | 155 | # pytype static type analyzer 156 | .pytype/ 157 | 158 | # Cython debug symbols 159 | cython_debug/ 160 | 161 | # PyCharm 162 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 163 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 164 | # and can be added to the global gitignore or merged into this file. For a more nuclear 165 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 166 | #.idea/ 167 | -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/patches/2.4.0-0001-fix-cmake-source-dir-and-targets.patch: -------------------------------------------------------------------------------- 1 | diff --git CMakeLists.txt CMakeLists.txt 2 | index 0eaec4be..e711295c 100755 3 | --- CMakeLists.txt 4 | +++ CMakeLists.txt 5 | @@ -511,7 +511,7 @@ install( 6 | FILE ${OCIO_TARGETS_EXPORT_NAME} 7 | ) 8 | 9 | -if (NOT BUILD_SHARED_LIBS) 10 | +if (0) 11 | # Install custom macros used in the find modules. 12 | install(FILES 13 | ${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake 14 | diff --git share/cmake/modules/FindExtPackages.cmake share/cmake/modules/FindExtPackages.cmake 15 | index accdecec..945c5edc 100644 16 | --- share/cmake/modules/FindExtPackages.cmake 17 | +++ share/cmake/modules/FindExtPackages.cmake 18 | @@ -63,7 +63,7 @@ ocio_handle_dependency( expat REQUIRED ALLOW_INSTALL 19 | # https://github.com/jbeder/yaml-cpp 20 | ocio_handle_dependency( yaml-cpp REQUIRED ALLOW_INSTALL 21 | MIN_VERSION 0.6.3 22 | - RECOMMENDED_VERSION 0.7.0 23 | + RECOMMENDED_VERSION 0.8.0 24 | RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") 25 | 26 | # pystring 27 | @@ -110,9 +110,9 @@ ocio_handle_dependency( ZLIB REQUIRED ALLOW_INSTALL 28 | 29 | # minizip-ng 30 | # https://github.com/zlib-ng/minizip-ng 31 | -ocio_handle_dependency( minizip-ng REQUIRED ALLOW_INSTALL 32 | +ocio_handle_dependency( minizip REQUIRED ALLOW_INSTALL 33 | MIN_VERSION 3.0.6 34 | - RECOMMENDED_VERSION 3.0.7 35 | + RECOMMENDED_VERSION 4.0.1 36 | RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") 37 | 38 | ############################################################################### 39 | @@ -131,7 +131,7 @@ if(OCIO_BUILD_APPS) 40 | 41 | # lcms2 42 | # https://github.com/mm2/Little-CMS 43 | - ocio_handle_dependency( lcms2 REQUIRED ALLOW_INSTALL 44 | + ocio_handle_dependency( lcms REQUIRED ALLOW_INSTALL 45 | MIN_VERSION 2.2 46 | RECOMMENDED_VERSION 2.2 47 | RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") 48 | diff --git share/cmake/utils/CppVersion.cmake share/cmake/utils/CppVersion.cmake 49 | index 175d89c2..ac93b87a 100644 50 | --- share/cmake/utils/CppVersion.cmake 51 | +++ share/cmake/utils/CppVersion.cmake 52 | @@ -16,7 +16,7 @@ elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) 53 | "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") 54 | endif() 55 | 56 | -set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") 57 | +# set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") 58 | 59 | include(CheckCXXCompilerFlag) 60 | 61 | diff --git src/OpenColorIO/CMakeLists.txt src/OpenColorIO/CMakeLists.txt 62 | index 7d2894da..1e6570b4 100755 63 | --- src/OpenColorIO/CMakeLists.txt 64 | +++ src/OpenColorIO/CMakeLists.txt 65 | @@ -315,8 +315,8 @@ target_link_libraries(OpenColorIO 66 | "$" 67 | "$" 68 | "$" 69 | - ${YAML_CPP_LIBRARIES} 70 | - MINIZIP::minizip-ng 71 | + PUBLIC yaml-cpp 72 | + MINIZIP::minizip 73 | ) 74 | 75 | if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) 76 | diff --git src/apps/ocioarchive/CMakeLists.txt src/apps/ocioarchive/CMakeLists.txt 77 | index 599d706f..efe6cd5a 100644 78 | --- src/apps/ocioarchive/CMakeLists.txt 79 | +++ src/apps/ocioarchive/CMakeLists.txt 80 | @@ -21,7 +21,7 @@ target_link_libraries(ocioarchive 81 | PRIVATE 82 | apputils 83 | OpenColorIO 84 | - MINIZIP::minizip-ng 85 | + MINIZIP::minizip 86 | ) 87 | 88 | include(StripUtils) 89 | diff --git src/apps/ociobakelut/CMakeLists.txt src/apps/ociobakelut/CMakeLists.txt 90 | index 3d6e586b..f7069a1f 100755 91 | --- src/apps/ociobakelut/CMakeLists.txt 92 | +++ src/apps/ociobakelut/CMakeLists.txt 93 | @@ -29,7 +29,7 @@ set_target_properties(ociobakelut 94 | target_link_libraries(ociobakelut 95 | PRIVATE 96 | apputils 97 | - lcms2::lcms2 98 | + lcms::lcms 99 | OpenColorIO 100 | ) 101 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libuhdr/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.build import check_min_cppstd 5 | from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout 6 | from conan.tools.files import apply_conandata_patches, copy, get, rmdir 7 | 8 | 9 | class LibultrahdrConan(ConanFile): 10 | name = "libuhdr" 11 | description = ( 12 | "Library for storing and distributing HDR images using gain map technology" 13 | ) 14 | license = "Apache-2.0" 15 | url = "https://github.com/google/libultrahdr" 16 | settings = "os", "arch", "compiler", "build_type" 17 | options = { 18 | "shared": [True, False], 19 | "fPIC": [True, False], 20 | } 21 | default_options = { 22 | "shared": False, 23 | "fPIC": True, 24 | } 25 | generators = "CMakeDeps" 26 | 27 | tool_requires = "cmake/[>=3.15 <4]" 28 | 29 | def config_options(self): 30 | if self.settings.os == "Windows": # pylint: disable=no-member 31 | del self.options.fPIC 32 | 33 | def configure(self): 34 | if self.options.shared: 35 | self.options.rm_safe("fPIC") 36 | 37 | def validate(self): 38 | check_min_cppstd(self, "14") 39 | 40 | def source(self): 41 | get(self, **self.conan_data["sources"][self.version], strip_root=True) 42 | 43 | def layout(self): 44 | cmake_layout(self, src_folder="src") 45 | 46 | @property 47 | def dont_use_jpeg_turbo(self): 48 | if os.getenv("MUSLLINUX_BUILD") == "1": 49 | return True 50 | elif os.getenv("OIIO_STATIC") == "1" and self.settings.os in [ 51 | "Linux", 52 | "FreeBSD", 53 | ]: 54 | return True 55 | return False 56 | 57 | def requirements(self): 58 | if self.dont_use_jpeg_turbo: 59 | self.requires("libjpeg/9e") 60 | else: 61 | self.requires("libjpeg-turbo/3.0.4") 62 | 63 | def generate(self): 64 | tc = CMakeToolchain(self) 65 | tc.variables["UHDR_BUILD_DEPS"] = False 66 | tc.variables["BUILD_SHARED_LIBS"] = self.options.shared 67 | tc.variables["ULTRAHDR_BUILD_TESTS"] = False 68 | tc.variables["UHDR_BUILD_EXAMPLES"] = False 69 | tc.variables["UHDR_ENABLE_INSTALL"] = True 70 | tc.variables["CMAKE_INSTALL_PREFIX"] = self.package_folder 71 | 72 | tc.generate() 73 | 74 | def build(self): 75 | apply_conandata_patches(self) 76 | cmake = CMake(self) 77 | cmake.configure() 78 | cmake.build() 79 | 80 | def package(self): 81 | cmake = CMake(self) 82 | cmake.install() 83 | # For some reason, install fails on Windows. 84 | # Copy the files manually. 85 | copy( 86 | self, 87 | pattern="*.h", 88 | src=os.path.join(self.source_folder), 89 | dst=os.path.join(self.package_folder, "include"), 90 | ) 91 | copy( 92 | self, 93 | pattern="*.lib", 94 | src=self.build_folder, 95 | dst=os.path.join(self.package_folder, "lib"), 96 | keep_path=False, 97 | ) 98 | copy( 99 | self, 100 | pattern="*.dll", 101 | src=self.build_folder, 102 | dst=os.path.join(self.package_folder, "bin"), 103 | keep_path=False, 104 | ) 105 | 106 | rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) 107 | rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 108 | copy( 109 | self, 110 | "LICENSE", 111 | src=self.source_folder, 112 | dst=os.path.join(self.package_folder, "licenses"), 113 | ) 114 | 115 | def package_info(self): 116 | # Basic package information 117 | self.cpp_info.set_property("cmake_file_name", "libuhdr") 118 | self.cpp_info.set_property("cmake_target_name", "libuhdr::libuhdr") 119 | 120 | # # Library information 121 | self.cpp_info.libs.append("uhdr") 122 | self.cpp_info.includedirs = ["include"] 123 | self.cpp_info.libdirs = ["lib"] 124 | 125 | # Dependencies 126 | if self.dont_use_jpeg_turbo: 127 | self.cpp_info.requires = ["libjpeg::libjpeg"] 128 | else: 129 | self.cpp_info.requires = ["libjpeg-turbo::libjpeg-turbo"] 130 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/bzip2/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | import textwrap 3 | 4 | from conan import ConanFile 5 | from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout 6 | from conan.tools.files import ( 7 | apply_conandata_patches, 8 | copy, 9 | export_conandata_patches, 10 | get, 11 | save, 12 | ) 13 | from conan.tools.scm import Version 14 | 15 | required_conan_version = ">=1.53.0" 16 | 17 | 18 | class Bzip2Conan(ConanFile): 19 | name = "bzip2" 20 | url = "https://github.com/conan-io/conan-center-index" 21 | homepage = "https://sourceware.org/bzip2" 22 | license = "bzip2-1.0.6" 23 | description = "bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm." 24 | topics = ("data-compressor", "file-compression") 25 | package_type = "library" 26 | settings = "os", "arch", "compiler", "build_type" 27 | options = { 28 | "shared": [True, False], 29 | "fPIC": [True, False], 30 | "build_executable": [True, False], 31 | } 32 | default_options = { 33 | "shared": False, 34 | "fPIC": True, 35 | "build_executable": False, 36 | } 37 | 38 | def export_sources(self): 39 | copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) 40 | export_conandata_patches(self) 41 | 42 | def config_options(self): 43 | if self.settings.os == "Windows": # pylint: disable=no-member 44 | del self.options.fPIC 45 | self.license = f"bzip2-{self.version}" 46 | 47 | def configure(self): 48 | if self.options.shared: 49 | self.options.rm_safe("fPIC") 50 | self.settings.compiler.rm_safe("libcxx") # pylint: disable=no-member 51 | self.settings.compiler.rm_safe("cppstd") # pylint: disable=no-member 52 | 53 | def layout(self): 54 | cmake_layout(self, src_folder="src") 55 | 56 | def source(self): 57 | get( 58 | self, **self.conan_data["sources"][self.version], strip_root=True 59 | ) # pylint: disable=no-member 60 | 61 | def build_requirements(self): 62 | self.tool_requires("cmake/[>=3.19 <4]") 63 | 64 | def generate(self): 65 | tc = CMakeToolchain(self) 66 | tc.variables["BZ2_BUILD_EXE"] = self.options.build_executable 67 | tc.variables["BZ2_SRC_DIR"] = self.source_folder.replace("\\", "/") 68 | tc.variables["BZ2_VERSION_MAJOR"] = Version(self.version).major 69 | tc.variables["BZ2_VERSION_STRING"] = self.version 70 | tc.generate() 71 | 72 | def build(self): 73 | apply_conandata_patches(self) 74 | cmake = CMake(self) 75 | cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) 76 | cmake.build() 77 | 78 | def package(self): 79 | copy( 80 | self, 81 | "LICENSE", 82 | src=self.source_folder, 83 | dst=os.path.join(self.package_folder, "licenses"), 84 | ) 85 | cmake = CMake(self) 86 | cmake.install() 87 | self._create_cmake_module_variables( 88 | os.path.join(self.package_folder, self._module_file_rel_path) 89 | ) 90 | 91 | def _create_cmake_module_variables(self, module_file): 92 | content = textwrap.dedent( 93 | f"""\ 94 | set(BZIP2_NEED_PREFIX TRUE) 95 | set(BZIP2_FOUND TRUE) 96 | if(NOT DEFINED BZIP2_INCLUDE_DIRS AND DEFINED BZip2_INCLUDE_DIRS) 97 | set(BZIP2_INCLUDE_DIRS ${{BZip2_INCLUDE_DIRS}}) 98 | endif() 99 | if(NOT DEFINED BZIP2_INCLUDE_DIR AND DEFINED BZip2_INCLUDE_DIR) 100 | set(BZIP2_INCLUDE_DIR ${{BZip2_INCLUDE_DIR}}) 101 | endif() 102 | if(NOT DEFINED BZIP2_LIBRARIES AND DEFINED BZip2_LIBRARIES) 103 | set(BZIP2_LIBRARIES ${{BZip2_LIBRARIES}}) 104 | endif() 105 | set(BZIP2_VERSION_STRING "{self.version}") 106 | """ 107 | ) 108 | save(self, module_file, content) 109 | 110 | @property 111 | def _module_file_rel_path(self): 112 | return os.path.join( 113 | "lib", "cmake", f"conan-official-{self.name}-variables.cmake" 114 | ) 115 | 116 | def package_info(self): 117 | self.cpp_info.set_property("cmake_find_mode", "both") 118 | self.cpp_info.set_property("cmake_file_name", "BZip2") 119 | self.cpp_info.set_property("cmake_target_name", "BZip2::BZip2") 120 | self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) 121 | self.cpp_info.libs = ["bz2"] 122 | 123 | self.cpp_info.names["cmake_find_package"] = "BZip2" 124 | self.cpp_info.names["cmake_find_package_multi"] = "BZip2" 125 | self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] 126 | if self.options.build_executable: 127 | self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) 128 | -------------------------------------------------------------------------------- /publish_on_pypi.py: -------------------------------------------------------------------------------- 1 | """ 2 | This script automates the process of cleaning a Python repository, building a source distribution (sdist), 3 | and publishing the package to PyPI or Test PyPI. It provides a simple CLI interface to toggle between 4 | release and test modes. 5 | """ 6 | 7 | import argparse 8 | import os 9 | import shutil 10 | import subprocess 11 | import sys 12 | from pathlib import Path 13 | 14 | here = Path(__file__).parent.resolve() 15 | 16 | 17 | def run_command(command): 18 | """Run a shell command and handle errors gracefully.""" 19 | try: 20 | subprocess.run(command, check=True, shell=True) 21 | except subprocess.CalledProcessError as e: 22 | print(f"Error while running command: {e.cmd}") 23 | sys.exit(1) 24 | 25 | 26 | def cleanup(): 27 | """ 28 | Clean the repository by removing build artifacts and temporary files. 29 | 30 | Deletes directories like `build`, `dist`, and other generated folders/files 31 | during the build process to ensure a clean state. 32 | """ 33 | package_dir = here / "oiio_python" 34 | 35 | to_remove = [ 36 | here / "build", 37 | here / "dist", 38 | package_dir / "oiio_python.egg-info", 39 | package_dir / "oiio_static_python.egg-info", 40 | package_dir / "OpenImageIO", 41 | package_dir / "PyOpenColorIO", 42 | package_dir / "libs", 43 | ] 44 | 45 | for folder in to_remove: 46 | if folder.exists(): 47 | if folder.is_dir(): 48 | shutil.rmtree(folder) 49 | else: 50 | folder.unlink() 51 | 52 | 53 | def build_sdist(): 54 | """ 55 | Build the source distribution (sdist) for the Python package. 56 | 57 | This creates a tarball of the source code in the `dist` directory, which can be 58 | uploaded to PyPI. 59 | """ 60 | print("Building the source distribution...") 61 | run_command("python setup.py sdist") 62 | 63 | 64 | def publish_to_pypi(repository_url, static): 65 | """ 66 | Publish the package to the specified PyPI repository. 67 | 68 | Lists all files in the `dist` directory to be uploaded and asks for user confirmation 69 | before proceeding with the upload. 70 | """ 71 | print(f"Publishing to {repository_url}...") 72 | 73 | dist_files = list((here / "dist").glob("*")) 74 | 75 | if static: 76 | wheelhouse = "wheelhouse_static" 77 | else: 78 | wheelhouse = "wheelhouse" 79 | 80 | if not (here / wheelhouse).exists(): 81 | print(f"Wheelhouse directory not found: {wheelhouse}") 82 | sys.exit(1) 83 | 84 | wheel_files = list((here / wheelhouse).glob("*.whl")) 85 | 86 | print("=" * 80) 87 | print( 88 | f"Publishing {len(dist_files) + len(wheel_files)} files to PyPI: {repository_url}" 89 | ) 90 | for file in dist_files: 91 | print(file) 92 | for file in wheel_files: 93 | print(file) 94 | print("=" * 80) 95 | 96 | confirm = ( 97 | input("Are you sure you want to publish to PyPI? (yes/no): ").strip().lower() 98 | ) 99 | if confirm != "yes": 100 | print("Aborted.") 101 | sys.exit(0) 102 | 103 | dist_empty = len(dist_files) == 0 104 | wheel_empty = len(wheel_files) == 0 105 | if dist_empty and wheel_empty: 106 | print("No files to publish.") 107 | sys.exit(0) 108 | 109 | if not dist_empty: 110 | run_command(f"twine upload --verbose --repository {repository_url} dist/*") 111 | if not wheel_empty: 112 | run_command( 113 | f"twine upload --verbose --repository {repository_url} {wheelhouse}/*" 114 | ) 115 | 116 | 117 | def main(): 118 | """ 119 | Main entry point for the script. 120 | 121 | Parses command-line arguments to determine the mode (release or test) and 122 | performs cleanup, builds the source distribution, and publishes it to PyPI. 123 | """ 124 | parser = argparse.ArgumentParser(description="Publish Python packages to PyPI.") 125 | parser.add_argument( 126 | "--release", action="store_true", help="Publish to PyPI instead of Test PyPI." 127 | ) 128 | parser.add_argument( 129 | "--static", action="store_true", help="Publish oiio-static-python." 130 | ) 131 | parser.add_argument( 132 | "--nosdist", action="store_true", help="Skip building source distribution." 133 | ) 134 | args = parser.parse_args() 135 | 136 | if args.static: 137 | os.environ["OIIO_STATIC"] = "1" 138 | else: 139 | os.environ["OIIO_STATIC"] = "0" 140 | 141 | if args.release: 142 | confirm = ( 143 | input("Using RELEASE mode, do you want to continue? (yes/no): ") 144 | .strip() 145 | .lower() 146 | ) 147 | if confirm != "yes": 148 | print("Aborted.") 149 | sys.exit(0) 150 | repository_url = "pypi" 151 | else: 152 | repository_url = "testpypi" 153 | 154 | # Clean, build, and publish 155 | cleanup() 156 | if not args.nosdist: 157 | build_sdist() 158 | publish_to_pypi(repository_url, args.static) 159 | 160 | 161 | if __name__ == "__main__": 162 | main() 163 | -------------------------------------------------------------------------------- /setuputils/build_utils.py: -------------------------------------------------------------------------------- 1 | """Utility functions for building and managing Conan packages.""" 2 | 3 | import os 4 | import time 5 | import platform 6 | import shutil 7 | import subprocess 8 | from pathlib import Path 9 | 10 | project = Path(__file__).parent.resolve() 11 | 12 | 13 | def conan_profile_ensure(cpp_std: str = "14") -> None: 14 | """Ensure Conan profile exists and set the C++ standard.""" 15 | # Check if the default profile exists by listing profiles 16 | list_profiles_output = subprocess.run( 17 | ["conan", "profile", "list", "--path"], 18 | capture_output=True, 19 | text=True, 20 | check=True, 21 | ) 22 | profiles = list_profiles_output.stdout.strip().splitlines() 23 | print(profiles) 24 | if "default" not in profiles: 25 | 26 | system = platform.system() 27 | machine = platform.machine() 28 | 29 | print("Default Conan profile not found. Running 'conan profile detect'.") 30 | 31 | if system == "Darwin" and machine == "arm64": 32 | print("Running Conan profile detection for macOS ARM64.") 33 | detect_command = ["arch", "-arm64", "conan", "profile", "detect", "--force"] 34 | else: 35 | print(f"Running Conan profile detection for {system} on {machine}.") 36 | detect_command = ["conan", "profile", "detect", "--force"] 37 | 38 | # Run 'conan profile detect' 39 | detect_output = subprocess.run( 40 | detect_command, capture_output=True, text=True, check=True 41 | ) 42 | if detect_output.returncode == 0: 43 | print("Conan Profile detected successfully.") 44 | else: 45 | print("Error detecting Conan profile:", detect_output.stderr) 46 | else: 47 | print("Default Conan profile already exists.") 48 | 49 | home_folder = Path(os.path.expanduser("~")) 50 | profile_path = home_folder / ".conan2" / "profiles" / "default" 51 | 52 | # Read the profile file 53 | profile_content = profile_path.read_text(encoding="utf8") 54 | lines = profile_content.splitlines() 55 | 56 | new_lines = [] 57 | for line in lines: 58 | if line.startswith("compiler.cppstd"): 59 | new_lines.append(f"compiler.cppstd={cpp_std}") 60 | else: 61 | new_lines.append(line) 62 | 63 | # Write the updated profile file 64 | new_profile = profile_path.with_name("default_oiio_build") 65 | new_profile.write_text("\n".join(new_lines), encoding="utf8") 66 | profile_content = new_profile.read_text(encoding="utf8") 67 | 68 | 69 | def build_cleanup(recipe_dir: Path) -> None: 70 | """Clean build artifacts from a Conan recipe directory.""" 71 | retry = 0 72 | while retry < 4: 73 | try: 74 | build_dir = recipe_dir / "build" 75 | if build_dir.exists(): 76 | shutil.rmtree(build_dir) 77 | 78 | src_dir = recipe_dir / "src" 79 | if src_dir.exists(): 80 | shutil.rmtree(src_dir) 81 | 82 | cmake_presets = recipe_dir / "CMakeUserPresets.json" 83 | 84 | if cmake_presets.exists(): 85 | cmake_presets.unlink() 86 | 87 | test_package_dir = recipe_dir / "test_package" 88 | if test_package_dir.exists(): 89 | test_build = test_package_dir / "build" 90 | 91 | if test_build.exists(): 92 | shutil.rmtree(test_build) 93 | 94 | test_cmake_presets = test_package_dir / "CMakeUserPresets.json" 95 | if test_cmake_presets.exists(): 96 | test_cmake_presets.unlink() 97 | break 98 | except PermissionError: 99 | time.sleep(1) 100 | retry += 1 101 | 102 | 103 | def conan_install_package( 104 | root_folder: Path, 105 | version: str, 106 | profile: str, 107 | source: bool = True, 108 | export: bool = True, 109 | to_build=None, 110 | ) -> None: 111 | """Build and install a Conan package with specified version and profile.""" 112 | 113 | source_cmd = [ 114 | "conan", 115 | "source", 116 | root_folder.as_posix(), 117 | "--version", 118 | version, 119 | # "-vwarning", 120 | ] 121 | if to_build is None: 122 | to_build = ["missing"] 123 | build_arg_list = [] 124 | # Without boost, build=missing seems to work on linux! 125 | for b in to_build: 126 | build_arg = f"--build={b}" 127 | build_arg_list.append(build_arg) 128 | 129 | install_cmd = [ 130 | "conan", 131 | "install", 132 | root_folder.as_posix(), 133 | "--version", 134 | version, 135 | "--profile", 136 | profile, 137 | ] 138 | 139 | install_cmd += build_arg_list 140 | 141 | build_cmd = [ 142 | "conan", 143 | "build", 144 | root_folder.as_posix(), 145 | "--version", 146 | version, 147 | "--profile", 148 | profile, 149 | ] 150 | export_cmd = [ 151 | "conan", 152 | "export-pkg", 153 | root_folder.as_posix(), 154 | "--version", 155 | version, 156 | "--profile", 157 | profile, 158 | # "-vwarning", 159 | ] 160 | if source: 161 | subprocess.run(source_cmd, check=True) 162 | subprocess.run(install_cmd, check=True) 163 | subprocess.run(build_cmd, check=True) 164 | if export: 165 | subprocess.run(export_cmd, check=True) 166 | -------------------------------------------------------------------------------- /licenses/libpng-LICENSE: -------------------------------------------------------------------------------- 1 | COPYRIGHT NOTICE, DISCLAIMER, and LICENSE 2 | ========================================= 3 | 4 | PNG Reference Library License version 2 5 | --------------------------------------- 6 | 7 | * Copyright (c) 1995-2024 The PNG Reference Library Authors. 8 | * Copyright (c) 2018-2024 Cosmin Truta. 9 | * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. 10 | * Copyright (c) 1996-1997 Andreas Dilger. 11 | * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. 12 | 13 | The software is supplied "as is", without warranty of any kind, 14 | express or implied, including, without limitation, the warranties 15 | of merchantability, fitness for a particular purpose, title, and 16 | non-infringement. In no event shall the Copyright owners, or 17 | anyone distributing the software, be liable for any damages or 18 | other liability, whether in contract, tort or otherwise, arising 19 | from, out of, or in connection with the software, or the use or 20 | other dealings in the software, even if advised of the possibility 21 | of such damage. 22 | 23 | Permission is hereby granted to use, copy, modify, and distribute 24 | this software, or portions hereof, for any purpose, without fee, 25 | subject to the following restrictions: 26 | 27 | 1. The origin of this software must not be misrepresented; you 28 | must not claim that you wrote the original software. If you 29 | use this software in a product, an acknowledgment in the product 30 | documentation would be appreciated, but is not required. 31 | 32 | 2. Altered source versions must be plainly marked as such, and must 33 | not be misrepresented as being the original software. 34 | 35 | 3. This Copyright notice may not be removed or altered from any 36 | source or altered source distribution. 37 | 38 | 39 | PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) 40 | ----------------------------------------------------------------------- 41 | 42 | libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are 43 | Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are 44 | derived from libpng-1.0.6, and are distributed according to the same 45 | disclaimer and license as libpng-1.0.6 with the following individuals 46 | added to the list of Contributing Authors: 47 | 48 | Simon-Pierre Cadieux 49 | Eric S. Raymond 50 | Mans Rullgard 51 | Cosmin Truta 52 | Gilles Vollant 53 | James Yu 54 | Mandar Sahastrabuddhe 55 | Google Inc. 56 | Vadim Barkov 57 | 58 | and with the following additions to the disclaimer: 59 | 60 | There is no warranty against interference with your enjoyment of 61 | the library or against infringement. There is no warranty that our 62 | efforts or the library will fulfill any of your particular purposes 63 | or needs. This library is provided with all faults, and the entire 64 | risk of satisfactory quality, performance, accuracy, and effort is 65 | with the user. 66 | 67 | Some files in the "contrib" directory and some configure-generated 68 | files that are distributed with libpng have other copyright owners, and 69 | are released under other open source licenses. 70 | 71 | libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are 72 | Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from 73 | libpng-0.96, and are distributed according to the same disclaimer and 74 | license as libpng-0.96, with the following individuals added to the 75 | list of Contributing Authors: 76 | 77 | Tom Lane 78 | Glenn Randers-Pehrson 79 | Willem van Schaik 80 | 81 | libpng versions 0.89, June 1996, through 0.96, May 1997, are 82 | Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, 83 | and are distributed according to the same disclaimer and license as 84 | libpng-0.88, with the following individuals added to the list of 85 | Contributing Authors: 86 | 87 | John Bowler 88 | Kevin Bracey 89 | Sam Bushell 90 | Magnus Holmgren 91 | Greg Roelofs 92 | Tom Tanner 93 | 94 | Some files in the "scripts" directory have other copyright owners, 95 | but are released under this license. 96 | 97 | libpng versions 0.5, May 1995, through 0.88, January 1996, are 98 | Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. 99 | 100 | For the purposes of this copyright and license, "Contributing Authors" 101 | is defined as the following set of individuals: 102 | 103 | Andreas Dilger 104 | Dave Martindale 105 | Guy Eric Schalnat 106 | Paul Schmidt 107 | Tim Wegner 108 | 109 | The PNG Reference Library is supplied "AS IS". The Contributing 110 | Authors and Group 42, Inc. disclaim all warranties, expressed or 111 | implied, including, without limitation, the warranties of 112 | merchantability and of fitness for any purpose. The Contributing 113 | Authors and Group 42, Inc. assume no liability for direct, indirect, 114 | incidental, special, exemplary, or consequential damages, which may 115 | result from the use of the PNG Reference Library, even if advised of 116 | the possibility of such damage. 117 | 118 | Permission is hereby granted to use, copy, modify, and distribute this 119 | source code, or portions hereof, for any purpose, without fee, subject 120 | to the following restrictions: 121 | 122 | 1. The origin of this source code must not be misrepresented. 123 | 124 | 2. Altered versions must be plainly marked as such and must not 125 | be misrepresented as being the original source. 126 | 127 | 3. This Copyright notice may not be removed or altered from any 128 | source or altered source distribution. 129 | 130 | The Contributing Authors and Group 42, Inc. specifically permit, 131 | without fee, and encourage the use of this source code as a component 132 | to supporting the PNG file format in commercial products. If you use 133 | this source code in a product, acknowledgment is not required but would 134 | be appreciated. -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/patches/2.2.1-0002-fix-pystring.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp 2 | index 665d522..6abc149 100644 3 | --- a/src/OpenColorIO/Config.cpp 4 | +++ b/src/OpenColorIO/Config.cpp 5 | @@ -33,7 +33,7 @@ 6 | #include "Platform.h" 7 | #include "PrivateTypes.h" 8 | #include "Processor.h" 9 | -#include "pystring/pystring.h" 10 | +#include "pystring.h" 11 | #include "transforms/FileTransform.h" 12 | #include "utils/StringUtils.h" 13 | #include "ViewingRules.h" 14 | diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp 15 | index bb6fb07..a8890ed 100644 16 | --- a/src/OpenColorIO/Context.cpp 17 | +++ b/src/OpenColorIO/Context.cpp 18 | @@ -15,7 +15,7 @@ 19 | #include "OCIOZArchive.h" 20 | #include "PathUtils.h" 21 | #include "PrivateTypes.h" 22 | -#include "pystring/pystring.h" 23 | +#include "pystring.h" 24 | #include "utils/StringUtils.h" 25 | 26 | namespace OCIO_NAMESPACE 27 | diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp 28 | index 62cbb0d..59c1564 100644 29 | --- a/src/OpenColorIO/OCIOYaml.cpp 30 | +++ b/src/OpenColorIO/OCIOYaml.cpp 31 | @@ -19,7 +19,7 @@ 32 | #include "ParseUtils.h" 33 | #include "PathUtils.h" 34 | #include "Platform.h" 35 | -#include "pystring/pystring.h" 36 | +#include "pystring.h" 37 | #include "utils/StringUtils.h" 38 | #include "ViewingRules.h" 39 | #include "yaml-cpp/yaml.h" 40 | diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp 41 | index 85fc7bb..4cd1448 100644 42 | --- a/src/OpenColorIO/OCIOZArchive.cpp 43 | +++ b/src/OpenColorIO/OCIOZArchive.cpp 44 | @@ -11,7 +11,7 @@ 45 | #include 46 | #include "Mutex.h" 47 | #include "Platform.h" 48 | -#include "pystring/pystring.h" 49 | +#include "pystring.h" 50 | #include "utils/StringUtils.h" 51 | #include "transforms/FileTransform.h" 52 | 53 | @@ -630,4 +630,4 @@ void CIOPOciozArchive::buildEntries() 54 | getEntriesMappingFromArchiveFile(m_archiveAbsPath, m_entries); 55 | } 56 | 57 | -} // namespace OCIO_NAMESPACE 58 | \ No newline at end of file 59 | +} // namespace OCIO_NAMESPACE 60 | diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp 61 | index 1ae607a..bb5406f 100755 62 | --- a/src/OpenColorIO/Op.cpp 63 | +++ b/src/OpenColorIO/Op.cpp 64 | @@ -20,7 +20,7 @@ 65 | #include "ops/lut1d/Lut1DOp.h" 66 | #include "ops/lut3d/Lut3DOp.h" 67 | #include "ops/range/RangeOp.h" 68 | -#include "pystring/pystring.h" 69 | +#include "pystring.h" 70 | 71 | namespace OCIO_NAMESPACE 72 | { 73 | diff --git a/src/OpenColorIO/PathUtils.cpp b/src/OpenColorIO/PathUtils.cpp 74 | index 9dc8c6b..4a1096d 100644 75 | --- a/src/OpenColorIO/PathUtils.cpp 76 | +++ b/src/OpenColorIO/PathUtils.cpp 77 | @@ -10,7 +10,7 @@ 78 | #include "Mutex.h" 79 | #include "PathUtils.h" 80 | #include "Platform.h" 81 | -#include "pystring/pystring.h" 82 | +#include "pystring.h" 83 | #include "utils/StringUtils.h" 84 | #include "OCIOZArchive.h" 85 | 86 | diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp 87 | index ebed326..9f70ff8 100644 88 | --- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp 89 | +++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp 90 | @@ -23,7 +23,7 @@ 91 | #include "OpBuilders.h" 92 | #include "ops/noop/NoOps.h" 93 | #include "Platform.h" 94 | -#include "pystring/pystring.h" 95 | +#include "pystring.h" 96 | #include "TransformBuilder.h" 97 | #include "transforms/FileTransform.h" 98 | #include "utils/StringUtils.h" 99 | diff --git a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp 100 | index a52bc72..bd827f0 100755 101 | --- a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp 102 | +++ b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp 103 | @@ -16,7 +16,7 @@ 104 | #include "ops/lut1d/Lut1DOp.h" 105 | #include "ops/lut3d/Lut3DOp.h" 106 | #include "ParseUtils.h" 107 | -#include "pystring/pystring.h" 108 | +#include "pystring.h" 109 | #include "Platform.h" 110 | #include "transforms/FileTransform.h" 111 | #include "utils/StringUtils.h" 112 | diff --git a/src/OpenColorIO/fileformats/FileFormatICC.cpp b/src/OpenColorIO/fileformats/FileFormatICC.cpp 113 | index 786c8a5..4953103 100755 114 | --- a/src/OpenColorIO/fileformats/FileFormatICC.cpp 115 | +++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp 116 | @@ -14,7 +14,7 @@ 117 | #include "ops/lut1d/Lut1DOp.h" 118 | #include "ops/matrix/MatrixOp.h" 119 | #include "ops/range/RangeOp.h" 120 | -#include "pystring/pystring.h" 121 | +#include "pystring.h" 122 | #include "transforms/FileTransform.h" 123 | 124 | 125 | diff --git a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp 126 | index 7402efd..cc3acb4 100755 127 | --- a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp 128 | +++ b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp 129 | @@ -13,7 +13,7 @@ 130 | #include "ops/lut3d/Lut3DOp.h" 131 | #include "ParseUtils.h" 132 | #include "Platform.h" 133 | -#include "pystring/pystring.h" 134 | +#include "pystring.h" 135 | #include "transforms/FileTransform.h" 136 | #include "utils/StringUtils.h" 137 | #include "utils/NumberUtils.h" 138 | diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp 139 | index 4fd4d5d..dc5eb3c 100755 140 | --- a/src/OpenColorIO/transforms/FileTransform.cpp 141 | +++ b/src/OpenColorIO/transforms/FileTransform.cpp 142 | @@ -19,7 +19,7 @@ 143 | #include "ops/noop/NoOps.h" 144 | #include "PathUtils.h" 145 | #include "Platform.h" 146 | -#include "pystring/pystring.h" 147 | +#include "pystring.h" 148 | #include "utils/StringUtils.h" 149 | 150 | namespace OCIO_NAMESPACE 151 | diff --git a/vendor/openfx/OCIOUtils.cpp b/vendor/openfx/OCIOUtils.cpp 152 | index ca44905..469ed35 100644 153 | --- a/vendor/openfx/OCIOUtils.cpp 154 | +++ b/vendor/openfx/OCIOUtils.cpp 155 | @@ -9,7 +9,7 @@ namespace OCIO = OCIO_NAMESPACE; 156 | #include 157 | 158 | #include "ofxsLog.h" 159 | -#include "pystring/pystring.h" 160 | +#include "pystring.h" 161 | 162 | namespace 163 | { -------------------------------------------------------------------------------- /licenses/libjpegturbo-LICENSE: -------------------------------------------------------------------------------- 1 | libjpeg-turbo Licenses 2 | ====================== 3 | 4 | libjpeg-turbo is covered by two compatible BSD-style open source licenses: 5 | 6 | - The IJG (Independent JPEG Group) License, which is listed in 7 | [README.ijg](README.ijg) 8 | 9 | This license applies to the libjpeg API library and associated programs, 10 | including any code inherited from libjpeg and any modifications to that 11 | code. Note that the libjpeg-turbo SIMD source code bears the 12 | [zlib License](https://opensource.org/licenses/Zlib), but in the context of 13 | the overall libjpeg API library, the terms of the zlib License are subsumed 14 | by the terms of the IJG License. 15 | 16 | - The Modified (3-clause) BSD License, which is listed below 17 | 18 | This license applies to the TurboJPEG API library and associated programs, as 19 | well as the build system. Note that the TurboJPEG API library wraps the 20 | libjpeg API library, so in the context of the overall TurboJPEG API library, 21 | both the terms of the IJG License and the terms of the Modified (3-clause) 22 | BSD License apply. 23 | 24 | 25 | Complying with the libjpeg-turbo Licenses 26 | ========================================= 27 | 28 | This section provides a roll-up of the libjpeg-turbo licensing terms, to the 29 | best of our understanding. This is not a license in and of itself. It is 30 | intended solely for clarification. 31 | 32 | 1. If you are distributing a modified version of the libjpeg-turbo source, 33 | then: 34 | 35 | 1. You cannot alter or remove any existing copyright or license notices 36 | from the source. 37 | 38 | **Origin** 39 | - Clause 1 of the IJG License 40 | - Clause 1 of the Modified BSD License 41 | - Clauses 1 and 3 of the zlib License 42 | 43 | 2. You must add your own copyright notice to the header of each source 44 | file you modified, so others can tell that you modified that file. (If 45 | there is not an existing copyright header in that file, then you can 46 | simply add a notice stating that you modified the file.) 47 | 48 | **Origin** 49 | - Clause 1 of the IJG License 50 | - Clause 2 of the zlib License 51 | 52 | 3. You must include the IJG README file, and you must not alter any of the 53 | copyright or license text in that file. 54 | 55 | **Origin** 56 | - Clause 1 of the IJG License 57 | 58 | 2. If you are distributing only libjpeg-turbo binaries without the source, or 59 | if you are distributing an application that statically links with 60 | libjpeg-turbo, then: 61 | 62 | 1. Your product documentation must include a message stating: 63 | 64 | This software is based in part on the work of the Independent JPEG 65 | Group. 66 | 67 | **Origin** 68 | - Clause 2 of the IJG license 69 | 70 | 2. If your binary distribution includes or uses the TurboJPEG API, then 71 | your product documentation must include the text of the Modified BSD 72 | License (see below.) 73 | 74 | **Origin** 75 | - Clause 2 of the Modified BSD License 76 | 77 | 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the 78 | contributors thereof in advertising, publicity, etc. 79 | 80 | **Origin** 81 | - IJG License 82 | - Clause 3 of the Modified BSD License 83 | 84 | 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be 85 | free of defects, nor do we accept any liability for undesirable 86 | consequences resulting from your use of the software. 87 | 88 | **Origin** 89 | - IJG License 90 | - Modified BSD License 91 | - zlib License 92 | 93 | 94 | The Modified (3-clause) BSD License 95 | =================================== 96 | 97 | Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.
98 | Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. 99 | 100 | Redistribution and use in source and binary forms, with or without 101 | modification, are permitted provided that the following conditions are met: 102 | 103 | - Redistributions of source code must retain the above copyright notice, 104 | this list of conditions and the following disclaimer. 105 | - Redistributions in binary form must reproduce the above copyright notice, 106 | this list of conditions and the following disclaimer in the documentation 107 | and/or other materials provided with the distribution. 108 | - Neither the name of the libjpeg-turbo Project nor the names of its 109 | contributors may be used to endorse or promote products derived from this 110 | software without specific prior written permission. 111 | 112 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 113 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 114 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 115 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 116 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 117 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 118 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 119 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 120 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 121 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 122 | POSSIBILITY OF SUCH DAMAGE. 123 | 124 | 125 | Why Two Licenses? 126 | ================= 127 | 128 | The zlib License could have been used instead of the Modified (3-clause) BSD 129 | License, and since the IJG License effectively subsumes the distribution 130 | conditions of the zlib License, this would have effectively placed 131 | libjpeg-turbo binary distributions under the IJG License. However, the IJG 132 | License specifically refers to the Independent JPEG Group and does not extend 133 | attribution and endorsement protections to other entities. Thus, it was 134 | desirable to choose a license that granted us the same protections for new code 135 | that were granted to the IJG for code derived from their software. -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libraw/conanfile.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=E1101,C0114,C0115,C0116 2 | import os 3 | from pathlib import Path 4 | 5 | from conan import ConanFile 6 | from conan.tools.build import check_min_cppstd, stdcpp_library 7 | from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout 8 | from conan.tools.files import copy, get 9 | from conan.tools.microsoft import is_msvc 10 | 11 | 12 | class LibRawConan(ConanFile): 13 | name = "libraw" 14 | description = "LibRaw is a library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)." 15 | license = "CDDL-1.0", "LGPL-2.1-only" 16 | url = "https://github.com/conan-io/conan-center-index" 17 | homepage = "https://www.libraw.org/" 18 | topics = ["image", "photography", "raw"] 19 | settings = "os", "arch", "compiler", "build_type" 20 | options = { 21 | "shared": [True, False], 22 | "fPIC": [True, False], 23 | "build_thread_safe": [True, False], 24 | "with_lcms": [True, False], 25 | "with_jasper": [True, False], 26 | } 27 | default_options = { 28 | "shared": False, 29 | "fPIC": True, 30 | "build_thread_safe": False, 31 | "with_lcms": True, 32 | "with_jasper": False, 33 | } 34 | exports_sources = ["CMakeLists.txt"] 35 | 36 | @property 37 | def _min_cppstd(self): 38 | return 11 39 | 40 | def config_options(self): 41 | if self.settings.os == "Windows": 42 | del self.options.fPIC 43 | if is_msvc(self): 44 | del self.options.build_thread_safe 45 | 46 | def configure(self): 47 | if self.options.shared: 48 | self.options.rm_safe("fPIC") 49 | 50 | def layout(self): 51 | cmake_layout(self, src_folder="src") 52 | 53 | def build_requirements(self): 54 | self.tool_requires("cmake/[>=3.19 <4]") 55 | 56 | @property 57 | def dont_use_jpeg_turbo(self): 58 | if os.getenv("MUSLLINUX_BUILD") == "1": 59 | return True 60 | elif os.getenv("OIIO_STATIC") == "1" and self.settings.os in [ 61 | "Linux", 62 | "FreeBSD", 63 | ]: 64 | return True 65 | return False 66 | 67 | def requirements(self): 68 | # TODO: RawSpeed dependency (-DUSE_RAWSPEED) 69 | # TODO: DNG SDK dependency (-DUSE_DNGSDK) 70 | 71 | # Build issue with libjpeg-turbo on musllinux 72 | if self.dont_use_jpeg_turbo: 73 | self.requires("libjpeg/9e") 74 | else: 75 | self.requires("libjpeg-turbo/3.0.4") 76 | 77 | if self.options.with_lcms: 78 | self.requires("lcms/2.16") 79 | if self.options.with_jasper: 80 | self.requires("jasper/4.0.0") 81 | 82 | def validate(self): 83 | if self.settings.compiler.get_safe("cppstd"): 84 | check_min_cppstd(self, self._min_cppstd) 85 | 86 | def source(self): 87 | get(self, **self.conan_data["sources"][self.version], strip_root=True) 88 | 89 | def generate(self): 90 | tc = CMakeToolchain(self) 91 | tc.variables["RAW_LIB_VERSION_STRING"] = self.version 92 | tc.variables["LIBRAW_SRC_DIR"] = Path(self.source_folder).as_posix() 93 | tc.variables["LIBRAW_BUILD_THREAD_SAFE"] = self.options.get_safe( 94 | "build_thread_safe", False 95 | ) 96 | tc.variables["LIBRAW_WITH_JPEG"] = True 97 | tc.variables["LIBRAW_WITH_LCMS"] = self.options.with_lcms 98 | tc.variables["LIBRAW_WITH_JASPER"] = self.options.with_jasper 99 | tc.generate() 100 | 101 | deps = CMakeDeps(self) 102 | deps.generate() 103 | 104 | def build(self): 105 | cmake = CMake(self) 106 | cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) 107 | cmake.build() 108 | 109 | def package(self): 110 | copy( 111 | self, 112 | pattern="LICENSE*", 113 | dst=os.path.join(self.package_folder, "licenses"), 114 | src=self.source_folder, 115 | ) 116 | copy( 117 | self, 118 | pattern="COPYRIGHT", 119 | dst=os.path.join(self.package_folder, "licenses"), 120 | src=self.source_folder, 121 | ) 122 | cmake = CMake(self) 123 | cmake.install() 124 | 125 | def package_info(self): 126 | self.cpp_info.components["libraw_"].set_property("pkg_config_name", "libraw") 127 | self.cpp_info.components["libraw_"].libs = ["raw"] 128 | self.cpp_info.components["libraw_"].includedirs.append( 129 | os.path.join("include", "libraw") 130 | ) 131 | 132 | if self.settings.os == "Windows": 133 | self.cpp_info.components["libraw_"].system_libs.append("ws2_32") 134 | if not self.options.shared: 135 | self.cpp_info.components["libraw_"].defines.append("LIBRAW_NODLL") 136 | 137 | requires = [] 138 | # Dependencies 139 | if self.dont_use_jpeg_turbo: 140 | requires.append("libjpeg::libjpeg") 141 | else: 142 | requires.append("libjpeg-turbo::libjpeg-turbo") 143 | 144 | if self.options.with_lcms: 145 | requires.append("lcms::lcms") 146 | if self.options.with_jasper: 147 | requires.append("jasper::jasper") 148 | 149 | self.cpp_info.components["libraw_"].requires = requires 150 | 151 | if self.options.get_safe("build_thread_safe"): 152 | self.cpp_info.components["libraw_r"].set_property( 153 | "pkg_config_name", "libraw_r" 154 | ) 155 | self.cpp_info.components["libraw_r"].libs = ["raw_r"] 156 | self.cpp_info.components["libraw_r"].includedirs.append( 157 | os.path.join("include", "libraw") 158 | ) 159 | if self.settings.os in ["Linux", "FreeBSD"]: 160 | self.cpp_info.components["libraw_r"].system_libs.append("pthread") 161 | self.cpp_info.components["libraw_r"].requires = requires 162 | 163 | if not self.options.shared and stdcpp_library(self): 164 | self.cpp_info.components["libraw_"].system_libs.append(stdcpp_library(self)) 165 | if self.options.get_safe("build_thread_safe"): 166 | self.cpp_info.components["libraw_r"].system_libs.append( 167 | stdcpp_library(self) 168 | ) 169 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=wrong-import-position,missing-module-docstring,missing-function-docstring,missing-class-docstring,invalid-name 2 | import os 3 | import platform 4 | import shutil 5 | import sys 6 | from pathlib import Path 7 | 8 | from setuptools import find_packages, setup 9 | from setuptools.dist import Distribution 10 | 11 | sys.path.insert(0, os.path.dirname(__file__)) 12 | from setuputils import build_dependencies, build_packages, relink_and_delocate 13 | 14 | here = Path(__file__).parent.resolve() 15 | 16 | 17 | class BinaryDistribution(Distribution): 18 | def has_ext_modules(self): 19 | return True 20 | 21 | 22 | if __name__ == "__main__": 23 | 24 | license_files_paths = list((here / "licenses").glob("*")) 25 | license_files = [ 26 | license_file_path.relative_to(here).as_posix() 27 | for license_file_path in license_files_paths 28 | ] 29 | 30 | print("including license files:") 31 | for license_file in license_files: 32 | print(license_file) 33 | 34 | oiio_static = os.getenv("OIIO_STATIC") 35 | static_build = str(oiio_static) == "1" 36 | 37 | print("=" * 80) 38 | if static_build: 39 | license_files.append("LICENSE-GPL") 40 | print("Building static libraries.") 41 | else: 42 | license_files.append("LICENSE") 43 | print("Building shared libraries.") 44 | print("=" * 80) 45 | 46 | if "bdist_wheel" in sys.argv: 47 | # When running on Cibuildwheel, avoid rebuilding dependencies for each version. 48 | if os.getenv("CIBUILDWHEEL") != "1": 49 | build_dependencies() 50 | # Build OpenColorIO and OpenImageIO 51 | build_packages(static_build) 52 | # Fix shared libraries on macos 53 | if platform.system() == "Darwin": 54 | relink_and_delocate() 55 | # Include tools if using shared libraries version 56 | if static_build: 57 | # Cleanup tools directories if needed 58 | tool_dirs = [ 59 | here / "oiio_python" / "OpenImageIO" / "tools", 60 | here / "oiio_python" / "PyOpenColorIO" / "tools", 61 | ] 62 | 63 | for tool_dir in tool_dirs: 64 | if tool_dir.exists(): 65 | shutil.rmtree(tool_dir) 66 | 67 | package_data = { 68 | "OpenImageIO": ["*.*", "licenses/*.*"], 69 | "PyOpenColorIO": ["*.*", "licenses/*.*"], 70 | } 71 | else: 72 | tools_dir = [ 73 | here / "oiio_python" / "OpenImageIO" / "tools", 74 | here / "oiio_python" / "PyOpenColorIO" / "tools", 75 | ] 76 | 77 | package_data = { 78 | "OpenImageIO": ["*.*", "tools/*", "licenses/*.*"], 79 | "PyOpenColorIO": ["*.*", "tools/*", "licenses/*.*"], 80 | } 81 | 82 | include_data = True 83 | zip_safe = False 84 | 85 | # Define scripts based on the build type 86 | scripts_list = [] 87 | if not static_build: 88 | oiio_tools = ["iconvert", "idiff", "igrep", "iinfo", "maketx", "oiiotool"] 89 | ocio_tools = [ 90 | "ocioarchive", 91 | "ociobakelut", 92 | "ociocheck", 93 | "ociochecklut", 94 | "ocioconvert", 95 | "ociolutimage", 96 | "ociomakeclf", 97 | "ocioperf", 98 | "ociowrite", 99 | ] 100 | 101 | scripts = dict() 102 | 103 | for tool in oiio_tools: 104 | scripts[tool] = f"OpenImageIO._tool_wrapper:{tool}" 105 | 106 | for tool in ocio_tools: 107 | scripts[tool] = f"PyOpenColorIO._tool_wrapper:{tool}" 108 | 109 | for script_name, script_path in scripts.items(): 110 | scripts_list.append(f"{script_name}={script_path}") 111 | 112 | else: 113 | scripts_list = [] 114 | package_data = {} 115 | scripts = {} 116 | include_data = False 117 | zip_safe = True 118 | license_files += ["LICENSE-GPL", "LICENSE"] 119 | 120 | package_name = "oiio-static-python" if static_build else "oiio-python" 121 | 122 | long_description = (here / "README.md").read_text(encoding="utf8") 123 | 124 | # Use SPDX license expression instead of deprecated classifiers 125 | if static_build: 126 | license_expr = "Apache-2.0 OR GPL-3.0-only" 127 | else: 128 | license_expr = "Apache-2.0" 129 | 130 | setup( 131 | name=package_name, 132 | version="3.0.10.0.1", 133 | license=license_expr, 134 | license_files=tuple(license_files), 135 | package_dir={"": "oiio_python"}, 136 | packages=find_packages(where="oiio_python"), 137 | package_data=package_data, 138 | include_package_data=include_data, 139 | ext_modules=[], 140 | distclass=BinaryDistribution, 141 | entry_points={ 142 | "console_scripts": scripts_list, 143 | }, 144 | zip_safe=zip_safe, # Required for including DLLs and PYDs in wheel 145 | description="Unofficial OpenImageIO Python wheels, including OpenColorIO", 146 | long_description=long_description, 147 | long_description_content_type="text/markdown", 148 | author="Paul Parneix", 149 | url="https://github.com/pypoulp/oiio-python", 150 | classifiers=[ 151 | "Programming Language :: Python", 152 | "Programming Language :: Python :: 3", 153 | "Programming Language :: Python :: 3 :: Only", 154 | "Programming Language :: Python :: 3.8", 155 | "Programming Language :: Python :: 3.9", 156 | "Programming Language :: Python :: 3.10", 157 | "Programming Language :: Python :: 3.11", 158 | "Programming Language :: Python :: 3.12", 159 | "Programming Language :: Python :: 3.13", 160 | "Programming Language :: C++", 161 | "Programming Language :: Python :: Implementation :: CPython", 162 | ], 163 | python_requires=">=3.8,<3.14", 164 | install_requires=[ 165 | "numpy>=1.21.2,<2.3.0", 166 | ], 167 | extras_require={ 168 | "dev": [ 169 | "twine", 170 | "black==24.2.0", 171 | "isort==5.13.2", 172 | ], 173 | }, 174 | keywords=[ 175 | "OpenImageIO", 176 | "OpenColorIO", 177 | "image", 178 | "processing", 179 | "oiio", 180 | "ocio", 181 | "python", 182 | "wrapper", 183 | "binding", 184 | "library", 185 | ], 186 | ) 187 | -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libtiff/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from conan import ConanFile 4 | from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout 5 | from conan.tools.files import ( 6 | apply_conandata_patches, 7 | copy, 8 | export_conandata_patches, 9 | get, 10 | replace_in_file, 11 | rm, 12 | rmdir, 13 | ) 14 | from conan.tools.microsoft import is_msvc 15 | from conan.tools.scm import Version 16 | 17 | required_conan_version = ">=1.53.0" 18 | 19 | 20 | class LibtiffConan(ConanFile): 21 | name = "libtiff" 22 | description = "Library for Tag Image File Format (TIFF)" 23 | url = "https://github.com/conan-io/conan-center-index" 24 | license = "libtiff" 25 | homepage = "http://www.simplesystems.org/libtiff" 26 | topics = ("tiff", "image", "bigtiff", "tagged-image-file-format") 27 | 28 | package_type = "library" 29 | settings = "os", "arch", "compiler", "build_type" 30 | options = { 31 | "shared": [True, False], 32 | "fPIC": [True, False], 33 | "cxx": [True, False], 34 | } 35 | default_options = { 36 | "shared": False, 37 | "fPIC": True, 38 | "cxx": True, 39 | } 40 | 41 | def export_sources(self): 42 | export_conandata_patches(self) 43 | 44 | def config_options(self): 45 | if self.settings.os == "Windows": 46 | del self.options.fPIC 47 | 48 | def configure(self): 49 | if self.options.shared: 50 | self.options.rm_safe("fPIC") 51 | if not self.options.cxx: 52 | self.settings.rm_safe("compiler.cppstd") 53 | self.settings.rm_safe("compiler.libcxx") 54 | 55 | def layout(self): 56 | cmake_layout(self, src_folder="src") 57 | 58 | @property 59 | def dont_use_jpeg_turbo(self): 60 | if os.getenv("MUSLLINUX_BUILD") == "1": 61 | return True 62 | elif os.getenv("OIIO_STATIC") == "1" and self.settings.os in [ 63 | "Linux", 64 | "FreeBSD", 65 | ]: 66 | return True 67 | return False 68 | 69 | def requirements(self): 70 | 71 | if self.dont_use_jpeg_turbo: 72 | self.requires("libjpeg/9e") 73 | else: 74 | self.requires("libjpeg-turbo/3.0.4") 75 | 76 | self.requires("zlib/[>=1.2.11 <2]") 77 | self.requires("libdeflate/1.19") 78 | self.requires("xz_utils/[>=5.4.5 <6]") 79 | self.requires("jbig/20160605") 80 | self.requires("zstd/1.5.5") 81 | self.requires("libwebp/1.4.0") 82 | 83 | def build_requirements(self): 84 | self.tool_requires("cmake/[>=3.18 <4]") 85 | 86 | def source(self): 87 | get(self, **self.conan_data["sources"][self.version], strip_root=True) 88 | 89 | def generate(self): 90 | tc = CMakeToolchain(self) 91 | tc.variables["lzma"] = True 92 | tc.variables["jpeg"] = True 93 | tc.variables["jpeg12"] = False 94 | tc.variables["jbig"] = True 95 | tc.variables["zlib"] = True 96 | tc.variables["libdeflate"] = True 97 | tc.variables["zstd"] = True 98 | tc.variables["webp"] = True 99 | tc.variables["lerc"] = ( 100 | False # TODO: add lerc support for libtiff versions >= 4.3.0 101 | ) 102 | # Disable tools, test, contrib, man & html generation 103 | tc.variables["tiff-tools"] = False 104 | tc.variables["tiff-tests"] = False 105 | tc.variables["tiff-contrib"] = False 106 | tc.variables["tiff-docs"] = False 107 | tc.variables["cxx"] = self.options.cxx 108 | # BUILD_SHARED_LIBS must be set in command line because defined upstream before project() 109 | tc.cache_variables["BUILD_SHARED_LIBS"] = bool(self.options.shared) 110 | tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = True 111 | tc.generate() 112 | deps = CMakeDeps(self) 113 | deps.set_property("jbig", "cmake_target_name", "JBIG::JBIG") 114 | deps.set_property("xz_utils", "cmake_target_name", "liblzma::liblzma") 115 | deps.set_property("libdeflate", "cmake_file_name", "Deflate") 116 | deps.set_property("libdeflate", "cmake_target_name", "Deflate::Deflate") 117 | deps.generate() 118 | 119 | def _patch_sources(self): 120 | apply_conandata_patches(self) 121 | 122 | # remove FindXXXX for conan dependencies 123 | for module in [ 124 | "Deflate", 125 | "JBIG", 126 | "JPEG", 127 | "LERC", 128 | "WebP", 129 | "ZSTD", 130 | "liblzma", 131 | "LibLZMA", 132 | ]: 133 | rm(self, f"Find{module}.cmake", os.path.join(self.source_folder, "cmake")) 134 | 135 | # Export symbols of tiffxx for msvc shared 136 | replace_in_file( 137 | self, 138 | os.path.join(self.source_folder, "libtiff", "CMakeLists.txt"), 139 | "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})", 140 | "set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION} WINDOWS_EXPORT_ALL_SYMBOLS ON)", 141 | ) 142 | 143 | def build(self): 144 | self._patch_sources() 145 | cmake = CMake(self) 146 | cmake.configure() 147 | cmake.build() 148 | 149 | def package(self): 150 | license_file = "LICENSE.md" 151 | copy( 152 | self, 153 | license_file, 154 | src=self.source_folder, 155 | dst=os.path.join(self.package_folder, "licenses"), 156 | ignore_case=True, 157 | keep_path=False, 158 | ) 159 | cmake = CMake(self) 160 | cmake.install() 161 | rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) 162 | rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 163 | 164 | def package_info(self): 165 | self.cpp_info.set_property("cmake_find_mode", "both") 166 | self.cpp_info.set_property("cmake_file_name", "TIFF") 167 | self.cpp_info.set_property("cmake_target_name", "TIFF::TIFF") 168 | self.cpp_info.set_property( 169 | "pkg_config_name", f"libtiff-{Version(self.version).major}" 170 | ) 171 | suffix = "d" if is_msvc(self) and self.settings.build_type == "Debug" else "" 172 | if self.options.cxx: 173 | self.cpp_info.libs.append(f"tiffxx{suffix}") 174 | self.cpp_info.libs.append(f"tiff{suffix}") 175 | if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]: 176 | self.cpp_info.system_libs.append("m") 177 | 178 | self.cpp_info.requires = [] 179 | 180 | self.cpp_info.requires.append("libdeflate::libdeflate") 181 | self.cpp_info.requires.append("xz_utils::xz_utils") 182 | # Dependencies 183 | if self.dont_use_jpeg_turbo: 184 | self.cpp_info.requires.append("libjpeg::libjpeg") 185 | else: 186 | self.cpp_info.requires.append("libjpeg-turbo::libjpeg-turbo") 187 | 188 | self.cpp_info.requires.append("zlib::zlib") 189 | self.cpp_info.requires.append("jbig::jbig") 190 | self.cpp_info.requires.append("zstd::zstd") 191 | self.cpp_info.requires.append("libwebp::libwebp") 192 | 193 | # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed 194 | self.cpp_info.names["cmake_find_package"] = "TIFF" 195 | self.cpp_info.names["cmake_find_package_multi"] = "TIFF" 196 | -------------------------------------------------------------------------------- /setuputils/macos_fix_shared_libs.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=W0718 2 | """ 3 | This module provides utilities for managing and updating library references and RPATHs 4 | on macOS. It includes functions to check and modify RPATH entries, update library 5 | references, and ensure proper relinking for binaries and dynamic libraries. 6 | 7 | The script is particularly useful for projects that involve bundling shared libraries 8 | and need precise control over their paths and dependencies. 9 | """ 10 | 11 | import subprocess 12 | import os 13 | from pathlib import Path 14 | 15 | project = Path(__file__).parent.parent.resolve() 16 | 17 | 18 | def check_and_add_rpath(binary_path, rpath): 19 | """ 20 | Checks if an LC_RPATH entry exists in the given binary and adds it if missing. 21 | 22 | Args: 23 | binary_path (Path or str): The path to the binary or shared library. 24 | rpath (str): The RPATH to add. 25 | 26 | Raises: 27 | subprocess.CalledProcessError: If an error occurs while executing `otool` or `install_name_tool`. 28 | """ 29 | try: 30 | result = subprocess.run( 31 | ["otool", "-l", str(binary_path)], 32 | capture_output=True, 33 | text=True, 34 | check=True, 35 | ) 36 | if rpath in result.stdout: 37 | print(f"RPATH '{rpath}' already exists in {binary_path}") 38 | else: 39 | subprocess.run( 40 | ["install_name_tool", "-add_rpath", rpath, str(binary_path)], check=True 41 | ) 42 | print(f"Added RPATH '{rpath}' to {binary_path}") 43 | except subprocess.CalledProcessError as e: 44 | print(f"Error checking or adding RPATH: {e}") 45 | 46 | 47 | def update_rpath_references(libs_dir, target_names): 48 | """ 49 | Updates `@rpath` references in dynamic libraries to use `@loader_path`. 50 | 51 | Args: 52 | libs_dir (Path or str): Directory containing the dynamic libraries to process. 53 | target_names (list of str): List of target library names to update. 54 | 55 | Raises: 56 | subprocess.CalledProcessError: If an error occurs while executing `otool` or `install_name_tool`. 57 | """ 58 | libs_dir = Path(libs_dir) 59 | for dylib in libs_dir.glob("*.dylib"): 60 | try: 61 | result = subprocess.run( 62 | ["otool", "-L", str(dylib)], capture_output=True, text=True, check=True 63 | ) 64 | for line in result.stdout.splitlines(): 65 | for target_name in target_names: 66 | if target_name in line: 67 | old_path = line.split()[0] 68 | new_path = f"@loader_path/{Path(old_path).name}" 69 | subprocess.run( 70 | [ 71 | "install_name_tool", 72 | "-change", 73 | old_path, 74 | new_path, 75 | str(dylib), 76 | ], 77 | check=True, 78 | ) 79 | print(f"Updated {old_path} -> {new_path} in {dylib}") 80 | except subprocess.CalledProcessError as e: 81 | print(f"Error processing {dylib}: {e}") 82 | 83 | 84 | def ensure_rpaths(binaries, rpath): 85 | """ 86 | Ensures that the specified LC_RPATH exists in all provided binaries. 87 | 88 | Args: 89 | binaries (list of Path or str): List of binaries or shared libraries. 90 | rpath (str): The RPATH to ensure. 91 | 92 | Raises: 93 | subprocess.CalledProcessError: If an error occurs while adding the RPATH. 94 | """ 95 | for binary in binaries: 96 | check_and_add_rpath(binary, rpath) 97 | 98 | 99 | def relink_and_delocate(): 100 | """ 101 | Relinks binaries and shared libraries by updating RPATH references and ensuring 102 | proper LC_RPATH entries. This is the main function of the script, orchestrating 103 | the process for the project. 104 | 105 | Steps performed: 106 | 1. Verify required files exist in the expected locations. 107 | 2. Update `@rpath` references in dynamic libraries to use `@loader_path`. 108 | 3. Ensure LC_RPATH entries for all binaries and libraries. 109 | 110 | Raises: 111 | FileNotFoundError: If required files are missing. 112 | subprocess.CalledProcessError: If an error occurs during subprocess execution. 113 | Exception: For any other unexpected errors. 114 | """ 115 | try: 116 | base_path = project / "oiio_python" 117 | libs_dir = base_path / "libs" 118 | libs_dir.mkdir(parents=True, exist_ok=True) 119 | 120 | # Define paths for libraries and modules 121 | oiio_so = next((base_path / "OpenImageIO").glob("*.so")) 122 | ocio_so = next((base_path / "PyOpenColorIO").glob("*.so")) 123 | 124 | if os.getenv("OIIO_STATIC") != "1": 125 | lib_oiio = max( 126 | ( 127 | f 128 | for f in libs_dir.glob("libOpenImageIO.*.dylib") 129 | if not f.is_symlink() 130 | ), 131 | key=lambda f: f.stat().st_size, 132 | ) 133 | lib_ocio = max( 134 | ( 135 | f 136 | for f in libs_dir.glob("libOpenColorIO.*.dylib") 137 | if not f.is_symlink() 138 | ), 139 | key=lambda f: f.stat().st_size, 140 | ) 141 | lib_tbb = libs_dir / "libtbb.12.10.dylib" 142 | 143 | # Check required files exist 144 | required_files = [oiio_so, ocio_so, lib_oiio, lib_ocio, lib_tbb] 145 | for path in required_files: 146 | if not path.is_file(): 147 | raise FileNotFoundError(f"Required file '{path}' does not exist.") 148 | 149 | # Update RPATH references for all the dylibs. 150 | update_rpath_references( 151 | libs_dir, 152 | [ 153 | "libtbb", 154 | "libtbbmalloc", 155 | "libtbbmalloc_proxy", 156 | "libOpenImageIO", 157 | "libOpenColorIO", 158 | "libOpenImageIO_Util", 159 | "libheif", 160 | "libraw", 161 | ], 162 | ) 163 | 164 | # Ensure LC_RPATH for all binaries 165 | ensure_rpaths( 166 | [oiio_so, ocio_so, lib_oiio, lib_ocio, lib_tbb], "@loader_path" 167 | ) 168 | ensure_rpaths([oiio_so, ocio_so], "@loader_path/../../.dylibs") 169 | 170 | else: 171 | # Static build: only TBB is required to be relocated. 172 | lib_tbb = libs_dir / "libtbb.12.10.dylib" 173 | 174 | # Check required files exist 175 | required_files = [lib_tbb] 176 | for path in required_files: 177 | if not path.is_file(): 178 | raise FileNotFoundError(f"Required file '{path}' does not exist.") 179 | 180 | # Update RPATH references for TBB dylibs. 181 | update_rpath_references( 182 | libs_dir, 183 | [ 184 | "libtbb", 185 | "libtbbmalloc", 186 | "libtbbmalloc_proxy", 187 | ], 188 | ) 189 | 190 | # Ensure LC_RPATH for all binaries 191 | ensure_rpaths([oiio_so, ocio_so, lib_tbb], "@loader_path") 192 | 193 | print("Relinking and RPATH configuration completed successfully.") 194 | 195 | except subprocess.CalledProcessError as e: 196 | print(f"Error during relinking or RPATH configuration: {e}") 197 | except FileNotFoundError as e: 198 | print(e) 199 | except Exception as e: 200 | print(f"Unexpected error: {e}") 201 | 202 | 203 | if __name__ == "__main__": 204 | relink_and_delocate() 205 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **oiio-python** 2 | 3 | **🐍 OpenImageIO on wheels!** 4 | 5 | This project provides (unofficial) multiplatform wheels for [OpenImageIO](https://github.com/AcademySoftwareFoundation/OpenImageIO) Python bindings, simplifying installation and integration into Python projects. 6 | 7 | [![PyPI Downloads](https://static.pepy.tech/badge/oiio-python/month)](https://pepy.tech/projects/oiio-python) 8 | 9 | Check [types-oiio-python](https://github.com/pypoulp/types-oiio-python) if you want type hints & auto-completion for oiio-python. 10 | 11 | [![Build Static Multiplatform Wheels](https://github.com/pypoulp/oiio-python/actions/workflows/build_static_wheels.yml/badge.svg)](https://github.com/pypoulp/oiio-python/actions/workflows/build_static_wheels.yml) 12 | [![Build Multiplatform Wheels](https://github.com/pypoulp/oiio-python/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/pypoulp/oiio-python/actions/workflows/build_wheels.yml) 13 | [![Build Linux Wheels](https://github.com/pypoulp/oiio-python/actions/workflows/build_linux_wheels.yml/badge.svg)](https://github.com/pypoulp/oiio-python/actions/workflows/build_linux_wheels.yml) 14 | 15 | 16 | **Note:** Official wheels are now available 🎉 ! I'll continue to maintain these builds aside cos they still provide some extra stuff, like integrated PyOpenColorIO, and more enabled features. 17 | 18 | --- 19 | 20 | ## **Features** 21 | 22 | - **🚀 Easy Installation**: Install via pip—no need to compile. 23 | - **🌐 Multiplatform**: Supports Windows (x86_64), macOS (x86_64 and arm64), and Linux (x86_64 and aarch64). 24 | 25 | - **🎨 Integrated OpenColorIO**: Includes PyOpenColorIO for seamless color management. 26 | - **⚙️ Automated Builds**: Built using [Conan](https://docs.conan.io/2/), [Cibuildwheel](https://cibuildwheel.pypa.io/en/stable/), and [GitHub Actions](https://github.com/features/actions). 27 | - **📦 Flexible Libraries**: Choose between static and shared libraries to suit your needs. 28 | 29 | --- 30 | 31 | 32 | ## **Installation** 33 | 34 | ```bash 35 | # ensure pip is up-to-date: 36 | python -m pip install --upgrade pip 37 | 38 | # Install the shared libraries variant: 39 | pip install oiio-python 40 | 41 | # Install the static libraries variant: 42 | pip install oiio-static-python 43 | ``` 44 | 45 | This project avoids using the `openimageio` package name because the ASWF may release official wheels in the future. 46 | 47 | You do NOT need to have OpenImageIO installed on your system. `oiio-python` ship with all necessary shared libraries. 48 | 49 | ## **What's Included** 50 | 51 | The goal is to enable as many features as possible to make the wheel flexible, while keeping the package size reasonable. 52 | 53 | OpenImageIO wheels are built with the following features enabled: 54 | 55 | - **[OpenColorIO](https://opencolorio.org/)**: With Python bindings included for seamless color management. 56 | - **LibRaw**: Adds RAW image support. 57 | - **OpenEXR**: High dynamic range image support. 58 | - **Ptex**: Ptex texture mapping support. 59 | - **OneTBB**: Multithreading support. 60 | - **FreeType**: Enables text rendering. 61 | - **TBB**: Multithreading support with Intel TBB. Disabled in musllinux/static MacOS builds. 62 | - **libwebp**: WebP image support. 63 | - **libpng**: PNG image support. 64 | - **libjpeg**: Support with libjpeg on musllinux, and manylinux static builds, libjpeg-turbo on other platforms. 65 | - **giflib**: GIF support. 66 | - **hdf5**: HDF5 data storage support. 67 | - **libheif**: HEIF/AVIF image support. 68 | - **libtiff**: TIFF image support. 69 | - **libjxl**: JPEG XL image support. 70 | - **libultrahdr**: Adds support for UltraHDR images. 71 | - **OpenJPEG**: JPEG 2000 support. 72 | 73 | *FFmpeg is not included due to potential licensing issues and package size.* 74 | 75 | *DICOM support is also not enabled because of large package size.* 76 | 77 | *Volumetric format support like **OpenVDB** are not included for now but could be in the future if requested.* 78 | 79 | --- 80 | 81 | ## **oiio-python vs oiio-static-python** 82 | 83 | This project builds two variants of the OpenImageIO Python bindings: 84 | 85 | - **`oiio-python`**: 86 | - Links against shared OpenImageIO and OpenColorIO libraries. 87 | - Generally smaller package size. 88 | - Includes tools like `oiiotool` and `ociobakelut`. 89 | 90 | - **`oiio-static-python`**: 91 | - Uses statically linked dependencies. 92 | - Generally larger package size. 93 | - Does **not** include OpenImageIO and OpenColorIO tools. 94 | - **Ideal for avoiding DLL conflicts**, especially when using Python embedded in applications like DCC tools that already use OpenImageIO. 95 | 96 | `oiio-python` versions match the original OpenImageIO release version, with an additional build number for the Python bindings. Example oiio-python 2.5.12.0.x is built from OpenImageIO 2.5.12 97 | 98 | ## License 99 | 100 | Code in this repository is licensed under the [Apache 2.0 License](LICENSE) to match the original OpenImageIO license. 101 | Third-party libraries are licensed under their respective licenses. Copies of these licenses can be found in the [licenses](licenses) folder. 102 | 103 | #### Statically Linked Libraries in Binary Wheels 104 | 105 | The binary wheels may include LGPL statically linked libraries, including: 106 | 107 | - **[LibRaw](https://github.com/LibRaw/LibRaw)** (LGPL 2.1) 108 | - **[LibHeif](https://github.com/strukturag/libheif)** (LGPL 3.0) 109 | 110 | #### Licensing for Versions Before 3.0.1.0 111 | 112 | Before version 3.0.1.0, the distributed wheels are licensed under the [GPL 3.0 License](LICENSE-GPL). 113 | 114 | #### Licensing for Versions 3.0.1.0 and Above 115 | 116 | For version 3.0.1.0 and above: 117 | 118 | - **`oiio-static-python` wheels** are licensed under the [GPL 3.0 License](LICENSE-GPL). 119 | - **`oiio-python` wheels** are licensed under the [Apache 2.0 License](LICENSE) and include shared libraries for LibRaw and LibHeif. 120 | 121 | 122 | ## **Building the Wheels Yourself** 123 | 124 | Although the primary target is automated builds on GitHub Actions, you can also build the wheels locally. 125 | 126 | **Note:** Build system will use your `default` Conan profile to create a new `default_oiio_build` profile, make sure it's configured correctly. 127 | 128 | ### **Windows** 129 | 130 | 1. Install Python (3.11+ recommended), CMake, and Visual Studio. 131 | 2. To build wheels for multiple Python versions: 132 | 133 | ```powershell 134 | # For the static variant: 135 | set OIIO_STATIC=1 136 | python -m pip install cibuildwheel 137 | cibuildwheel --platform windows 138 | ``` 139 | 140 | 3. To only build for your current Python version: 141 | 142 | ```powershell 143 | python -m pip install build 144 | python -m build --wheel 145 | ``` 146 | 147 | ### **MacOS** 148 | 149 | 1. Install Python (3.11+ recommended), Homebrew, and Xcode. 150 | 2. Set environment variables before building: 151 | 152 | ```bash 153 | # If you want to build the static variant: 154 | export OIIO_STATIC=1 155 | # Set Deployment target according to your macOS version 156 | export MACOSX_DEPLOYMENT_TARGET=10.15 # For x86_64 builds 157 | export MACOSX_DEPLOYMENT_TARGET=14.0 # For arm64 builds 158 | # Set Project root directory to the root of the repository 159 | export PROJECT_ROOT="/path/to/oiio-python" 160 | ``` 161 | 162 | 3. To run cibuildwheel and build wheels for multiple python versions: 163 | 164 | ```bash 165 | python -m pip install cibuildwheel 166 | cibuildwheel --platform macos 167 | ``` 168 | 169 | 4. To only build for your current Python version: 170 | 171 | ```bash 172 | python -m pip install build 173 | python -m build --wheel 174 | ``` 175 | 176 | 5. If not building with cibuildwheel, you'll need to manually "repair" the wheel with delocate after build: 177 | 178 | 6. run provided `setuputils/macos_fix_shared_libs.py` 179 | 180 | 7. then use `delocate-wheel` to copy the shared libraries into the wheel: 181 | 182 | ```bash 183 | python -m pip install delocate 184 | 185 | export REPAIR_LIBRARY=$PROJECT_ROOT/oiio_python/libs:$DYLD_LIBRARY_PATH 186 | DYLD_LIBRARY_PATH=$REPAIR_LIBRARY delocate-wheel -w /repaired/out/folder -v /path/to/wheel -e $HOME/.conan2 187 | ``` 188 | 189 | ### **Linux** 190 | 191 | 1. Linux builds use Docker containers via cibuildwheel for compatibility. 192 | 2. Install Docker and build: 193 | 194 | ```bash 195 | # If building on musl (Alpine) Linux, set the following environment variable: 196 | export MUSLLINUX_BUILD=1 197 | export CIBW_ENVIRONMENT="OIIO_STATIC=1" # For the static version 198 | # Optional: Specify target docker image / platform 199 | export CIBW_BUILD="*manylinux_x86*" 200 | python -m pip install cibuildwheel 201 | cibuildwheel 202 | ``` 203 | 204 | 3. To build for the current Python version and distribution: 205 | 206 | - Ensure Perl is installed (required for dependencies). 207 | - Use `setuputils/linux_before_all.sh` if needed. 208 | 209 | 210 | ```bash 211 | python -m pip install build 212 | python -m build --wheel 213 | ``` 214 | 215 | 4. If not building with cibuildwheel, you'll need to manually "repair" the wheel with auditwheel after build: 216 | 217 | ```bash 218 | python -m pip install auditwheel 219 | 220 | export LD_LIBRARY_PATH=/path/to/oiio_python/libs:$LD_LIBRARY_PATH 221 | auditwheel repair -w /repaired/out/folder /path/to/wheel 222 | ``` 223 | 224 | ### **Notes** 225 | 226 | - I'm not an expert in Conan, CMake, or Cibuildwheel. Feedback and suggestions for improvement are highly appreciated. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /licenses/onetbb-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /licenses/openimageio-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /oiio_python/recipes/dependencies/libjxl/conanfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | from conan import ConanFile 5 | from conan.errors import ConanInvalidConfiguration 6 | from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library 7 | from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout 8 | from conan.tools.env import VirtualBuildEnv 9 | from conan.tools.files import copy, get, replace_in_file, rm, rmdir, save 10 | from conan.tools.gnu import PkgConfigDeps 11 | from conan.tools.microsoft import is_msvc 12 | from conan.tools.scm import Version 13 | 14 | required_conan_version = ">=1.53.0" 15 | 16 | here = Path(__file__).parent.resolve() 17 | 18 | 19 | class LibjxlConan(ConanFile): 20 | name = "libjxl" 21 | description = "JPEG XL image format reference implementation" 22 | license = "BSD-3-Clause" 23 | url = "https://github.com/conan-io/conan-center-index" 24 | homepage = "https://github.com/libjxl/libjxl" 25 | topics = ("image", "jpeg-xl", "jxl", "jpeg") 26 | 27 | package_type = "library" 28 | settings = "os", "arch", "compiler", "build_type" 29 | options = { 30 | "shared": [True, False], 31 | "fPIC": [True, False], 32 | "avx512": [True, False], 33 | "avx512_spr": [True, False], 34 | "avx512_zen4": [True, False], 35 | "with_tcmalloc": [True, False], 36 | } 37 | default_options = { 38 | "shared": False, 39 | "fPIC": True, 40 | "avx512": False, 41 | "avx512_spr": False, 42 | "avx512_zen4": False, 43 | "with_tcmalloc": False, 44 | } 45 | 46 | def export_sources(self): 47 | copy( 48 | self, 49 | "conan_deps.cmake", 50 | self.recipe_folder, 51 | os.path.join(self.export_sources_folder, "src"), 52 | ) 53 | 54 | def config_options(self): 55 | if self.settings.os == "Windows": 56 | del self.options.fPIC 57 | if self.settings.arch not in ["x86", "x86_64"] or Version(self.version) < "0.9": 58 | del self.options.avx512 59 | del self.options.avx512_spr 60 | del self.options.avx512_zen4 61 | # https://github.com/libjxl/libjxl/blob/v0.9.1/CMakeLists.txt#L52-L59 62 | # if self.settings.os in ["Linux", "FreeBSD"] and self.settings.arch == "x86_64": 63 | # self.options.with_tcmalloc = True 64 | 65 | def configure(self): 66 | if self.options.shared: 67 | self.options.rm_safe("fPIC") 68 | 69 | def layout(self): 70 | cmake_layout(self, src_folder="src") 71 | 72 | def requirements(self): 73 | self.requires("brotli/1.1.0") 74 | self.requires("highway/1.1.0") 75 | self.requires("lcms/2.16") 76 | if self.options.with_tcmalloc: 77 | self.requires("gperftools/2.12.0") 78 | 79 | def validate(self): 80 | if self.settings.compiler.cppstd: 81 | check_min_cppstd(self, 11) 82 | 83 | def build_requirements(self): 84 | # Require newer CMake, which allows INCLUDE_DIRECTORIES to be set on INTERFACE targets 85 | # Also, v0.9+ require CMake 3.16 86 | self.tool_requires("cmake/[>=3.19 <4]") 87 | 88 | def source(self): 89 | get(self, **self.conan_data["sources"][self.version], strip_root=True) 90 | 91 | def generate(self): 92 | VirtualBuildEnv(self).generate() 93 | 94 | tc = CMakeToolchain(self) 95 | tc.variables["CMAKE_PROJECT_LIBJXL_INCLUDE"] = ( 96 | here / "conan_deps.cmake" 97 | ).as_posix() 98 | tc.variables["BUILD_TESTING"] = False 99 | tc.variables["JPEGXL_STATIC"] = False 100 | tc.variables["JPEGXL_BUNDLE_LIBPNG"] = False 101 | tc.variables["JPEGXL_ENABLE_BENCHMARK"] = False 102 | tc.variables["JPEGXL_ENABLE_DOXYGEN"] = False 103 | tc.variables["JPEGXL_ENABLE_EXAMPLES"] = False 104 | tc.variables["JPEGXL_ENABLE_JNI"] = False 105 | tc.variables["JPEGXL_ENABLE_MANPAGES"] = False 106 | tc.variables["JPEGXL_ENABLE_OPENEXR"] = False 107 | tc.variables["JPEGXL_ENABLE_PLUGINS"] = False 108 | tc.variables["JPEGXL_ENABLE_SJPEG"] = False 109 | tc.variables["JPEGXL_ENABLE_SKCMS"] = False 110 | tc.variables["JPEGXL_ENABLE_TCMALLOC"] = self.options.with_tcmalloc 111 | tc.variables["JPEGXL_ENABLE_VIEWERS"] = False 112 | tc.variables["JPEGXL_ENABLE_TOOLS"] = False 113 | tc.variables["JPEGXL_FORCE_SYSTEM_BROTLI"] = True 114 | tc.variables["JPEGXL_FORCE_SYSTEM_GTEST"] = True 115 | tc.variables["JPEGXL_FORCE_SYSTEM_HWY"] = True 116 | tc.variables["JPEGXL_FORCE_SYSTEM_LCMS2"] = True 117 | tc.variables["JPEGXL_WARNINGS_AS_ERRORS"] = False 118 | tc.variables["JPEGXL_FORCE_NEON"] = False 119 | tc.variables["JPEGXL_ENABLE_AVX512"] = self.options.get_safe("avx512", False) 120 | tc.variables["JPEGXL_ENABLE_AVX512_SPR"] = self.options.get_safe( 121 | "avx512_spr", False 122 | ) 123 | tc.variables["JPEGXL_ENABLE_AVX512_ZEN4"] = self.options.get_safe( 124 | "avx512_zen4", False 125 | ) 126 | if cross_building(self): 127 | tc.variables["CMAKE_SYSTEM_PROCESSOR"] = str(self.settings.arch) 128 | # Allow non-cache_variables to be used 129 | tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" 130 | # Skip the buggy custom FindAtomic and force the use of atomic library directly for libstdc++ 131 | tc.variables["ATOMICS_LIBRARIES"] = "atomic" if self._atomic_required else "" 132 | if Version(self.version) >= "0.8": 133 | # TODO: add support for the jpegli JPEG encoder library 134 | tc.variables["JPEGXL_ENABLE_JPEGLI"] = False 135 | tc.variables["JPEGXL_ENABLE_JPEGLI_LIBJPEG"] = False 136 | # TODO: can hopefully be removed in newer versions 137 | # https://github.com/libjxl/libjxl/issues/3159 138 | if ( 139 | Version(self.version) >= "0.9" 140 | and self.settings.build_type == "Debug" 141 | and is_msvc(self) 142 | ): 143 | tc.preprocessor_definitions["JXL_DEBUG_V_LEVEL"] = 1 144 | tc.generate() 145 | 146 | deps = CMakeDeps(self) 147 | deps.set_property("brotli", "cmake_file_name", "Brotli") 148 | deps.set_property("highway", "cmake_file_name", "HWY") 149 | deps.set_property("lcms", "cmake_file_name", "LCMS2") 150 | deps.generate() 151 | 152 | # For tcmalloc 153 | deps = PkgConfigDeps(self) 154 | deps.generate() 155 | 156 | @property 157 | def _atomic_required(self): 158 | return self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"] 159 | 160 | def _patch_sources(self): 161 | # Disable tools, extras and third_party 162 | save(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "") 163 | save( 164 | self, os.path.join(self.source_folder, "third_party", "CMakeLists.txt"), "" 165 | ) 166 | # FindAtomics.cmake values are set by CMakeToolchain instead 167 | save(self, os.path.join(self.source_folder, "cmake", "FindAtomics.cmake"), "") 168 | 169 | # Allow fPIC to be set by Conan 170 | replace_in_file( 171 | self, 172 | os.path.join(self.source_folder, "CMakeLists.txt"), 173 | "set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)", 174 | "", 175 | ) 176 | for cmake_file in [ 177 | "jxl.cmake", 178 | "jxl_threads.cmake", 179 | "jxl_cms.cmake", 180 | "jpegli.cmake", 181 | ]: 182 | path = os.path.join(self.source_folder, "lib", cmake_file) 183 | if os.path.exists(path): 184 | fpic = "ON" if self.options.get_safe("fPIC", True) else "OFF" 185 | replace_in_file( 186 | self, 187 | path, 188 | "POSITION_INDEPENDENT_CODE ON", 189 | f"POSITION_INDEPENDENT_CODE {fpic}", 190 | ) 191 | 192 | def build(self): 193 | self._patch_sources() 194 | cmake = CMake(self) 195 | cmake.configure() 196 | cmake.build() 197 | 198 | def package(self): 199 | cmake = CMake(self) 200 | cmake.install() 201 | copy( 202 | self, 203 | "LICENSE", 204 | self.source_folder, 205 | os.path.join(self.package_folder, "licenses"), 206 | ) 207 | rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 208 | if self.options.shared: 209 | rm(self, "*.a", os.path.join(self.package_folder, "lib")) 210 | rm(self, "*-static.lib", os.path.join(self.package_folder, "lib")) 211 | 212 | def _lib_name(self, name): 213 | if ( 214 | Version(self.version) < "0.9" 215 | and not self.options.shared 216 | and self.settings.os == "Windows" 217 | ): 218 | return name + "-static" 219 | return name 220 | 221 | def package_info(self): 222 | libcxx = stdcpp_library(self) 223 | 224 | # jxl 225 | self.cpp_info.components["jxl"].set_property("pkg_config_name", "libjxl") 226 | self.cpp_info.components["jxl"].libs = [self._lib_name("jxl")] 227 | self.cpp_info.components["jxl"].requires = [ 228 | "brotli::brotli", 229 | "highway::highway", 230 | "lcms::lcms", 231 | ] 232 | if self.options.with_tcmalloc: 233 | self.cpp_info.components["jxl"].requires.append( 234 | "gperftools::tcmalloc_minimal" 235 | ) 236 | if self._atomic_required: 237 | self.cpp_info.components["jxl"].system_libs.append("atomic") 238 | if not self.options.shared: 239 | self.cpp_info.components["jxl"].defines.append("JXL_STATIC_DEFINE") 240 | if libcxx: 241 | self.cpp_info.components["jxl"].system_libs.append(libcxx) 242 | 243 | # jxl_cms 244 | if Version(self.version) >= "0.9.0": 245 | self.cpp_info.components["jxl_cms"].set_property( 246 | "pkg_config_name", "libjxl_cms" 247 | ) 248 | self.cpp_info.components["jxl_cms"].libs = [self._lib_name("jxl_cms")] 249 | self.cpp_info.components["jxl_cms"].requires = [ 250 | "lcms::lcms", 251 | "highway::highway", 252 | ] 253 | if not self.options.shared: 254 | self.cpp_info.components["jxl"].defines.append("JXL_CMS_STATIC_DEFINE") 255 | if libcxx: 256 | self.cpp_info.components["jxl_cms"].system_libs.append(libcxx) 257 | 258 | # jxl_dec 259 | if Version(self.version) < "0.9.0": 260 | if not self.options.shared: 261 | self.cpp_info.components["jxl_dec"].set_property( 262 | "pkg_config_name", "libjxl_dec" 263 | ) 264 | self.cpp_info.components["jxl_dec"].libs = [self._lib_name("jxl_dec")] 265 | self.cpp_info.components["jxl_dec"].requires = [ 266 | "brotli::brotli", 267 | "highway::highway", 268 | "lcms::lcms", 269 | ] 270 | if libcxx: 271 | self.cpp_info.components["jxl_dec"].system_libs.append(libcxx) 272 | 273 | # jxl_threads 274 | self.cpp_info.components["jxl_threads"].set_property( 275 | "pkg_config_name", "libjxl_threads" 276 | ) 277 | self.cpp_info.components["jxl_threads"].libs = [self._lib_name("jxl_threads")] 278 | if self.settings.os in ["Linux", "FreeBSD"]: 279 | self.cpp_info.components["jxl_threads"].system_libs = ["pthread"] 280 | if not self.options.shared: 281 | self.cpp_info.components["jxl_threads"].defines.append( 282 | "JXL_THREADS_STATIC_DEFINE" 283 | ) 284 | if libcxx: 285 | self.cpp_info.components["jxl_threads"].system_libs.append(libcxx) 286 | -------------------------------------------------------------------------------- /oiio_python/recipes/opencolorio/conanfile.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=E1101,C0114,C0115,C0116 2 | 3 | import os 4 | import platform 5 | import sys 6 | from pathlib import Path 7 | 8 | from conan import ConanFile 9 | from conan.errors import ConanInvalidConfiguration 10 | from conan.tools.apple import is_apple_os 11 | from conan.tools.build import check_min_cppstd, default_cppstd 12 | from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout 13 | from conan.tools.files import ( 14 | apply_conandata_patches, 15 | copy, 16 | export_conandata_patches, 17 | get, 18 | rm, 19 | rmdir, 20 | ) 21 | from conan.tools.microsoft import is_msvc 22 | from conan.tools.scm import Version 23 | 24 | 25 | class OpenColorIOConan(ConanFile): 26 | name = "opencolorio" 27 | description = "A color management framework for visual effects and animation." 28 | license = "BSD-3-Clause" 29 | homepage = "https://opencolorio.org/" 30 | url = "https://github.com/conan-io/conan-center-index" 31 | topics = ("colors", "visual", "effects", "animation") 32 | settings = "os", "arch", "compiler", "build_type" 33 | package_type = "library" 34 | options = { 35 | "shared": [True, False], 36 | "fPIC": [True, False], 37 | "use_sse": [True, False], 38 | } 39 | default_options = { 40 | "shared": os.getenv("OIIO_STATIC") != "1", 41 | "fPIC": True, 42 | "use_sse": True, 43 | } 44 | # tool_requires = "cmake/[>=3.16 <4]" 45 | 46 | def export_sources(self): 47 | export_conandata_patches(self) 48 | 49 | def config_options(self): 50 | if self.settings.os == "Windows": # pylint: disable=no-member 51 | del self.options.fPIC 52 | if self.settings.arch not in ["x86", "x86_64"]: # pylint: disable=no-member 53 | del self.options.use_sse 54 | 55 | # Use static libraries for dependencies 56 | self.options["expat"].shared = False 57 | self.options["openexr"].shared = False 58 | self.options["yaml-cpp"].shared = False 59 | self.options["pystring"].shared = False 60 | self.options["lcms"].shared = False 61 | 62 | # Set minizip-ng options for macOS 63 | if is_apple_os(self): 64 | self.options["minizip-ng"].with_zlib = True 65 | self.options["minizip-ng"].with_libcomp = False 66 | 67 | def configure(self): 68 | if self.options.shared: 69 | self.options.rm_safe("fPIC") 70 | 71 | def layout(self): 72 | cmake_layout(self, src_folder="src") 73 | 74 | def build_requirements(self): 75 | self.tool_requires("cmake/[>=3.27 <4]") 76 | 77 | def requirements(self): 78 | self.requires("expat/[>=2.6.2 <3]") 79 | self.requires("openexr/3.3.1") 80 | self.requires("imath/3.1.9") 81 | 82 | self.requires("pystring/1.1.4") 83 | self.requires("yaml-cpp/0.8.0") 84 | self.requires("pybind11/2.13.6") 85 | self.requires("minizip-ng/4.0.3") 86 | 87 | # for tools only 88 | self.requires("lcms/2.16") 89 | 90 | def validate(self): 91 | if self.settings.compiler.get_safe("cppstd"): # pylint: disable=no-member 92 | check_min_cppstd(self, 11) 93 | if ( 94 | Version(self.version) >= "2.3.0" 95 | and self.settings.compiler == "gcc" # pylint: disable=no-member 96 | and Version(self.settings.compiler.version) 97 | < "6.0" # pylint: disable=no-member 98 | ): 99 | raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 6.0") 100 | 101 | if ( 102 | Version(self.version) >= "2.3.0" 103 | and self.settings.compiler == "clang" 104 | and self.settings.compiler.libcxx == "libc++" 105 | ): # pylint: disable=no-member 106 | raise ConanInvalidConfiguration( 107 | f"{self.ref} deosn't support clang with libc++" 108 | ) 109 | 110 | # opencolorio>=2.2.0 requires minizip-ng with with_zlib 111 | if Version(self.version) >= "2.2.0" and not self.dependencies[ 112 | "minizip-ng" 113 | ].options.get_safe("with_zlib", False): 114 | raise ConanInvalidConfiguration( 115 | f"{self.ref} requires minizip-ng with with_zlib = True. On Apple platforms with_libcomp = False is also needed to enable the with_zlib option." 116 | ) 117 | 118 | if ( 119 | Version(self.version) >= "2.2.1" 120 | and self.options.shared 121 | and self.dependencies["minizip-ng"].options.shared 122 | ): 123 | raise ConanInvalidConfiguration( 124 | f"{self.ref} requires static build minizip-ng" 125 | ) 126 | 127 | def source(self): 128 | get( 129 | self, **self.conan_data["sources"][self.version], strip_root=True 130 | ) # pylint: disable=no-member 131 | 132 | def generate(self): 133 | tc = CMakeToolchain(self) 134 | tc.cppstd = default_cppstd(self) 135 | 136 | # Tell pybind11 to use the newer FindPython module instead of deprecated FindPythonLibs 137 | tc.variables["PYBIND11_FINDPYTHON"] = True 138 | 139 | # Set Python paths for CMake FindPython 140 | python_exe = Path(os.path.realpath(sys.executable)) 141 | tc.variables["Python_EXECUTABLE"] = python_exe.as_posix() 142 | tc.variables["Python3_EXECUTABLE"] = python_exe.as_posix() 143 | 144 | # Help CMake find Python on Windows 145 | if self.settings.os == "Windows": # pylint: disable=no-member 146 | tc.variables["Python_ROOT_DIR"] = Path(sys.prefix).as_posix() 147 | tc.variables["Python3_ROOT_DIR"] = Path(sys.prefix).as_posix() 148 | 149 | # Python 3.13 specific workaround (same as OpenImageIO) 150 | if sys.version_info[:2] == (3, 13): 151 | import sysconfig 152 | python_root = Path(sys.prefix) 153 | lib_dir = python_root / "libs" 154 | if not lib_dir.exists(): 155 | lib_dir = python_root / "lib" 156 | 157 | python_lib = lib_dir / f"python{sys.version_info.major}{sys.version_info.minor}.lib" 158 | if not python_lib.exists(): 159 | python_lib = lib_dir / f"python{sys.version_info.major}.{sys.version_info.minor}.lib" 160 | 161 | include_dir = Path(sysconfig.get_path('include')) 162 | 163 | print(f"Python 3.13 Windows workaround for OpenColorIO:") 164 | print(f" Root: {python_root}") 165 | print(f" Library: {python_lib}") 166 | print(f" Include: {include_dir}") 167 | 168 | if python_lib.exists(): 169 | tc.variables["Python3_LIBRARY"] = python_lib.as_posix() 170 | if include_dir.exists(): 171 | tc.variables["Python3_INCLUDE_DIR"] = include_dir.as_posix() 172 | 173 | tc.variables["OCIO_BUILD_PYTHON"] = True 174 | tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True 175 | tc.variables["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) 176 | 177 | # openexr 2.x provides Half library 178 | tc.variables["OCIO_USE_OPENEXR_HALF"] = True 179 | tc.variables["OCIO_BUILD_APPS"] = os.getenv("OIIO_STATIC") != "1" 180 | tc.variables["OCIO_BUILD_DOCS"] = False 181 | tc.variables["OCIO_BUILD_TESTS"] = False 182 | tc.variables["OCIO_BUILD_GPU_TESTS"] = False 183 | tc.variables["OCIO_USE_BOOST_PTR"] = False 184 | 185 | # avoid downloading dependencies 186 | tc.variables["OCIO_INSTALL_EXT_PACKAGE"] = "NONE" 187 | 188 | if is_msvc(self) and not self.options.shared: 189 | # define any value because ifndef is used 190 | tc.variables["OpenColorIO_SKIP_IMPORTS"] = True 191 | 192 | tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" 193 | tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0091"] = "NEW" 194 | tc.generate() 195 | 196 | deps = CMakeDeps(self) 197 | deps.generate() 198 | 199 | def _patch_sources(self): 200 | apply_conandata_patches(self) 201 | 202 | for module in ("expat", "lcms2", "pystring", "yaml-cpp", "Imath", "minizip-ng"): 203 | rm( 204 | self, 205 | "Find" + module + ".cmake", 206 | os.path.join(self.source_folder, "share", "cmake", "modules"), 207 | ) 208 | 209 | def build(self): 210 | self._patch_sources() 211 | 212 | cm = CMake(self) 213 | cm.configure() 214 | cm.build() 215 | 216 | def package(self): 217 | cm = CMake(self) 218 | cm.install() 219 | 220 | if not self.options.shared: 221 | copy( 222 | self, 223 | "*", 224 | src=os.path.join(self.package_folder, "lib", "static"), 225 | dst=os.path.join(self.package_folder, "lib"), 226 | ) 227 | rmdir(self, os.path.join(self.package_folder, "lib", "static")) 228 | 229 | rmdir(self, os.path.join(self.package_folder, "cmake")) 230 | rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) 231 | rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) 232 | rmdir(self, os.path.join(self.package_folder, "share")) 233 | rm(self, "OpenColorIOConfig*.cmake", self.package_folder) 234 | rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) 235 | copy( 236 | self, 237 | pattern="LICENSE", 238 | dst=os.path.join(self.package_folder, "licenses"), 239 | src=self.source_folder, 240 | ) 241 | 242 | # Copy python bindings & binaries 243 | py_package_folder = Path(os.environ["OCIO_PKG_DIR"]) 244 | py_package_folder.mkdir(exist_ok=True) 245 | 246 | if self.settings.os == "Windows": # pylint: disable=no-member 247 | py_lib_folder = py_package_folder 248 | else: 249 | py_lib_folder = Path(os.environ["OIIO_LIBS_DIR"]) 250 | py_lib_folder.mkdir(exist_ok=True) 251 | 252 | bin_dir = Path(self.package_folder) / "bin" 253 | 254 | copy(self, "*OpenColorIO*", src=bin_dir, dst=py_lib_folder) 255 | 256 | if self.settings.os != "Windows": # pylint: disable=no-member 257 | lib_dir = Path(self.package_folder) / "lib" 258 | copy(self, "*OpenColorIO*", src=lib_dir, dst=py_lib_folder) 259 | copy(self, "*libOpenColorIO*", src=lib_dir, dst=py_lib_folder) 260 | 261 | if os.getenv("OIIO_STATIC") != "1": 262 | tools_dir = py_package_folder / "tools" 263 | tools_dir.mkdir(parents=True, exist_ok=True) 264 | 265 | ocio_tools = [ 266 | "ocioarchive", 267 | "ociobakelut", 268 | "ociocheck", 269 | "ociochecklut", 270 | "ocioconvert", 271 | "ociolutimage", 272 | "ociomakeclf", 273 | "ocioperf", 274 | "ociowrite", 275 | ] 276 | 277 | for tool in ocio_tools: 278 | copy(self, f"{tool}*", src=bin_dir, dst=tools_dir) 279 | 280 | if self.settings.os == "Windows": # pylint: disable=no-member 281 | ocio_sp_folder = ( 282 | Path(self.package_folder) / "lib" / "site-packages" / "PyOpenColorIO" 283 | ) 284 | copy(self, "*PyOpenColorIO*", src=ocio_sp_folder, dst=py_package_folder) 285 | else: 286 | ocio_lib_folder = Path(self.package_folder) / "lib" 287 | ocio_py_folder = list(ocio_lib_folder.glob("py*"))[0] 288 | ocio_sp_folder = ocio_py_folder / "site-packages" / "PyOpenColorIO" 289 | copy(self, "*PyOpenColorIO*", src=ocio_sp_folder, dst=py_package_folder) 290 | 291 | license_folder = Path(self.package_folder) / "licenses" 292 | license_folder.mkdir(exist_ok=True) 293 | copy(self, pattern="LICENSE", dst=license_folder, src=self.source_folder) 294 | 295 | def package_info(self): 296 | self.cpp_info.set_property("cmake_file_name", "OpenColorIO") 297 | self.cpp_info.set_property("cmake_target_name", "OpenColorIO::OpenColorIO") 298 | self.cpp_info.set_property("pkg_config_name", "OpenColorIO") 299 | 300 | self.cpp_info.libs = ["OpenColorIO"] 301 | 302 | if is_apple_os(self): 303 | self.cpp_info.frameworks.extend( 304 | ["Foundation", "IOKit", "ColorSync", "CoreGraphics"] 305 | ) 306 | if Version(self.version) == "2.1.0": 307 | self.cpp_info.frameworks.extend(["Carbon", "CoreFoundation"]) 308 | 309 | if is_msvc(self) and not self.options.shared: 310 | self.cpp_info.defines.append("OpenColorIO_SKIP_IMPORTS") 311 | 312 | bin_path = os.path.join(self.package_folder, "bin") 313 | self.output.info(f"Appending PATH env var with: {bin_path}") 314 | self.env_info.PATH.append(bin_path) 315 | --------------------------------------------------------------------------------