Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/openvdb/files/, media-gfx/openvdb/
Date: Sat, 04 Dec 2021 21:52:59
Message-Id: 1638654762.b62193bab0b3de371047ddb0aacce74591cabcb8.sam@gentoo
1 commit: b62193bab0b3de371047ddb0aacce74591cabcb8
2 Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
3 AuthorDate: Sat Dec 4 20:37:39 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 4 21:52:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b62193ba
7
8 media-gfx/openvdb: fix issue if imath and ilmbase are both installed
9
10 The patch fixes an issue when OPENVDB_BUILD_BINARIES and OPENVDB_BUILD_RENDER
11 are set and both, dev-libs/imath and media-libs/ilmbase are being installed
12 and allows the package to configure properly in this case.
13
14 Additionally it fixes the installation location of the python module.
15
16 Bug: https://bugs.gentoo.org/790350
17 Package-Manager: Portage-3.0.28, Repoman-3.0.3
18 Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
19 Closes: https://github.com/gentoo/gentoo/pull/23185
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 ...lmbase-if-imath-and-ilmbase-are-installed.patch | 37 ++++++++++++++++++++++
23 ...unconditionally-search-Python-interpreter.patch | 34 ++++++++++++++++++++
24 ...penvdb-8.2.0.ebuild => openvdb-8.2.0-r1.ebuild} | 24 ++++++++++----
25 3 files changed, 88 insertions(+), 7 deletions(-)
26
27 diff --git a/media-gfx/openvdb/files/openvdb-8.2.0-fix-finding-ilmbase-if-imath-and-ilmbase-are-installed.patch b/media-gfx/openvdb/files/openvdb-8.2.0-fix-finding-ilmbase-if-imath-and-ilmbase-are-installed.patch
28 new file mode 100644
29 index 000000000000..88752e9fa0eb
30 --- /dev/null
31 +++ b/media-gfx/openvdb/files/openvdb-8.2.0-fix-finding-ilmbase-if-imath-and-ilmbase-are-installed.patch
32 @@ -0,0 +1,37 @@
33 +From: Bernd Waibel <waebbl-gentoo@××××××.net>
34 +Date: Sat, 4 Dec 2021 20:16:42 +0100
35 +Subject: [PATCH] fix finding ilmbase if imath and ilmbase are installed
36 +
37 +If both, ilmbase-2.5 and imath-3 are installed, the configuration fails
38 +if OPENVDB_BUILD_BINARIES and OPENVDB_BUILD_RENDER are set.
39 +The patch adds an additional guard based on the USE_IMATH_HALF option
40 +being set and thus decide whether to search for and use imath or ilmbase.
41 +
42 +Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net>
43 +--- a/openvdb/openvdb/cmd/CMakeLists.txt
44 ++++ b/openvdb/openvdb/cmd/CMakeLists.txt
45 +@@ -81,12 +81,17 @@ endif()
46 + #### vdb_render
47 +
48 + if(OPENVDB_BUILD_VDB_RENDER)
49 +- find_package(Imath CONFIG)
50 +- if (NOT TARGET Imath::Imath)
51 ++ if(USE_IMATH_HALF)
52 ++ find_package(Imath CONFIG)
53 ++ if (NOT TARGET Imath::Imath)
54 ++ find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath)
55 ++ find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf)
56 ++ else()
57 ++ find_package(OpenEXR CONFIG)
58 ++ endif()
59 ++ else()
60 + find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath)
61 + find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf)
62 +- else()
63 +- find_package(OpenEXR CONFIG)
64 + endif()
65 +
66 + set(VDB_RENDER_SOURCE_FILES openvdb_render.cc)
67 +--
68 +2.34.1
69 +
70
71 diff --git a/media-gfx/openvdb/files/openvdb-8.2.0-unconditionally-search-Python-interpreter.patch b/media-gfx/openvdb/files/openvdb-8.2.0-unconditionally-search-Python-interpreter.patch
72 new file mode 100644
73 index 000000000000..933d2965b2bc
74 --- /dev/null
75 +++ b/media-gfx/openvdb/files/openvdb-8.2.0-unconditionally-search-Python-interpreter.patch
76 @@ -0,0 +1,34 @@
77 +From: Bernd Waibel <waebbl-gentoo@××××××.net>
78 +Date: Sat, 4 Dec 2021 20:45:49 +0100
79 +Subject: [PATCH] unconditionally search Python interpreter
80 +
81 +When setting PYOPENVDB_INSTALL_DIRECTORY, CMake would fail with:
82 +```
83 +-- Could NOT find Python (missing: Python_LIBRARIES Development Development.Module Development.Embed) (found version "3.9.9")
84 +CMake Error at openvdb/openvdb/python/CMakeLists.txt:65 (message):
85 + Could NOT find Python::Module (Required is at least version "2.7")
86 +Call Stack (most recent call first):
87 + openvdb/openvdb/python/CMakeLists.txt:112 (openvdb_check_python_version)
88 + ```
89 +
90 +It seems like we always need to search for the interpreter.
91 +
92 +Bug: https://bugs.gentoo.org/790350
93 +Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net>
94 +--- a/openvdb/openvdb/python/CMakeLists.txt
95 ++++ b/openvdb/openvdb/python/CMakeLists.txt
96 +@@ -73,10 +73,7 @@ endfunction()
97 + # target but this was only added in CMake 3.15. See:
98 + # https://github.com/AcademySoftwareFoundation/openvdb/issues/886
99 + set(OPENVDB_PYTHON_DEPS)
100 +-set(OPENVDB_PYTHON_REQUIRED_COMPONENTS Development)
101 +-if(NOT DEFINED PYOPENVDB_INSTALL_DIRECTORY)
102 +- list(APPEND OPENVDB_PYTHON_REQUIRED_COMPONENTS Interpreter)
103 +-endif()
104 ++set(OPENVDB_PYTHON_REQUIRED_COMPONENTS Development Interpreter)
105 +
106 + if(${CMAKE_VERSION} VERSION_LESS 3.14)
107 + find_package(Python QUIET COMPONENTS ${OPENVDB_PYTHON_REQUIRED_COMPONENTS})
108 +--
109 +2.34.1
110 +
111
112 diff --git a/media-gfx/openvdb/openvdb-8.2.0.ebuild b/media-gfx/openvdb/openvdb-8.2.0-r1.ebuild
113 similarity index 86%
114 rename from media-gfx/openvdb/openvdb-8.2.0.ebuild
115 rename to media-gfx/openvdb/openvdb-8.2.0-r1.ebuild
116 index 9b71b3a635df..1a4d9c0e36e9 100644
117 --- a/media-gfx/openvdb/openvdb-8.2.0.ebuild
118 +++ b/media-gfx/openvdb/openvdb-8.2.0-r1.ebuild
119 @@ -31,8 +31,6 @@ RDEPEND="
120 dev-libs/log4cplus:=
121 media-libs/glfw
122 media-libs/glu
123 - media-libs/ilmbase:=
124 - media-libs/openexr:0=
125 sys-libs/zlib:=
126 x11-libs/libXcursor
127 x11-libs/libXi
128 @@ -46,6 +44,10 @@ RDEPEND="
129 numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )
130 ')
131 )
132 + utils? (
133 + media-libs/ilmbase:=
134 + media-libs/openexr:0=
135 + )
136 zlib? ( sys-libs/zlib )
137 "
138
139 @@ -69,7 +71,8 @@ PATCHES=(
140 "${FILESDIR}/${PN}-7.1.0-0001-Fix-multilib-header-source.patch"
141 "${FILESDIR}/${PN}-8.0.1-add-consistency-for-NumPy-find_package-call.patch"
142 "${FILESDIR}/${PN}-8.1.0-glfw-libdir.patch"
143 - #"${FILESDIR}/${PN}-9.0.0-unconditionally-search-Python-interpreter.patch"
144 + "${FILESDIR}/${PN}-8.2.0-fix-finding-ilmbase-if-imath-and-ilmbase-are-installed.patch"
145 + "${FILESDIR}/${PN}-8.2.0-unconditionally-search-Python-interpreter.patch"
146 )
147
148 pkg_setup() {
149 @@ -93,11 +96,9 @@ src_configure() {
150 local mycmakeargs=(
151 -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}/"
152 -DOPENVDB_ABI_VERSION_NUMBER="${version}"
153 + -DOPENVDB_BUILD_BINARIES=$(usex utils)
154 -DOPENVDB_BUILD_DOCS=$(usex doc)
155 -DOPENVDB_BUILD_UNITTESTS=$(usex test)
156 - -DOPENVDB_BUILD_VDB_LOD=$(usex utils)
157 - -DOPENVDB_BUILD_VDB_RENDER=$(usex utils)
158 - -DOPENVDB_BUILD_VDB_VIEW=$(usex utils)
159 -DOPENVDB_CORE_SHARED=ON
160 -DOPENVDB_CORE_STATIC=$(usex static-libs)
161 -DOPENVDB_ENABLE_RPATH=OFF
162 @@ -113,10 +114,19 @@ src_configure() {
163 if use python; then
164 mycmakeargs+=(
165 -DOPENVDB_BUILD_PYTHON_MODULE=ON
166 - -DUSE_NUMPY=$(usex numpy)
167 -DOPENVDB_BUILD_PYTHON_UNITTESTS=$(usex test)
168 + -DPYOPENVDB_INSTALL_DIRECTORY="$(python_get_sitedir)"
169 -DPython_EXECUTABLE="${PYTHON}"
170 -DPython_INCLUDE_DIR="$(python_get_includedir)"
171 + -DUSE_NUMPY=$(usex numpy)
172 + )
173 + fi
174 +
175 + if use utils; then
176 + mycmakeargs+=(
177 + -DOPENVDB_BUILD_VDB_LOD=ON
178 + -DOPENVDB_BUILD_VDB_RENDER=ON
179 + -DOPENVDB_BUILD_VDB_VIEW=ON
180 )
181 fi