Skip to content

Commit d006382

Browse files
committed
Update OpenImageIO to 3.0.6.0
1 parent d3bea32 commit d006382

File tree

5 files changed

+344
-3
lines changed

5 files changed

+344
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pip install oiio-static-python
4444

4545
This project avoids using the `openimageio` package name because the ASWF may release official wheels in the future.
4646

47-
You do NOT need to have OpenImageIO installed on your system. `oiio-python` ship with all necessary shared library.
47+
You do NOT need to have OpenImageIO installed on your system. `oiio-python` ship with all necessary shared libraries.
4848

4949
## **What's Included**
5050

oiio_python/recipes/openimageio/conandata.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"3.0.6.0":
3+
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.6.0.tar.gz"
4+
sha256: "670f8753d5604beb4a17e5279fb1948fa978bc72d8e0991103ddbbfea54df1b5"
25
"3.0.4.0":
36
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.4.0.tar.gz"
47
sha256: "dd481071d532c1ab38242011bb7af16f6ec7d915c58cada9fb78ed72b402ebc5"
@@ -10,6 +13,10 @@ sources:
1013
sha256: "7f84c2b9c13be74c4a187fefe3844b391374ba329aa63fbbca21fa232e43c87b"
1114

1215
patches:
16+
"3.0.6.0":
17+
- patch_file: "patches/3.0.6.0-001-fix-conan-build.patch"
18+
patch_description: "Fix build with Conan"
19+
patch_type: "conan"
1320
"3.0.4.0":
1421
- patch_file: "patches/3.0.4.0-001-fix-conan-build.patch"
1522
patch_description: "Fix build with Conan"
Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,334 @@
1+
--- CMakeLists.txt
2+
+++ CMakeLists.txt
3+
@@ -42,7 +42,6 @@
4+
5+
# Set up module path for our own cmake modules and add some esential ones
6+
list (APPEND CMAKE_MODULE_PATH
7+
- "${PROJECT_SOURCE_DIR}/src/cmake/modules"
8+
"${PROJECT_SOURCE_DIR}/src/cmake")
9+
10+
# Utilities
11+
@@ -274,7 +273,6 @@
12+
add_subdirectory (src/iinfo)
13+
add_subdirectory (src/maketx)
14+
add_subdirectory (src/oiiotool)
15+
- add_subdirectory (src/testtex)
16+
add_subdirectory (src/iv)
17+
endif ()
18+
19+
--- src/cmake/pythonutils.cmake
20+
+++ src/cmake/pythonutils.cmake
21+
@@ -10,8 +10,10 @@
22+
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
23+
if (WIN32)
24+
set (PYLIB_LIB_TYPE SHARED CACHE STRING "Type of library to build for python module (MODULE or SHARED)")
25+
+ set (PY_DEV_REQUIRED Development)
26+
else ()
27+
set (PYLIB_LIB_TYPE MODULE CACHE STRING "Type of library to build for python module (MODULE or SHARED)")
28+
+ set (PY_DEV_REQUIRED Development.Module)
29+
endif ()
30+
31+
32+
@@ -33,23 +35,13 @@
33+
endif ()
34+
endif ()
35+
36+
- # Support building on manylinux docker images, which do not contain
37+
- # the Development.Embedded component.
38+
- # https://pybind11.readthedocs.io/en/stable/compiling.html#findpython-mode
39+
- if (WIN32)
40+
- set (_py_components Interpreter Development)
41+
- else ()
42+
- set (_py_components Interpreter Development.Module)
43+
- endif ()
44+
45+
checked_find_package (Python3 ${PYTHON_VERSION}
46+
${_req}
47+
VERSION_MIN 3.7
48+
- COMPONENTS ${_py_components}
49+
+ COMPONENTS Interpreter ${PY_DEV_REQUIRED}
50+
PRINT Python3_VERSION Python3_EXECUTABLE
51+
Python3_LIBRARIES
52+
- Python3_Development_FOUND
53+
- Python3_Development.Module_FOUND
54+
Python3_Interpreter_FOUND )
55+
56+
# The version that was found may not be the default or user
57+
@@ -61,9 +53,7 @@
58+
set (PythonInterp3_FIND_VERSION PYTHON_VERSION_FOUND)
59+
set (PythonInterp3_FIND_VERSION_MAJOR ${Python3_VERSION_MAJOR})
60+
61+
- if (NOT DEFINED PYTHON_SITE_DIR)
62+
- set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages/OpenImageIO")
63+
- endif ()
64+
+ set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages/OpenImageIO")
65+
message (VERBOSE " Python site packages dir ${PYTHON_SITE_DIR}")
66+
message (VERBOSE " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
67+
message (VERBOSE " Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
68+
--- src/cmake/externalpackages.cmake
69+
+++ src/cmake/externalpackages.cmake
70+
@@ -50,16 +50,26 @@
71+
endif ()
72+
73+
# IlmBase & OpenEXR
74+
-checked_find_package (Imath REQUIRED
75+
+checked_find_package (Imath CONFIG REQUIRED
76+
VERSION_MIN 3.1
77+
PRINT IMATH_INCLUDES OPENEXR_INCLUDES Imath_VERSION
78+
)
79+
80+
-checked_find_package (OpenEXR REQUIRED
81+
+checked_find_package (OpenEXR CONFIG REQUIRED
82+
VERSION_MIN 3.1
83+
NO_FP_RANGE_CHECK
84+
PRINT IMATH_INCLUDES OPENEXR_INCLUDES Imath_VERSION
85+
)
86+
+
87+
+set (OPENEXR_VERSION ${OpenEXR_VERSION})
88+
+get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
89+
+get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
90+
+get_target_property(OPENEXR_IEX_LIBRARY OpenEXR::Iex INTERFACE_LINK_LIBRARIES)
91+
+get_target_property(OPENEXR_ILMTHREAD_LIBRARY OpenEXR::IlmThread INTERFACE_LINK_LIBRARIES)
92+
+get_target_property(OPENEXR_INCLUDES OpenEXR::OpenEXR INTERFACE_INCLUDE_DIRECTORIES)
93+
+get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::OpenEXR INTERFACE_LINK_LIBRARIES)
94+
+set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY})
95+
+set (OPENEXR_FOUND true)
96+
97+
# Force Imath includes to be before everything else to ensure that we have
98+
# the right Imath/OpenEXR version, not some older version in the system
99+
@@ -87,7 +97,7 @@
100+
101+
102+
# Ultra HDR
103+
-checked_find_package (libuhdr)
104+
+checked_find_package (libuhdr CONFIG REQUIRED)
105+
106+
107+
checked_find_package (TIFF REQUIRED
108+
@@ -96,7 +106,7 @@
109+
110+
# JPEG XL
111+
option (USE_JXL "Enable JPEG XL support" ON)
112+
-checked_find_package (JXL
113+
+checked_find_package (libjxl
114+
VERSION_MIN 0.10.1
115+
DEFINITIONS USE_JXL=1)
116+
117+
@@ -150,7 +160,7 @@
118+
119+
# Intel TBB
120+
set (TBB_USE_DEBUG_BUILD OFF)
121+
-checked_find_package (TBB 2017
122+
+checked_find_package (TBB
123+
SETVARIABLES OIIO_TBB
124+
PREFER_CONFIG)
125+
126+
@@ -166,7 +176,7 @@
127+
RECOMMEND_MIN 1.16
128+
RECOMMEND_MIN_REASON "for orientation support")
129+
130+
-checked_find_package (LibRaw
131+
+checked_find_package (LibRaw REQUIRED
132+
VERSION_MIN 0.20.0
133+
PRINT LibRaw_r_LIBRARIES)
134+
135+
@@ -223,18 +233,19 @@
136+
137+
138+
# Tessil/robin-map
139+
-checked_find_package (Robinmap REQUIRED
140+
+checked_find_package (tsl-robin-map REQUIRED
141+
VERSION_MIN 1.2.0
142+
BUILD_LOCAL missing
143+
)
144+
+set (ROBINMAP_INCLUDES ${tsl-robin-map_INCLUDE_DIRS})
145+
146+
# fmtlib
147+
-option (OIIO_INTERNALIZE_FMT "Copy fmt headers into <install>/include/OpenImageIO/detail/fmt" ON)
148+
+option (OIIO_INTERNALIZE_FMT "Copy fmt headers into <install>/include/OpenImageIO/detail/fmt" OFF)
149+
checked_find_package (fmt REQUIRED
150+
VERSION_MIN 7.0
151+
BUILD_LOCAL missing
152+
)
153+
-get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES)
154+
+get_target_property(FMT_INCLUDE_DIR fmt::fmt INTERFACE_INCLUDE_DIRECTORIES)
155+
156+
157+
###########################################################################
158+
--- src/ptex.imageio/CMakeLists.txt
159+
+++ src/ptex.imageio/CMakeLists.txt
160+
@@ -9,5 +9,6 @@
161+
endif()
162+
add_oiio_plugin (ptexinput.cpp
163+
LINK_LIBRARIES ${ptex_target} ZLIB::ZLIB
164+
+ INCLUDE_DIRS ${ptex_INCLUDE_DIRS}
165+
DEFINITIONS "USE_PTEX")
166+
endif ()
167+
--- src/heif.imageio/CMakeLists.txt
168+
+++ src/heif.imageio/CMakeLists.txt
169+
@@ -3,31 +3,9 @@
170+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
171+
172+
if (Libheif_FOUND)
173+
- if (LINKSTATIC)
174+
- set (_static_suffixes .lib .a)
175+
- set (_static_libraries_found 0)
176+
-
177+
- foreach (_libeheif_library IN LISTS LIBHEIF_LIBRARIES)
178+
- get_filename_component (_ext ${_libeheif_library} LAST_EXT)
179+
- list (FIND _static_suffixes ${_ext} _index)
180+
- if (${_index} GREATER -1)
181+
- MATH (EXPR _static_libraries_found "${static_libraries_found}+1")
182+
- endif()
183+
- endforeach()
184+
-
185+
- if (${_static_libraries_found} GREATER 0)
186+
- message (STATUS "${ColorYellow}")
187+
- message (STATUS "You are linking OpenImageIO against a static version of libheif, which is LGPL")
188+
- message (STATUS "licensed. If you intend to redistribute this build of OpenImageIO, we recommend")
189+
- message (STATUS "that you review the libheif license terms, or you may wish to switch to using a")
190+
- message (STATUS "dynamically-linked libheif.")
191+
- message ("${ColorReset}")
192+
- endif()
193+
- endif()
194+
195+
add_oiio_plugin (heifinput.cpp heifoutput.cpp
196+
- INCLUDE_DIRS ${LIBHEIF_INCLUDES}
197+
- LINK_LIBRARIES ${LIBHEIF_LIBRARIES}
198+
+ LINK_LIBRARIES libheif::heif
199+
DEFINITIONS "USE_HEIF=1")
200+
else ()
201+
message (WARNING "heif plugin will not be built")
202+
--- src/raw.imageio/CMakeLists.txt
203+
+++ src/raw.imageio/CMakeLists.txt
204+
@@ -2,12 +2,7 @@
205+
# SPDX-License-Identifier: Apache-2.0
206+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
207+
208+
-if (LIBRAW_FOUND)
209+
- add_oiio_plugin (rawinput.cpp
210+
- INCLUDE_DIRS ${LibRaw_INCLUDE_DIR}
211+
- LINK_LIBRARIES ${LibRaw_r_LIBRARIES}
212+
- COMPILE_OPTIONS ${LibRaw_r_DEFINITIONS}
213+
- DEFINITIONS "USE_LIBRAW=1")
214+
-else ()
215+
- message (WARNING "Raw plugin will not be built")
216+
-endif ()
217+
+add_oiio_plugin (rawinput.cpp
218+
+ INCLUDE_DIRS ${libraw_INCLUDE_DIR}
219+
+ LINK_LIBRARIES libraw::libraw
220+
+ DEFINITIONS "USE_LIBRAW=1" ${LibRaw_r_DEFINITIONS})
221+
--- src/jpeg.imageio/CMakeLists.txt
222+
+++ src/jpeg.imageio/CMakeLists.txt
223+
@@ -15,6 +15,6 @@
224+
LINK_LIBRARIES
225+
$<TARGET_NAME_IF_EXISTS:libjpeg-turbo::jpeg>
226+
$<TARGET_NAME_IF_EXISTS:JPEG::JPEG>
227+
- ${LIBUHDR_LIBRARY}
228+
+ libuhdr::libuhdr
229+
DEFINITIONS "${UHDR_DEFS}"
230+
)
231+
--- src/include/CMakeLists.txt
232+
+++ src/include/CMakeLists.txt
233+
@@ -49,7 +49,7 @@
234+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/detail
235+
COMPONENT developer)
236+
237+
-if (OIIO_INTERNALIZE_FMT OR fmt_LOCAL_BUILD)
238+
+if (0)
239+
set (fmt_headers_base_names)
240+
foreach (header_name core.h format-inl.h format.h ostream.h printf.h
241+
std.h base.h chrono.h)
242+
--- src/jpegxl.imageio/CMakeLists.txt
243+
+++ src/jpegxl.imageio/CMakeLists.txt
244+
@@ -2,11 +2,7 @@
245+
# SPDX-License-Identifier: Apache-2.0
246+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
247+
248+
-if (JXL_FOUND)
249+
- add_oiio_plugin (jxlinput.cpp jxloutput.cpp
250+
- INCLUDE_DIRS ${JXL_INCLUDE_DIRS}
251+
- LINK_LIBRARIES ${JXL_LIBRARIES}
252+
- DEFINITIONS "USE_JXL")
253+
-else()
254+
- message (WARNING "JPEG XL plugin will not be built")
255+
-endif()
256+
+add_oiio_plugin (jxlinput.cpp jxloutput.cpp
257+
+ INCLUDE_DIRS ${libjxl_INCLUDE_DIRS}
258+
+ LINK_LIBRARIES libjxl::libjxl
259+
+ DEFINITIONS "USE_JXL")
260+
--- src/libOpenImageIO/CMakeLists.txt
261+
+++ src/libOpenImageIO/CMakeLists.txt
262+
@@ -165,12 +165,24 @@
263+
OpenColorIO::OpenColorIO
264+
$<TARGET_NAME_IF_EXISTS:OpenColorIO::OpenColorIOHeaders>
265+
$<TARGET_NAME_IF_EXISTS:pugixml::pugixml>
266+
- $<TARGET_NAME_IF_EXISTS:TBB::tbb>
267+
+ $<TARGET_NAME_IF_EXISTS:onetbb::onetbb>
268+
$<TARGET_NAME_IF_EXISTS:Freetype::Freetype>
269+
${BZIP2_LIBRARIES}
270+
ZLIB::ZLIB
271+
+ tsl::robin_map
272+
${CMAKE_DL_LIBS}
273+
)
274+
+
275+
+
276+
+if (USE_OPENCV)
277+
+ target_link_libraries (OpenImageIO PRIVATE opencv::opencv_core
278+
+ opencv::opencv_imgproc
279+
+ opencv::opencv_videoio)
280+
+endif()
281+
+
282+
+if (USE_FREETYPE)
283+
+ target_link_libraries (OpenImageIO PRIVATE Freetype::Freetype)
284+
+endif()
285+
286+
if (WIN32)
287+
target_link_libraries (OpenImageIO PRIVATE psapi)
288+
--- src/openvdb.imageio/CMakeLists.txt
289+
+++ src/openvdb.imageio/CMakeLists.txt
290+
@@ -6,5 +6,5 @@
291+
add_oiio_plugin (openvdbinput.cpp
292+
INCLUDE_DIRS ${OPENVDB_INCLUDES} ${TBB_INCLUDE_DIRS}
293+
LINK_LIBRARIES ${OPENVDB_LIBRARIES}
294+
- $<TARGET_NAME_IF_EXISTS:TBB::tbb>)
295+
+ $<TARGET_NAME_IF_EXISTS:onetbb::onetbb>)
296+
endif()
297+
--- src/libutil/CMakeLists.txt
298+
+++ src/libutil/CMakeLists.txt
299+
@@ -64,8 +64,9 @@
300+
${GCC_ATOMIC_LIBRARIES}
301+
${OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY}
302+
${OPENIMAGEIO_IMATH_TARGETS}
303+
+ fmt::fmt
304+
PRIVATE
305+
- $<TARGET_NAME_IF_EXISTS:TBB::tbb>
306+
+ $<TARGET_NAME_IF_EXISTS:onetbb::onetbb>
307+
${CMAKE_DL_LIBS}
308+
)
309+
310+
@@ -75,12 +76,7 @@
311+
PRIVATE stdc++_libbacktrace)
312+
endif ()
313+
314+
- if (OIIO_INTERNALIZE_FMT OR fmt_LOCAL_BUILD)
315+
- add_dependencies(${targetname} fmt_internal_target)
316+
- else ()
317+
- target_link_libraries (${targetname}
318+
- PUBLIC fmt::fmt-header-only)
319+
- endif ()
320+
+ target_link_libraries (${targetname} PUBLIC fmt::fmt)
321+
322+
if (WIN32)
323+
target_compile_definitions(${targetname} PRIVATE
324+
--- src/jpeg2000.imageio/CMakeLists.txt
325+
+++ src/jpeg2000.imageio/CMakeLists.txt
326+
@@ -5,7 +5,7 @@
327+
if (OPENJPEG_FOUND)
328+
add_oiio_plugin (jpeg2000input.cpp jpeg2000output.cpp
329+
INCLUDE_DIRS ${OPENJPEG_INCLUDES}
330+
- LINK_LIBRARIES ${OPENJPEG_LIBRARIES}
331+
+ LINK_LIBRARIES openjp2
332+
DEFINITIONS "USE_OPENJPEG")
333+
else()
334+
message (WARNING "Jpeg-2000 plugin will not be built")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def has_ext_modules(self):
123123

124124
setup(
125125
name=package_name,
126-
version="3.0.4.0.1",
126+
version="3.0.6.0.1",
127127
license_files=tuple(license_files),
128128
package_dir={"": "oiio_python"},
129129
packages=find_packages(where="oiio_python"),

setuputils/build_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def build_packages(build_static_version: bool = False) -> None:
4949

5050
# OpenImageIO
5151
oiio_dir = project / "oiio_python" / "recipes" / "openimageio"
52-
oiio_version = "3.0.4.0"
52+
oiio_version = "3.0.6.0"
5353
conan_install_package(oiio_dir, oiio_version, profile=profile_name)
5454
build_cleanup(oiio_dir)
5555

0 commit comments

Comments
 (0)