commit:     5ff97289ab2e63afcb5dfa0591312e0716ccada9
Author:     Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
AuthorDate: Fri Nov  5 18:31:59 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 10 01:02:28 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ff97289

sci-libs/opencascade: bump to 7.6.0

- move to using single slot/subslot mechanism to simplify the use
        of the library in revdeps

Bug: https://tracker.dev.opencascade.org/view.php?id=32650

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/opencascade/Manifest                 |   1 +
 sci-libs/opencascade/files/opencascade.env.in | 102 ++++++++++++++++
 sci-libs/opencascade/metadata.xml             |   4 +
 sci-libs/opencascade/opencascade-7.6.0.ebuild | 168 ++++++++++++++++++++++++++
 4 files changed, 275 insertions(+)

diff --git a/sci-libs/opencascade/Manifest b/sci-libs/opencascade/Manifest
index eddc8789850f..bd6eac9d5f78 100644
--- a/sci-libs/opencascade/Manifest
+++ b/sci-libs/opencascade/Manifest
@@ -1,2 +1,3 @@
 DIST opencascade-7.5.2.tar.gz 47812603 BLAKE2B 
86995ea60e24329f91a2cbede26112a70794fb091b34d33614bef412b05b8cc9f1e770aecf78272b54a241c2524422c86f8ff722b3f27b54bf10fa5eda626288
 SHA512 
f951a941043a56f381cfd25e4d78bb9ae08e5cc29a894e6c0c35daf30aeabf1e44ee09af65bb6b7d62d9325be67741ddcf52266b7186b4c336c70ed8bcfa1676
 DIST opencascade-7.5.3.tar.gz 47817862 BLAKE2B 
be438a08997c18c3cb2c08c520fff2f439cc8a406cc3f471be3b24f874ac3bd892c4afe6fa37f742ffb5da21b5a29f9c8f737e3160dcbda35a217286218eb5e1
 SHA512 
2d7cf284a1b3ce8d05151085b41579cc2f4e29489b7920769cd04f86a6d76e49f533b570226d3cf041c75582894ed8a6aff889312c7c507fffae47d3e57c5c47
+DIST opencascade-7.6.0.tar.gz 48193117 BLAKE2B 
c16cd096f20e90267a00b6be21b17b22b491cf5d9aa1a311d64d7707042dc88380c60ececceb6728dbcdd4ff56a67558144292950e11518b21cbc49ace4e88cd
 SHA512 
6839eb6641b9e0752474fce11cf1756223067febe0f5bcd5db249e3eccef29517a6952c124aae818220b6360070a792dacd1b0b4ce970b8351ce38598f31b4be

diff --git a/sci-libs/opencascade/files/opencascade.env.in 
b/sci-libs/opencascade/files/opencascade.env.in
new file mode 100644
index 000000000000..d7148c241f11
--- /dev/null
+++ b/sci-libs/opencascade/files/opencascade.env.in
@@ -0,0 +1,102 @@
+#
+# This file sets needed and optional environment variables for
+# Open CASCADE Technology
+#
+# See: 
https://dev.opencascade.org/doc/overview/html/index.html#OCCT_OVW_SECTION_4_2
+# for further documentation.
+#
+# Some of the values are set at compile time depending on what USE flags
+# were enabled. Those values are marked as such.
+
+# define the root directory of Open CASCADE Technology (needed)
+CASROOT="VAR_CASROOT"
+PATH="VAR_CASROOT/lib/opencascade-VAR_PV/bin"
+LDPATH="VAR_CASROOT/lib/opencascade-VAR_PV"
+
+#############################################################################
+# The MMGT_* variables are used to determine how memory management will work
+# in OCCT. All of those are optional. If they are not set here, their default
+# values will be used.
+#
+# Uncomment or change the ones you need to adapt from its default.
+#############################################################################
+# MMGT_OPT = {0,1,2} (default: 0) set at compile time
+#   if set to 0 (the default), every memory block is allocated in C
+#      memory heap directly (via malloc() and free()). Will be set, if
+#      neither the the 'optimize' nor the 'tbb' USE flags are set.
+#   if set to 1, the memory manager performs it's own internal optimization.
+#      Will be set, if the 'optimize' USE flag is set.
+#   if set to 2, Intel(R) TBB optimized memory manager is used. Will be set,
+#      if the 'tbb' USE flag is set.
+#MMGT_OPT=0
+
+# MMGT_CLEAR = {0,1} (default: 1)
+#   if set to 0, memory block is returned as it is. Will be set, if the
+#      'optimize' USE flag is set
+#   if set to 1, every allocated memory block is cleared by zeros
+#MMGT_CLEAR=1
+
+# MMGT_CELLSIZE (default: 200)
+#   defines the maximal size of blocks allocated in large pools of memory.
+#MMGT_CELLSIZE=200
+
+# MMGT_NBPAGES (default: 10000)
+#   defines the size of memory chunks allocated for small blocks in pages
+#      (OS dependant)
+#MMGT_NBPAGES=10000
+
+# MMGT_THRESHOLD (default: 40000)
+#   defines the maximal size of blocks that are recycled internally instead
+#   of being returned to the heap.
+#MMGT_THRESHOLD=40000
+
+# MMGT_MMAP = {0,1} (default: 1)
+#   if set to 0, large memory blocks will be allocated in the C heap by
+#      malloc()
+#   if set to 1, large memory blocks are allocated using memory mapping
+#      functions of the operating system.
+#MMGT_MMAP=1
+
+# CSF_LANGUAGE (default: us) optional
+#   defines the default language of messages indicated by a two-letter
+#   country code. Currently it's not verified if this work with other
+#   than the default languages, so we keep it commented.
+#CSF_LANGUAGE=us
+
+# CSF_DEBUG_BOP (default: undefined) optional
+#   if defined then it should specify the directory where diagnostic data
+#   on problems occured in Boolean operations will be saved. Not defined by
+#   default.
+#
+# NOTE: Only enable for debugging purposes. If set, this variable has a
+# large impact on the performance of boolean operations.
+#CSF_DEBUG_BOP="/var/tmp"
+
+# CSF_EXCEPTION_PROMPT (default: 1) optional
+#   not documented upstream (maybe a flag indicating whether the user shall
+#   be prompted in the case of exceptions)
+#CSF_EXCEPTION_PROMPT=1
+
+# The following CSF_* variables define various directories and files where
+# OCCT is looking for resources.
+CSF_GraphicShr="VAR_CASROOT/lib/opencascade-VAR_PV/libTKOpenGl.so"
+CSF_MIGRATION_TYPES="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource/MigrationSheet.txt"
+CSF_MDTVTexturesDirectory="VAR_CASROOT/share/opencascade-VAR_PV/resources/Textures"
+CSF_PluginDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
+CSF_StandardDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
+CSF_StandardLiteDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
+CSF_XCAFDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/StdResource"
+CSF_XmlOcafResource="VAR_CASROOT/share/opencascade-VAR_PV/resources/XmlOcafResource"
+# The below values might be optional.
+CSF_IGESDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource"
+CSF_ShadersDirectory="VAR_CASROOT/share/opencascade-VAR_PV/resources/Shaders"
+CSF_SHMessage="VAR_CASROOT/share/opencascade-VAR_PV/resources/SHMessage"
+CSF_STEPDefaults="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSTEPResource"
+CSF_UnitsDefinition="VAR_CASROOT/share/opencascade-VAR_PV/resources/UnitsAPI/Units.dat"
+CSF_XSMessage="VAR_CASROOT/share/opencascade-VAR_PV/resources/XSMessage"
+
+# TODO: check those
+# they were defined in the original ebuild but the directories and files
+# are not present in the current installation.
+#CSF_MDTVFontDirectory="VAR_CASROOT/src/FontMFT"
+#CSF_UnitsLexicon="VAR_CASROOT/src/UnitsAPI/Lexi_Expr.dat"

diff --git a/sci-libs/opencascade/metadata.xml 
b/sci-libs/opencascade/metadata.xml
index fe7ad33b9523..d1b713a48a87 100644
--- a/sci-libs/opencascade/metadata.xml
+++ b/sci-libs/opencascade/metadata.xml
@@ -10,6 +10,10 @@
        <name>Proxy Maintainers</name>
 </maintainer>
 <use>
+       <flag name="eigen">
+               Enable support for eigenvalues through the header-only
+               <pkg>dev-cpp/eigen</pkg> package.
+       </flag>
        <flag name="freeimage">
                Enable support for image i/o via <pkg>media-libs/freeimage</pkg>
        </flag>

diff --git a/sci-libs/opencascade/opencascade-7.6.0.ebuild 
b/sci-libs/opencascade/opencascade-7.6.0.ebuild
new file mode 100644
index 000000000000..e9eafc6f8515
--- /dev/null
+++ b/sci-libs/opencascade/opencascade-7.6.0.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+MY_PV="$(ver_rs 1- '_')"
+MY_SLOT="$(ver_cut 1-2)"
+
+DESCRIPTION="Development platform for CAD/CAE, 3D surface/solid modeling and 
data exchange"
+HOMEPAGE="https://www.opencascade.com";
+SRC_URI="https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V${MY_PV};sf=tgz
 -> ${P}.tar.gz"
+S="${WORKDIR}/occt-V${MY_PV}"
+
+LICENSE="|| ( Open-CASCADE-LGPL-2.1-Exception-1.0 LGPL-2.1 )"
+SLOT="0/${MY_SLOT}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="doc eigen examples ffmpeg freeimage gles2 json optimize tbb vtk"
+
+REQUIRED_USE="?? ( optimize tbb )"
+
+# There's no easy way to test. Testing needs a rather big environment
+# properly set up.
+RESTRICT="test"
+
+RDEPEND="
+       dev-lang/tcl:=
+       dev-lang/tk:=
+       dev-tcltk/itcl
+       dev-tcltk/itk
+       dev-tcltk/tix
+       media-libs/fontconfig
+       media-libs/freetype:2
+       media-libs/ftgl
+       virtual/glu
+       virtual/opengl
+       x11-libs/libXmu
+       examples? (
+               dev-qt/qtcore:5
+               dev-qt/qtgui:5
+               dev-qt/qtquickcontrols2:5
+               dev-qt/qtwidgets:5
+               dev-qt/qtxml:5
+       )
+       ffmpeg? ( media-video/ffmpeg:= )
+       freeimage? ( media-libs/freeimage )
+       tbb? ( <dev-cpp/tbb-2021.4 )
+       vtk? ( sci-libs/vtk:=[rendering] )
+"
+DEPEND="
+       ${RDEPEND}
+       eigen? ( dev-cpp/eigen )
+       json? ( dev-libs/rapidjson )
+"
+BDEPEND="
+       doc? ( app-doc/doxygen[dot] )
+       examples? ( dev-qt/linguist-tools:5 )
+"
+
+PATCHES=(
+       
"${FILESDIR}"/${PN}-7.5.1-0004-fix-installation-of-cmake-config-files.patch
+       "${FILESDIR}"/${PN}-7.5.1-0005-fix-write-permissions-on-scripts.patch
+       "${FILESDIR}"/${PN}-7.5.1-0006-fix-creation-of-custom.sh-script.patch
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       sed -e 's|/lib\$|/'$(get_libdir)'\$|' \
+               -i adm/templates/OpenCASCADEConfig.cmake.in || die
+
+       # There is an OCCT_UPDATE_TARGET_FILE cmake macro that fails due to some
+       # assumptions it makes about installation paths. Rather than fixing it, 
just
+       # get rid of the mechanism altogether - its purpose is to allow a
+       # side-by-side installation of release and debug libraries.
+       sed -e 's|\\${OCCT_INSTALL_BIN_LETTER}||' \
+               -i adm/cmake/occt_toolkit.cmake || die
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_DOC_Overview=$(usex doc)
+               -DBUILD_Inspector=$(usex examples)
+
+               -DINSTALL_DIR_BIN="$(get_libdir)/${PN}/bin"
+               -DINSTALL_DIR_CMAKE="$(get_libdir)/cmake/${PN}"
+               -DINSTALL_DIR_DATA="share/${PN}/data"
+               -DINSTALL_DIR_DOC="share/doc/${PF}"
+               -DINSTALL_DIR_INCLUDE="include/${PN}"
+               -DINSTALL_DIR_LIB="$(get_libdir)/${PN}"
+               -DINSTALL_DIR_RESOURCE="share/${PN}/resources"
+               -DINSTALL_DIR_SAMPLES="share/${PN}/samples"
+               -DINSTALL_DIR_SCRIPT="$(get_libdir)/${PN}/bin"
+               -DINSTALL_DIR_WITH_VERSION=OFF
+               -DINSTALL_SAMPLES=$(usex examples)
+               -DINSTALL_TEST_CASES=NO
+
+               -DUSE_D3D=NO
+               # no package yet in tree
+               -DUSE_DRACO=OFF
+               -DUSE_EIGEN=$(usex eigen)
+               -DUSE_FFMPEG=$(usex ffmpeg)
+               -DUSE_FREEIMAGE=$(usex freeimage)
+               -DUSE_FREETYPE=ON
+               -DUSE_GLES2=$(usex gles2)
+               -DUSE_OPENGL=$(usex !gles2)
+               # no package in tree
+               -DUSE_OPENVR=OFF
+               -DUSE_RAPIDJSON=$(usex json)
+               -DUSE_TBB=$(usex tbb)
+               -DUSE_VTK=$(usex vtk)
+               -DUSE_XLIB=ON
+       )
+
+       use doc && mycmakeargs+=( -DINSTALL_DOC_Overview=ON )
+
+       if use examples; then
+               mycmakeargs+=(
+                       -D3RDPARTY_QT_DIR="${ESYSROOT}"/usr
+                       -DBUILD_SAMPLES_QT=ON
+               )
+       fi
+
+       if use vtk; then
+               if has_version ">=sci-libs/vtk-9.1.0"; then
+                       mycmakeargs+=(
+                               -D3RDPARTY_VTK_DIR="${ESYSROOT}"/usr
+                               
-D3RDPARTY_VTK_INCLUDE_DIR="${ESYSROOT}"/usr/include/vtk-9.1
+                               
-D3RDPARTY_VTK_LIBRARY_DIR="${ESYSROOT}"/usr/$(get_libdir)
+                       )
+               elif has_version ">=sci-libs/vtk-9.0.0"; then
+                       mycmakeargs+=(
+                               -D3RDPARTY_VTK_DIR="${ESYSROOT}"/usr
+                               
-D3RDPARTY_VTK_INCLUDE_DIR="${ESYSROOT}"/usr/include/vtk-9.0
+                               
-D3RDPARTY_VTK_LIBRARY_DIR="${ESYSROOT}"/usr/$(get_libdir)
+                       )
+               fi
+       fi
+
+       cmake_src_configure
+
+       sed -e "s|lib/|$(get_libdir)/|" \
+               -e "s|VAR_PV|${PV}|" \
+               -e "s|VAR_CASROOT|${ESYSROOT}/usr|" \
+               < "${FILESDIR}"/${PN}.env.in > "${T}"/99${PN} || die
+
+       # use TBB for memory allocation optimizations
+       if use tbb; then
+               sed -e 's|^#MMGT_OPT=0$|MMGT_OPT=2|' -i "${T}"/99${PN} || die
+       fi
+
+       # use internal optimized memory manager and don't clear memory with this
+       # memory manager.
+       if use optimize ; then
+               sed -e 's|^#MMGT_OPT=0$|MMGT_OPT=1|' \
+                       -e 's|^#MMGT_CLEAR=1$|MMGT_CLEAR=0|' \
+                       -i "${T}"/99${PN} || die
+       fi
+}
+
+src_install() {
+       cmake_src_install
+
+       doenvd "${T}/99${PN}"
+
+       docompress -x /usr/share/doc/${PF}/overview/html
+}

Reply via email to