summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-libs/opencascade/Manifest1
-rw-r--r--sci-libs/opencascade/files/opencascade-7.4.0-find-qt.patch85
-rw-r--r--sci-libs/opencascade/files/opencascade-7.4.0-fix-install.patch133
-rw-r--r--sci-libs/opencascade/files/opencascade-7.4.0.env.in103
-rw-r--r--sci-libs/opencascade/metadata.xml27
-rw-r--r--sci-libs/opencascade/opencascade-7.4.0.ebuild140
6 files changed, 484 insertions, 5 deletions
diff --git a/sci-libs/opencascade/Manifest b/sci-libs/opencascade/Manifest
index 52dffdbc97c..d999b843d5d 100644
--- a/sci-libs/opencascade/Manifest
+++ b/sci-libs/opencascade/Manifest
@@ -1 +1,2 @@
DIST opencascade-7.3.0.tar.gz 48576720 BLAKE2B bf63ba77aabc8a8c92d694f78f24bab71c07e68e7ba4b8d5d90966733dbd9c0c83a76e35f059e798d4a60640d663330cd13a828b19ec02a5372053ab39a74aa6 SHA512 17eb1810b43a8b001867563f97801ceb38a7878fa53d9b39b46a5cf3dd676310fa80e83e90668a99ec6aff9d4f09733fb6c7be83c1e3ab4eaa9fda55888050da
+DIST opencascade-7.4.0.tar.gz 49210449 BLAKE2B c92afe7551e9a066ad0940dcf49278b556a726f0534131706b3a11cb0986ba32818e162df3982283f6815eb9d67d7e91f909485d78f2b8d638da1934ffbc2f7f SHA512 eb0d47848d48f42a159ae5d7a4144483ba1f59f634844bd2053e48e04af30a30ba7056112cd38a1730d193a8d736b898f9608dd574cbe6829dbe7257a002772a
diff --git a/sci-libs/opencascade/files/opencascade-7.4.0-find-qt.patch b/sci-libs/opencascade/files/opencascade-7.4.0-find-qt.patch
new file mode 100644
index 00000000000..1ebc1106a31
--- /dev/null
+++ b/sci-libs/opencascade/files/opencascade-7.4.0-find-qt.patch
@@ -0,0 +1,85 @@
+From 7304c888e57a581e9dc8ef2005e960ec579d58f4 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl@gmail.com>
+Date: Sat, 9 Nov 2019 17:15:27 +0100
+Subject: [PATCH] Gentoo-specific: disable internal 3RDPARTY_QT_DIR
+
+The patch disables searching for internal 3rd-party Qt. Instead
+system installed Qt is used. The call to find_package uses REQUIRED
+flag for this.
+
+Signed-off-by: Bernd Waibel <waebbl@gmail.com>
+---
+ adm/cmake/qt.cmake | 24 ++++++++++++------------
+ adm/cmake/qt_macro.cmake | 6 +++---
+ 2 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/adm/cmake/qt.cmake b/adm/cmake/qt.cmake
+index 6958bab5..b6a9b794 100644
+--- a/adm/cmake/qt.cmake
++++ b/adm/cmake/qt.cmake
+@@ -3,27 +3,27 @@
+ # Qt is searched manually first (just determine root)
+ message (STATUS "Processing Qt 3-rd party")
+
+-if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
+- FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
++#if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
++# FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
+
+- if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
+- message (FATAL_ERROR "... Qt root directory was not found")
+- endif()
++# if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
++# message (FATAL_ERROR "... Qt root directory was not found")
++# endif()
+
+ # Combine directory name with absolute path and show in GUI
+- set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
+- message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
+-endif()
++# set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
++# message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
++#endif()
+
+-set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
++#set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
+
+ # Now set CMAKE_PREFIX_PATH to point to local Qt installation.
+ # Without this setting find_package() will not work
+-set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
++#set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
+
+ # Now we can apply standard CMake finder for Qt5. We do this mostly
+ # to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
+-find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
++find_package(Qt5 COMPONENTS Widgets Quick Xml REQUIRED)
+ if (NOT ${Qt5_FOUND})
+ # Now we can apply standard CMake finder for Qt. We do this mostly
+ # to have qt4_wrap_cpp() function available
+@@ -31,4 +31,4 @@ if (NOT ${Qt5_FOUND})
+ #message (STATUS "Qt4 cmake configuration")
+ else()
+ #message (STATUS "Qt5 cmake configuration")
+-endif()
+\ No newline at end of file
++endif()
+diff --git a/adm/cmake/qt_macro.cmake b/adm/cmake/qt_macro.cmake
+index ec897384..8bd314a4 100644
+--- a/adm/cmake/qt_macro.cmake
++++ b/adm/cmake/qt_macro.cmake
+@@ -2,9 +2,9 @@
+
+ macro (FIND_QT_PACKAGE PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
+
+- if ("${3RDPARTY_QT_DIR}" STREQUAL "")
+- message (FATAL_ERROR "Empty Qt dir")
+- endif()
++# if ("${3RDPARTY_QT_DIR}" STREQUAL "")
++# message (FATAL_ERROR "Empty Qt dir")
++# endif()
+
+ if (${Qt5_FOUND})
+ #message (STATUS "Qt5 cmake configuration")
+--
+2.23.0
+
diff --git a/sci-libs/opencascade/files/opencascade-7.4.0-fix-install.patch b/sci-libs/opencascade/files/opencascade-7.4.0-fix-install.patch
new file mode 100644
index 00000000000..edf3545a74b
--- /dev/null
+++ b/sci-libs/opencascade/files/opencascade-7.4.0-fix-install.patch
@@ -0,0 +1,133 @@
+From 95c7c85f776d6e4764f2146c8385d6e29762043d Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl@gmail.com>
+Date: Sat, 16 Nov 2019 18:28:11 +0100
+Subject: [PATCH] Gentoo-specific: patch installation paths
+
+Patch parts of cmake to install into proper locations and handle slotting.
+
+Signed-off-by: Bernd Waibel <waebbl@gmail.com>
+---
+ CMakeLists.txt | 28 +++++++++++++++-------------
+ adm/cmake/occt_macros.cmake | 2 +-
+ 2 files changed, 16 insertions(+), 14 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0b445de9..1fd5779e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,6 +15,8 @@ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
+ endif()
+ endmacro()
+
++SET(CMAKE_INSTALL_DO_STRIP OFF)
++
+ # include variable description
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
+
+@@ -231,7 +233,7 @@ endif()
+ # place the libraries to <prefix>/lib folder for unix and leave old structure for windows
+ if (NOT DEFINED INSTALL_DIR_LIB)
+ if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
+- set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
++ set (INSTALL_DIR_LIB "lib${LIB_SUFFIX}" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
+ else()
+ set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
+ endif()
+@@ -315,9 +317,9 @@ endif()
+ if (NOT DEFINED INSTALL_DIR_CMAKE)
+ if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
+ if (INSTALL_DIR_WITH_VERSION)
+- set (INSTALL_DIR_CMAKE "lib/cmake/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
++ set (INSTALL_DIR_CMAKE "lib${LIB_SUFFIX}/cmake/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
+ else()
+- set (INSTALL_DIR_CMAKE "lib/cmake/opencascade" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
++ set (INSTALL_DIR_CMAKE "lib${LIB_SUFFIX}/cmake/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
+ endif()
+ else()
+ set (INSTALL_DIR_CMAKE "cmake" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
+@@ -868,10 +870,10 @@ if (${DRAWEXE_INDEX} GREATER -1)
+ # copy draw script to install script folder
+ if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
+ install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ else()
+ install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ endif()
+
+ # copy draw script to CMake binary folder
+@@ -892,9 +894,9 @@ if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}")
+
+ set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
+
+- file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
++ file (WRITE "${CMAKE_BINARY_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
+ else()
+- OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
++ OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
+ endif()
+
+ if (WIN32)
+@@ -1067,10 +1069,10 @@ if (BUILD_TOOL_TOOLKITS)
+ # copy tinspector script to install script folder
+ if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
+ install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ else()
+ install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ endif()
+
+ set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
+@@ -1122,7 +1124,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
+ endforeach()
+ # install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
+ install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
+-install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
++install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"\$ENV{DESTDIR}${INSTALL_DIR_CMAKE}/opencascade-${OCC_VERSION_STRING_EXT}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
+
+ foreach (OCCT_MODULE ${OCCT_MODULES})
+ if (BUILD_MODULE_${OCCT_MODULE})
+@@ -1163,7 +1165,7 @@ endif()
+
+ # Configure and install cmake config file
+ configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY)
+-install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
++install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}/opencascade-${OCC_VERSION_STRING_EXT}")
+
+ # Configure cmake version file
+ include(CMakePackageConfigHelpers)
+@@ -1172,11 +1174,11 @@ write_basic_package_version_file( ${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.c
+ COMPATIBILITY ExactVersion )
+
+ # Install cmake version file
+-install (FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
++install (FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake" DESTINATION "${INSTALL_DIR_CMAKE}/opencascade-${OCC_VERSION_STRING_EXT}")
+
+ # Install the export set for use with the install-tree for each configuration
+ foreach (OCCT_MODULE ${OCCT_MODULES_ENABLED})
+- install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}")
++ install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}/opencascade-${OCC_VERSION_STRING_EXT}")
+ endforeach()
+
+ # Update generated OpenCASCADETargets-*.cmake files
+diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake
+index 8220ecd5..228d801b 100644
+--- a/adm/cmake/occt_macros.cmake
++++ b/adm/cmake/occt_macros.cmake
+@@ -598,7 +598,7 @@ macro (OCCT_UPDATE_TARGET_FILE)
+ "cmake_policy(PUSH)
+ cmake_policy(SET CMP0007 NEW)
+ string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
+- file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
++ file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR_CMAKE}/opencascade-${OCC_VERSION_STRING_EXT}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
+ foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
+ file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
+ file (REMOVE \"\${TARGET_FILENAME}\")
+--
+2.23.0
+
diff --git a/sci-libs/opencascade/files/opencascade-7.4.0.env.in b/sci-libs/opencascade/files/opencascade-7.4.0.env.in
new file mode 100644
index 00000000000..2eefe188c1a
--- /dev/null
+++ b/sci-libs/opencascade/files/opencascade-7.4.0.env.in
@@ -0,0 +1,103 @@
+#
+# 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 and LDPATH are used to find the binaries and libraries of OCCT (needed)
+PATH=VAR_CASROOT/bin
+LDPATH=VAR_CASROOT/lib
+
+#############################################################################
+# 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/libTKOpenGl.so
+CSF_MIGRATION_TYPES=VAR_CASROOT/share/opencascade/resources/StdResource/MigrationSheet.txt
+CSF_MDTVTexturesDirectory=VAR_CASROOT/share/opencascade/resources/Textures
+CSF_PluginDefaults=VAR_CASROOT/share/opencascade/resources/StdResource
+CSF_StandardDefaults=VAR_CASROOT/share/opencascade/resources/StdResource
+CSF_StandardLiteDefaults=VAR_CASROOT/share/opencascade/resources/StdResource
+CSF_XCAFDefaults=VAR_CASROOT/share/opencascade/resources/StdResource
+CSF_XmlOcafResource=VAR_CASROOT/share/opencascade/resources/XmlOcafResource
+# The below values might be optional.
+CSF_IGESDefaults=VAR_CASROOT/share/opencascade/resources/XSTEPResource
+CSF_ShadersDirectory=VAR_CASROOT/share/opencascade/resources/Shaders
+CSF_SHMessage=VAR_CASROOT/share/opencascade/resources/SHMessage
+CSF_STEPDefaults=VAR_CASROOT/share/opencascade/resources/XSTEPResource
+CSF_UnitsDefinition=/usr/lib64/opencascade-7.3.0/ros/share/opencascade/resources/UnitsAPI/Units.dat
+CSF_XSMessage=/usr/lib64/opencascade-7.3.0/ros/share/opencascade/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 cfb5bac89f9..c601fab04b3 100644
--- a/sci-libs/opencascade/metadata.xml
+++ b/sci-libs/opencascade/metadata.xml
@@ -10,10 +10,27 @@
<name>Proxy Maintainers</name>
</maintainer>
<use>
- <flag name="freeimage">Enable support for image i/o via media-libs/freeimage</flag>
- <flag name="gl2ps">Use gl2ps PostScript printing library</flag>
- <flag name="gles2">Use OpenGL ES 2.0</flag>
- <flag name="tbb">Enable multithreading with the Intel Threads Building Block dev-cpp/tbb</flag>
- <flag name="vtk">Enable Visualization Toolkit</flag>
+ <flag name="freeimage">
+ Enable support for image i/o via media-libs/freeimage
+ </flag>
+ <flag name="gl2ps">
+ Use gl2ps PostScript printing library
+ </flag>
+ <flag name="gles2">
+ Use OpenGL ES 2.0
+ </flag>
+ <flag name="inspector">
+ Build the OCCT inspector tool for low-level data inspection
+ </flag>
+ <flag name="optimize">
+ Don't clear allocated memory. Use optimized memory manager unless
+ tbb USE flag is set.
+ </flag>
+ <flag name="tbb">
+ Enable multithreading with the Intel Threads Building Block dev-cpp/tbb
+ </flag>
+ <flag name="vtk">
+ Enable Visualization Toolkit
+ </flag>
</use>
</pkgmetadata>
diff --git a/sci-libs/opencascade/opencascade-7.4.0.ebuild b/sci-libs/opencascade/opencascade-7.4.0.ebuild
new file mode 100644
index 00000000000..5c0a6496857
--- /dev/null
+++ b/sci-libs/opencascade/opencascade-7.4.0.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO:
+# check the src files referenced in 51opencascade, i.e. resources and the like
+# check where cmake gets it's '-s' linker flag to avoid pre-stripping (QA)
+
+EAPI=7
+
+inherit check-reqs cmake-utils flag-o-matic java-pkg-opt-2 multilib
+
+DESCRIPTION="Development platform for CAD/CAE, 3D surface/solid modeling and data exchange"
+HOMEPAGE="https://www.opencascade.com"
+MY_PV="$(ver_rs 1- '_')"
+SRC_URI="https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V${MY_PV};sf=tgz -> ${P}.tar.gz"
+
+LICENSE="|| ( Open-CASCADE-LGPL-2.1-Exception-1.0 LGPL-2.1 )"
+SLOT="${PV}"
+KEYWORDS="~amd64 ~x86"
+# gl2ps
+IUSE="debug doc examples ffmpeg freeimage gles2 inspector java optimize qt5 tbb +vtk"
+
+REQUIRED_USE="
+ inspector? ( qt5 )
+ ?? ( optimize tbb )
+"
+
+# gl2ps? ( x11-libs/gl2ps )
+RDEPEND="
+ app-eselect/eselect-opencascade
+ dev-cpp/eigen
+ dev-lang/tcl:0=
+ dev-lang/tk:0=
+ dev-tcltk/itcl
+ dev-tcltk/itk
+ dev-tcltk/tix
+ media-libs/freetype:2
+ media-libs/ftgl
+ virtual/glu
+ virtual/opengl
+ x11-libs/libXmu
+ ffmpeg? ( virtual/ffmpeg )
+ freeimage? ( media-libs/freeimage )
+ java? ( virtual/jdk:1.8 )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtquickcontrols2:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtxml:5
+ )
+ tbb? ( dev-cpp/tbb )
+ vtk? ( >=sci-libs/vtk-8.1.0[rendering] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="doc? ( app-doc/doxygen )"
+
+# There's no easy way to test. Testing needs a rather big environment
+# properly set up.
+RESTRICT="test"
+
+CHECKREQS_MEMORY="256M"
+CHECKREQS_DISK_BUILD="3584M"
+
+CMAKE_BUILD_TYPE=Release
+
+S="${WORKDIR}/occt-V${MY_PV}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-find-qt.patch"
+ "${FILESDIR}/${P}-fix-install.patch"
+)
+
+pkg_setup() {
+ check-reqs_pkg_setup
+ use java && java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+ use java && java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_DOC_Overview=$(usex doc)
+ -DBUILD_Inspector=$(usex inspector)
+ -DBUILD_WITH_DEBUG=$(usex debug)
+ -DCMAKE_CONFIGURATION_TYPES="Gentoo"
+ -DCMAKE_INSTALL_PREFIX="/usr/$(get_libdir)/${PF}/ros"
+ -DINSTALL_DIR_DOC="/usr/share/doc/${PF}"
+ -DINSTALL_DIR_CMAKE="/usr/$(get_libdir)/cmake"
+ -DINSTALL_DOC_Overview=$(usex doc)
+ -DINSTALL_SAMPLES=$(usex examples)
+ -DINSTALL_TEST_CASES=NO
+ -DUSE_D3D=no
+ -DUSE_FFMPEG=$(usex ffmpeg)
+ -DUSE_FREEIMAGE=$(usex freeimage)
+# -DUSE_GL2PS=$(usex gl2ps)
+ -DUSE_GLES2=$(usex gles2)
+ -DUSE_TBB=$(usex tbb)
+ -DUSE_VTK=$(usex vtk)
+ )
+
+ use examples && mycmakeargs+=( -DBUILD_SAMPLES_QT=$(usex qt5) )
+
+ cmake-utils_src_configure
+
+ # prepare /etc/env.d file
+ sed -e 's|VAR_CASROOT|'${EROOT%}'/usr/'$(get_libdir)'/'${P}'/ros|g' < "${FILESDIR}/${P}.env.in" >> "${T}/${PV}" || die
+ sed -i -e 's|ros/lib|ros/'$(get_libdir)'|' "${T}/${PV}" || die
+
+ # use TBB for memory allocation optimizations?
+ use tbb && (sed -i -e 's|^#MMGT_OPT=0$|MMGT_OPT=2|' "${T}/${PV}" || die)
+
+ if use optimize ; then
+ # use internal optimized memory manager?
+ sed -i -e 's|^#MMGT_OPT=0$|MMGT_OPT=1|' "${T}/${PV}" || die
+ # don't clear memory ?
+ sed -i -e 's|^#MMGT_CLEAR=1$|MMGT_CLEAR=0|' "${T}/${PV}" || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # respect slotting
+ insinto "/etc/env.d/${PN}"
+ doins "${T}/${PV}"
+
+ # remove examples
+ use examples || (rm -rf "${ED}/usr/$(get_libdir)/${P}/ros/share/${PN}/samples" || die)
+ use java || (rm -rf "${ED}/usr/$(get_libdir)/${P}/ros/share/${PN}/samples/java" || die)
+ use qt5 || (rm -rf "${ED}/usr/$(get_libdir)/${P}/ros/share/${PN}/samples/qt" || die)
+}
+
+pkg_postinst() {
+ eselect ${PN} set ${PV} || die "failed to switch to updated implementation"
+ einfo "You can switch between available ${PN} implementations using eselect ${PN}"
+}