Skip to content

Commit 6c41e8e

Browse files
committed
Bump OpenImageIO to 3.0.10.0, improved Cmake Python finding (Win 3.13)
1 parent ddf257b commit 6c41e8e

File tree

7 files changed

+469
-58
lines changed

7 files changed

+469
-58
lines changed

oiio_python/recipes/opencolorio/conanfile.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,42 @@ def generate(self):
133133
tc = CMakeToolchain(self)
134134
tc.cppstd = default_cppstd(self)
135135

136-
tc.variables["Python_EXECUTABLE"] = Path(sys.executable).as_posix()
137-
tc.variables["Python3_EXECUTABLE"] = Path(sys.executable).as_posix()
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()
138172

139173
tc.variables["OCIO_BUILD_PYTHON"] = True
140174
tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True
Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
sources:
2-
"3.0.8.1":
3-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.8.1.tar.gz"
4-
sha256: "1b9b0d27e802243c1aa490b951580d10e8be645459f8080bfa0ed6f213e1082a"
5-
"3.0.7.0":
6-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.7.0.tar.gz"
7-
sha256: "2798e398b6ffd836ba7810e8ea510902a4aabc4a373ca0523a3f0d830c5eb103"
8-
"3.0.6.0":
9-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.6.0.tar.gz"
10-
sha256: "670f8753d5604beb4a17e5279fb1948fa978bc72d8e0991103ddbbfea54df1b5"
11-
"3.0.4.0":
12-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.4.0.tar.gz"
13-
sha256: "dd481071d532c1ab38242011bb7af16f6ec7d915c58cada9fb78ed72b402ebc5"
14-
"3.0.2.0":
15-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.2.0.tar.gz"
16-
sha256: "93f8bb261dada2458de6c690e730d3e5dfd3cda44fc2e76cff2dc4cf1ecb05ff"
17-
"3.0.1.0":
18-
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v3.0.1.0.tar.gz"
19-
sha256: "7f84c2b9c13be74c4a187fefe3844b391374ba329aa63fbbca21fa232e43c87b"
20-
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
2123
patches:
22-
"3.0.8.1":
23-
- patch_file: "patches/3.0.8.1-001-fix-conan-build.patch"
24-
patch_description: "Fix build with Conan"
25-
patch_type: "conan"
26-
"3.0.7.0":
27-
- patch_file: "patches/3.0.7.0-001-fix-conan-build.patch"
28-
patch_description: "Fix build with Conan"
29-
patch_type: "conan"
30-
"3.0.6.0":
31-
- patch_file: "patches/3.0.6.0-001-fix-conan-build.patch"
32-
patch_description: "Fix build with Conan"
33-
patch_type: "conan"
34-
"3.0.4.0":
35-
- patch_file: "patches/3.0.4.0-001-fix-conan-build.patch"
36-
patch_description: "Fix build with Conan"
37-
patch_type: "conan"
38-
"3.0.2.0":
39-
- patch_file: "patches/3.0.2.0-001-fix-conan-build.patch"
40-
patch_description: "Fix build with Conan"
41-
patch_type: "conan"
42-
"3.0.1.0":
43-
- patch_file: "patches/3.0.1.0-001-fix-conan-build.patch"
44-
patch_description: "Fix build with Conan"
45-
patch_type: "conan"
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+

oiio_python/recipes/openimageio/conanfile.py

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,53 @@ def generate(self):
172172
# if self.settings.os == "Linux":
173173
# tc.variables["DCOMPILER_SUPPORTS_ATOMIC_WITHOUT_LIBATOMIC_EXITCODE"] = 0
174174

175+
# Tell pybind11 to use the newer FindPython module instead of deprecated FindPythonLibs
176+
tc.variables["PYBIND11_FINDPYTHON"] = True
177+
178+
# Set Python paths for CMake FindPython
175179
python_exe = Path(os.path.realpath(sys.executable))
176180
print(f"Python executable: {python_exe}")
177181

178182
tc.variables["Python_EXECUTABLE"] = python_exe.as_posix()
179183
tc.variables["Python3_EXECUTABLE"] = python_exe.as_posix()
180184

181-
# # TEMP_WINDOWS_313
182-
# tc.variables["Python3_LIBRARY"] = Path(
183-
# r"Y:\conda\envs\oiio313\libs\python313.lib"
184-
# ).as_posix()
185-
# tc.variables["Python3_INCLUDE_DIR"] = Path(
186-
# r"Y:\conda\envs\oiio313\include"
187-
# ).as_posix()
188-
# tc.variables["Python3_ROOT"] = Path(r"Y:\conda\envs\oiio313").as_posix()
189-
# tc.variables["Python3_ROOT_DIR"] = Path(r"Y:\conda\envs\oiio313").as_posix()
185+
# Help CMake find Python on Windows
186+
if self.settings.os == "Windows": # pylint: disable=no-member
187+
tc.variables["Python_ROOT_DIR"] = Path(sys.prefix).as_posix()
188+
tc.variables["Python3_ROOT_DIR"] = Path(sys.prefix).as_posix()
189+
190+
# Python 3.13 specific workaround - needs extra help finding libraries
191+
if sys.version_info[:2] == (3, 13):
192+
import sysconfig
193+
194+
# Get Python paths using sysconfig (works for system, conda, venv)
195+
python_root = Path(sys.prefix)
196+
197+
# Find the library - try different possible locations
198+
lib_dir = python_root / "libs"
199+
if not lib_dir.exists():
200+
# Try alternate location (some distributions)
201+
lib_dir = python_root / "lib"
202+
203+
# Python 3.13 library name
204+
python_lib = lib_dir / f"python{sys.version_info.major}{sys.version_info.minor}.lib"
205+
if not python_lib.exists():
206+
# Try with full version
207+
python_lib = lib_dir / f"python{sys.version_info.major}.{sys.version_info.minor}.lib"
208+
209+
# Get include directory
210+
include_dir = Path(sysconfig.get_path('include'))
211+
212+
print(f"Python 3.13 Windows workaround:")
213+
print(f" Root: {python_root}")
214+
print(f" Library: {python_lib}")
215+
print(f" Include: {include_dir}")
216+
217+
if python_lib.exists():
218+
tc.variables["Python3_LIBRARY"] = python_lib.as_posix()
219+
220+
if include_dir.exists():
221+
tc.variables["Python3_INCLUDE_DIR"] = include_dir.as_posix()
190222

191223
tc.variables["USE_PYTHON"] = True
192224
tc.variables["CMAKE_DEBUG_POSTFIX"] = "" # Needed for 2.3.x.x+ versions

0 commit comments

Comments
 (0)