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/
Date: Mon, 24 Aug 2020 13:42:42
Message-Id: 1598276511.4a186793a1a0fdb0336bcb41432c1c5f51a8df5f.sam@gentoo
1 commit: 4a186793a1a0fdb0336bcb41432c1c5f51a8df5f
2 Author: Adrian Grigo <agrigo2001 <AT> yahoo <DOT> com <DOT> au>
3 AuthorDate: Tue Aug 18 04:49:14 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 24 13:41:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a186793
7
8 media-gfx/openvdb: Ensure user chooses appropriate abi version
9
10 The initial ebuilds for openvdb assumed that they would build the same
11 abi as the major version, unless abiX-compat was given to force
12 building against a legacy version.
13
14 This makes it difficult for other ebuilds to determine which ABI
15 openvdb supports as they can not rely on a USE flag being set to
16 ensure that openvdb uses the same version they are building against.
17
18 Starting with openvdb 5, openvdb also requires
19 OPENVDB_ABI_VERSION_NUMBER to be set with the version to build against.
20 This is also hard to determine if the user does not have a USE flag
21 to determine which version is being built against.
22
23 To fix these problems, I am using abiX-compat where x is 3,4,5...
24 to determine the appropriate number for OPENVDB_ABI_VERSION_NUMBER
25 and other ebuilds can use these flags to determine which openvdb
26 abi to build against. It is required that openvdb and all programs
27 linking with it build against the same openvdb version.
28
29 These use flags are no longer set by default in the ebuild, so
30 the user must ensure they set abiX-compat in package.use for openvdb
31 and any other package using openvdb (which will be the new versions
32 of blender and openimageio).
33
34 These use flags must be set even if the user wants to build againt the
35 latest supported abi version (eg abi5-compat for openvdb-5.2.0), which
36 is a change from the old behaviour.
37
38 I personally think this would be better hidden away inside an eclass
39 and a USE_EXPAND variable. I have submitted a proposal and would
40 be happy to prepare a PR if desired. This can be found at https://
41 archives.gentoo.org/gentoo-dev/message/1df75c608c83530b43c6ea67e1db8930
42
43 Signed-off-by: Adrian Grigo <agrigo2001 <AT> yahoo.com.au>
44 Package-Manager: Portage-2.3.103, Repoman-2.3.23
45 Signed-off-by: Sam James <sam <AT> gentoo.org>
46
47 media-gfx/openvdb/metadata.xml | 11 +++++++----
48 media-gfx/openvdb/openvdb-4.0.2-r3.ebuild | 17 +++++++++++++++--
49 media-gfx/openvdb/openvdb-5.2.0-r1.ebuild | 20 +++++++++++++++++---
50 3 files changed, 39 insertions(+), 9 deletions(-)
51
52 diff --git a/media-gfx/openvdb/metadata.xml b/media-gfx/openvdb/metadata.xml
53 index 74706159594..43363d09c1a 100644
54 --- a/media-gfx/openvdb/metadata.xml
55 +++ b/media-gfx/openvdb/metadata.xml
56 @@ -15,11 +15,14 @@
57 Chance of Meatballs2' and 'How to Train Your Dragon 2'.
58 </longdescription>
59 <use>
60 - <flag restrict="&lt;media-gfx/openvdb-5.0.0" name="abi3-compat">
61 - Disables newer features to maintain compatibility with ABI3. Enabled by default.
62 + <flag name="abi3-compat">
63 + Disables newer features to maintain compatibility with ABI3.
64 </flag>
65 - <flag restrict="&gt;=media-gfx/openvdb-5.0.0" name="abi4-compat">
66 - Disables newer features to maintain compatibility with ABI4. Enabled by default.
67 + <flag restrict="&gt;=media-gfx/openvdb-4.0.0" name="abi4-compat">
68 + Disables newer features to maintain compatibility with ABI4.
69 + </flag>
70 + <flag restrict="&gt;=media-gfx/openvdb-5.0.0" name="abi5-compat">
71 + Disables newer features to maintain compatibility with ABI5.
72 </flag>
73 </use>
74 <upstream>
75
76 diff --git a/media-gfx/openvdb/openvdb-4.0.2-r3.ebuild b/media-gfx/openvdb/openvdb-4.0.2-r3.ebuild
77 index 7a9db2c7125..a34fc012d95 100644
78 --- a/media-gfx/openvdb/openvdb-4.0.2-r3.ebuild
79 +++ b/media-gfx/openvdb/openvdb-4.0.2-r3.ebuild
80 @@ -15,9 +15,13 @@ SRC_URI="https://github.com/AcademySoftwareFoundation/${PN}/archive/v${PV}.tar.g
81 LICENSE="MPL-2.0"
82 SLOT="0"
83 KEYWORDS="amd64 ~x86"
84 -IUSE="+abi3-compat doc python test"
85 +IUSE="abi3-compat abi4-compat doc python test"
86 RESTRICT="!test? ( test )"
87 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
88 +
89 +REQUIRED_USE="
90 + python? ( ${PYTHON_REQUIRED_USE} )
91 + ^^ ( abi3-compat abi4-compat )
92 +"
93
94 RDEPEND="
95 dev-libs/boost:=
96 @@ -71,6 +75,15 @@ src_configure() {
97 # To stay in sync with Boost
98 append-cxxflags -std=c++14
99
100 + local version
101 + if use abi3-compat; then
102 + version=3
103 + elif use abi4-compat; then
104 + version=4
105 + else
106 + die "Openvdb abi version is not compatible"
107 + fi
108 +
109 local mycmakeargs=(
110 -DBLOSC_LOCATION="${myprefix}"
111 -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}"
112
113 diff --git a/media-gfx/openvdb/openvdb-5.2.0-r1.ebuild b/media-gfx/openvdb/openvdb-5.2.0-r1.ebuild
114 index 383beb06342..4a84ca540d1 100644
115 --- a/media-gfx/openvdb/openvdb-5.2.0-r1.ebuild
116 +++ b/media-gfx/openvdb/openvdb-5.2.0-r1.ebuild
117 @@ -14,9 +14,12 @@ SRC_URI="https://github.com/AcademySoftwareFoundation/${PN}/archive/v${PV}.tar.g
118 LICENSE="MPL-2.0"
119 SLOT="0"
120 KEYWORDS="~amd64 ~x86"
121 -IUSE="+abi4-compat doc python test"
122 +IUSE="abi3-compat abi4-compat abi5-compat doc python test"
123 RESTRICT="!test? ( test )"
124 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
125 +REQUIRED_USE="
126 + python? ( ${PYTHON_REQUIRED_USE} )
127 + ^^ ( abi3-compat abi4-compat abi5-compat )
128 +"
129
130 RDEPEND="
131 dev-libs/boost:=
132 @@ -64,11 +67,22 @@ pkg_setup() {
133 src_configure() {
134 local myprefix="${EPREFIX}/usr/"
135
136 + local version
137 + if use abi3-compat; then
138 + version=3
139 + elif use abi4-compat; then
140 + version=4
141 + elif use abi5-compat; then
142 + version=5
143 + else
144 + die "Openvdb ABI version not specified"
145 + fi
146 +
147 local mycmakeargs=(
148 -DBLOSC_LOCATION="${myprefix}"
149 -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}"
150 -DGLFW3_LOCATION="${myprefix}"
151 - -DOPENVDB_ABI_VERSION_NUMBER=$(usex abi4-compat 4 5)
152 + -DOPENVDB_ABI_VERSION_NUMBER="${version}"
153 -DOPENVDB_BUILD_DOCS=$(usex doc)
154 -DOPENVDB_BUILD_PYTHON_MODULE=$(usex python)
155 -DOPENVDB_BUILD_UNITTESTS=$(usex test)