Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/opencascade/files/, sci-libs/opencascade/
Date: Wed, 07 Jul 2021 20:05:56
Message-Id: 1625688284.17c99e0bcaa5ed97c1e737d0c1bae60c1d35a69c.ionen@gentoo
1 commit: 17c99e0bcaa5ed97c1e737d0c1bae60c1d35a69c
2 Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
3 AuthorDate: Sun Jun 6 19:01:10 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 7 20:04:44 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17c99e0b
7
8 sci-libs/opencascade: bump to 7.5.2
9
10 Quote paths in template env file
11
12 Package-Manager: Portage-3.0.20, Repoman-3.0.3
13 Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
14 Closes: https://github.com/gentoo/gentoo/pull/21149
15 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
16
17 sci-libs/opencascade/Manifest | 1 +
18 sci-libs/opencascade/files/opencascade-7.5.env.in | 40 ++---
19 sci-libs/opencascade/opencascade-7.5.2.ebuild | 171 ++++++++++++++++++++++
20 3 files changed, 192 insertions(+), 20 deletions(-)
21
22 diff --git a/sci-libs/opencascade/Manifest b/sci-libs/opencascade/Manifest
23 index 77c4e42f391..29f10ccec88 100644
24 --- a/sci-libs/opencascade/Manifest
25 +++ b/sci-libs/opencascade/Manifest
26 @@ -1,2 +1,3 @@
27 DIST opencascade-7.4.0.tar.gz 49210449 BLAKE2B c92afe7551e9a066ad0940dcf49278b556a726f0534131706b3a11cb0986ba32818e162df3982283f6815eb9d67d7e91f909485d78f2b8d638da1934ffbc2f7f SHA512 eb0d47848d48f42a159ae5d7a4144483ba1f59f634844bd2053e48e04af30a30ba7056112cd38a1730d193a8d736b898f9608dd574cbe6829dbe7257a002772a
28 DIST opencascade-7.5.1.tar.gz 47807222 BLAKE2B b5ef30ea7c373250db3e0863f3c7fde84256b37957a482f10a462a4c4ed1a21cffbbeb10e9fc140325022d7582efbd292ed6d1016d14cb67ccf5c84d14060d5a SHA512 ebb937254ac165041ef7e1a80df8f9d2ac1d518f01b3d4b0fd6d203fe0d80bd474b85a462cccc1c74a513bd257c0b0ab7002632573f38bf72170363c7e42ed2f
29 +DIST opencascade-7.5.2.tar.gz 47812603 BLAKE2B 86995ea60e24329f91a2cbede26112a70794fb091b34d33614bef412b05b8cc9f1e770aecf78272b54a241c2524422c86f8ff722b3f27b54bf10fa5eda626288 SHA512 f951a941043a56f381cfd25e4d78bb9ae08e5cc29a894e6c0c35daf30aeabf1e44ee09af65bb6b7d62d9325be67741ddcf52266b7186b4c336c70ed8bcfa1676
30
31 diff --git a/sci-libs/opencascade/files/opencascade-7.5.env.in b/sci-libs/opencascade/files/opencascade-7.5.env.in
32 index 50766cbb6bb..d7148c241f1 100644
33 --- a/sci-libs/opencascade/files/opencascade-7.5.env.in
34 +++ b/sci-libs/opencascade/files/opencascade-7.5.env.in
35 @@ -9,9 +9,9 @@
36 # were enabled. Those values are marked as such.
37
38 # define the root directory of Open CASCADE Technology (needed)
39 -CASROOT=VAR_CASROOT
40 -PATH=VAR_CASROOT/lib/opencascade-VAR_PV/bin
41 -LDPATH=VAR_CASROOT/lib/opencascade-VAR_PV
42 +CASROOT="VAR_CASROOT"
43 +PATH="VAR_CASROOT/lib/opencascade-VAR_PV/bin"
44 +LDPATH="VAR_CASROOT/lib/opencascade-VAR_PV"
45
46 #############################################################################
47 # The MMGT_* variables are used to determine how memory management will work
48 @@ -70,7 +70,7 @@ LDPATH=VAR_CASROOT/lib/opencascade-VAR_PV
49 #
50 # NOTE: Only enable for debugging purposes. If set, this variable has a
51 # large impact on the performance of boolean operations.
52 -#CSF_DEBUG_BOP=/var/tmp
53 +#CSF_DEBUG_BOP="/var/tmp"
54
55 # CSF_EXCEPTION_PROMPT (default: 1) optional
56 # not documented upstream (maybe a flag indicating whether the user shall
57 @@ -79,24 +79,24 @@ LDPATH=VAR_CASROOT/lib/opencascade-VAR_PV
58
59 # The following CSF_* variables define various directories and files where
60 # OCCT is looking for resources.
61 -CSF_GraphicShr=VAR_CASROOT/lib/opencascade-VAR_PV/libTKOpenGl.so
62 -CSF_MIGRATION_TYPES=VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource/MigrationSheet.txt
63 -CSF_MDTVTexturesDirectory=VAR_CASROOT/share/opencascade-VAR_PV/resources/Textures
64 -CSF_PluginDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource
65 -CSF_StandardDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource
66 -CSF_StandardLiteDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource
67 -CSF_XCAFDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource
68 -CSF_XmlOcafResource=VAR_CASROOT/share/opencascade-VAR_PV/resources/XmlOcafResource
69 +CSF_GraphicShr="VAR_CASROOT/lib/opencascade-VAR_PV/libTKOpenGl.so"
70 +CSF_MIGRATION_TYPES="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource/MigrationSheet.txt"
71 +CSF_MDTVTexturesDirectory="VAR_CASROOT/share/opencascade-VAR_PV/resources/Textures"
72 +CSF_PluginDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
73 +CSF_StandardDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
74 +CSF_StandardLiteDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
75 +CSF_XCAFDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
76 +CSF_XmlOcafResource="VAR_CASROOT/share/opencascade-VAR_PV/resources/XmlOcafResource"
77 # The below values might be optional.
78 -CSF_IGESDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource
79 -CSF_ShadersDirectory=VAR_CASROOT/share/opencascade-VAR_PV/resources/Shaders
80 -CSF_SHMessage=VAR_CASROOT/share/opencascade-VAR_PV/resources/SHMessage
81 -CSF_STEPDefaults=VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource
82 -CSF_UnitsDefinition=VAR_CASROOT/share/opencascade-VAR_PV/resources/UnitsAPI/Units.dat
83 -CSF_XSMessage=VAR_CASROOT/share/opencascade-VAR_PV/resources/XSMessage
84 +CSF_IGESDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource"
85 +CSF_ShadersDirectory="VAR_CASROOT/share/opencascade-VAR_PV/resources/Shaders"
86 +CSF_SHMessage="VAR_CASROOT/share/opencascade-VAR_PV/resources/SHMessage"
87 +CSF_STEPDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource"
88 +CSF_UnitsDefinition="VAR_CASROOT/share/opencascade-VAR_PV/resources/UnitsAPI/Units.dat"
89 +CSF_XSMessage="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSMessage"
90
91 # TODO: check those
92 # they were defined in the original ebuild but the directories and files
93 # are not present in the current installation.
94 -#CSF_MDTVFontDirectory=VAR_CASROOT/src/FontMFT
95 -#CSF_UnitsLexicon=VAR_CASROOT/src/UnitsAPI/Lexi_Expr.dat
96 +#CSF_MDTVFontDirectory="VAR_CASROOT/src/FontMFT"
97 +#CSF_UnitsLexicon="VAR_CASROOT/src/UnitsAPI/Lexi_Expr.dat"
98
99 diff --git a/sci-libs/opencascade/opencascade-7.5.2.ebuild b/sci-libs/opencascade/opencascade-7.5.2.ebuild
100 new file mode 100644
101 index 00000000000..59a4a6c42c7
102 --- /dev/null
103 +++ b/sci-libs/opencascade/opencascade-7.5.2.ebuild
104 @@ -0,0 +1,171 @@
105 +# Copyright 1999-2021 Gentoo Authors
106 +# Distributed under the terms of the GNU General Public License v2
107 +
108 +EAPI=7
109 +
110 +inherit cmake flag-o-matic
111 +
112 +MY_PV="$(ver_rs 1- '_')"
113 +PV_MAJ="$(ver_cut 1-2)"
114 +
115 +DESCRIPTION="Development platform for CAD/CAE, 3D surface/solid modeling and data exchange"
116 +HOMEPAGE="https://www.opencascade.com"
117 +SRC_URI="https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V${MY_PV};sf=tgz -> ${P}.tar.gz"
118 +S="${WORKDIR}/occt-V${MY_PV}"
119 +
120 +LICENSE="|| ( Open-CASCADE-LGPL-2.1-Exception-1.0 LGPL-2.1 )"
121 +SLOT="${PV_MAJ}"
122 +KEYWORDS="~amd64 ~arm64 ~x86"
123 +IUSE="debug doc examples ffmpeg freeimage gles2 json optimize tbb vtk"
124 +
125 +REQUIRED_USE="?? ( optimize tbb )"
126 +
127 +# There's no easy way to test. Testing needs a rather big environment
128 +# properly set up.
129 +RESTRICT="test"
130 +
131 +RDEPEND="
132 + app-eselect/eselect-opencascade
133 + dev-lang/tcl:=
134 + dev-lang/tk:=
135 + dev-tcltk/itcl
136 + dev-tcltk/itk
137 + dev-tcltk/tix
138 + media-libs/fontconfig
139 + media-libs/freetype:2
140 + media-libs/ftgl
141 + virtual/glu
142 + virtual/opengl
143 + x11-libs/libXmu
144 + examples? (
145 + dev-qt/qtcore:5
146 + dev-qt/qtgui:5
147 + dev-qt/qtquickcontrols2:5
148 + dev-qt/qtwidgets:5
149 + dev-qt/qtxml:5
150 + )
151 + ffmpeg? ( media-video/ffmpeg:= )
152 + freeimage? ( media-libs/freeimage )
153 + tbb? ( dev-cpp/tbb )
154 + vtk? ( sci-libs/vtk:=[rendering] )
155 +"
156 +DEPEND="
157 + ${RDEPEND}
158 + dev-cpp/eigen
159 + dev-libs/rapidjson
160 +"
161 +BDEPEND="
162 + app-eselect/eselect-opencascade
163 + doc? ( app-doc/doxygen )
164 + examples? ( dev-qt/linguist-tools:5 )
165 +"
166 +
167 +PATCHES=(
168 + "${FILESDIR}"/${PN}-7.5.1-0001-allow-default-search-path-for-Qt5.patch
169 + "${FILESDIR}"/${PN}-7.5.1-0002-remove-unnecessary-Qt5-check.patch
170 + "${FILESDIR}"/${PN}-7.5.1-0003-add-Gentoo-configuration-type.patch
171 + "${FILESDIR}"/${PN}-7.5.1-0004-fix-installation-of-cmake-config-files.patch
172 + "${FILESDIR}"/${PN}-7.5.1-0005-fix-write-permissions-on-scripts.patch
173 + "${FILESDIR}"/${PN}-7.5.1-0006-fix-creation-of-custom.sh-script.patch
174 + "${FILESDIR}"/${PN}-7.5.1-fix-AllValues-name-collision-with-vtk-9.0.patch
175 +)
176 +
177 +src_prepare() {
178 + cmake_src_prepare
179 +
180 + use debug && append-cppflags -DDEBUG
181 +
182 + sed -e 's|/lib\$|/'$(get_libdir)'\$|' \
183 + -i adm/templates/OpenCASCADEConfig.cmake.in || die
184 +
185 + # There is an OCCT_UPDATE_TARGET_FILE cmake macro that fails due to some
186 + # assumptions it makes about installation paths. Rather than fixing it, just
187 + # get rid of the mechanism altogether - its purpose is to allow a
188 + # side-by-side installation of release and debug libraries.
189 + sed -e 's|\\${OCCT_INSTALL_BIN_LETTER}||' \
190 + -i adm/cmake/occt_toolkit.cmake || die
191 +}
192 +
193 +src_configure() {
194 + local mycmakeargs=(
195 + -DBUILD_DOC_Overview=$(usex doc)
196 + -DBUILD_Inspector=$(usex examples)
197 + -DBUILD_WITH_DEBUG=$(usex debug)
198 + -DINSTALL_DIR_BIN="$(get_libdir)/${P}/bin"
199 + -DINSTALL_DIR_CMAKE="$(get_libdir)/cmake/${P}"
200 + -DINSTALL_DIR_DOC="share/doc/${PF}"
201 + -DINSTALL_DIR_LIB="$(get_libdir)/${P}"
202 + -DINSTALL_DIR_SCRIPT="$(get_libdir)/${P}/bin"
203 + -DINSTALL_DIR_WITH_VERSION=ON
204 + -DINSTALL_SAMPLES=$(usex examples)
205 + -DINSTALL_TEST_CASES=NO
206 + -DUSE_D3D=NO
207 + -DUSE_FFMPEG=$(usex ffmpeg)
208 + -DUSE_FREEIMAGE=$(usex freeimage)
209 + -DUSE_FREETYPE=ON
210 + -DUSE_GLES2=$(usex gles2)
211 + -DUSE_RAPIDJSON=$(usex json)
212 + -DUSE_TBB=$(usex tbb)
213 + -DUSE_VTK=$(usex vtk)
214 + )
215 +
216 + use doc && mycmakeargs+=( -DINSTALL_DOC_Overview=ON )
217 +
218 + if use examples; then
219 + mycmakeargs+=(
220 + -D3RDPARTY_QT_DIR="${ESYSROOT}"/usr
221 + -DBUILD_SAMPLES_QT=ON
222 + )
223 + fi
224 +
225 + if use vtk; then
226 + if has_version ">=sci-libs/vtk-9.0.0"; then
227 + mycmakeargs+=(
228 + -D3RDPARTY_VTK_DIR="${ESYSROOT}"/usr
229 + -D3RDPARTY_VTK_INCLUDE_DIR="${ESYSROOT}"/usr/include/vtk-9.0
230 + -D3RDPARTY_VTK_LIBRARY_DIR="${ESYSROOT}"/usr/$(get_libdir)
231 + )
232 + fi
233 + fi
234 +
235 + cmake_src_configure
236 +
237 + # prepare /etc/env.d file
238 + sed -e "s|lib/|$(get_libdir)/|" \
239 + -e "s|VAR_PV|${PV}|" \
240 + -e "s|VAR_CASROOT|${ESYSROOT}/usr|" \
241 + < "${FILESDIR}"/${PN}-${PV_MAJ}.env.in > "${T}"/${PV_MAJ} || die
242 +
243 + # use TBB for memory allocation optimizations
244 + if use tbb; then
245 + sed -e 's|^#MMGT_OPT=0$|MMGT_OPT=2|' -i "${T}"/${PV_MAJ} || die
246 + fi
247 +
248 + # use internal optimized memory manager and don't clear memory with this
249 + # memory manager.
250 + if use optimize ; then
251 + sed -e 's|^#MMGT_OPT=0$|MMGT_OPT=1|' \
252 + -e 's|^#MMGT_CLEAR=1$|MMGT_CLEAR=0|' \
253 + -i "${T}"/${PV_MAJ} || die
254 + fi
255 +}
256 +
257 +src_install() {
258 + cmake_src_install
259 +
260 + # respect slotting
261 + insinto "/etc/env.d/${PN}"
262 + doins "${T}/${PV_MAJ}"
263 +
264 + # remove examples
265 + if use !examples; then
266 + rm -r "${ED}/usr/share/${P}/samples" || die
267 + fi
268 +
269 + docompress -x /usr/share/doc/${PF}/overview/html
270 +}
271 +
272 +pkg_postinst() {
273 + eselect ${PN} set ${PV_MAJ} || die "failed to switch to updated implementation"
274 + einfo "You can switch between available ${PN} implementations using eselect ${PN}"
275 +}