git: 31735a5b1aae - main - cad/opencascade: fix cmake files

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Sat, 10 Sep 2022 11:12:18 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=31735a5b1aae9a7967e8cc5f12ffab7779acc53c

commit 31735a5b1aae9a7967e8cc5f12ffab7779acc53c
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-09-10 11:05:31 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-09-10 11:12:13 +0000

    cad/opencascade: fix cmake files
    
    A cmake macro, which should have configured $OCCT_INSTALL_BIN_LETTER was
    not applied correctly. Thus some cmake files where badly configured, and
    some consumers could not use them.
    
    PR:             266280
    Reported by:    yuri
    MFH:            2022Q3
---
 cad/opencascade/Makefile                                |  8 +++++++-
 .../files/patch-adm_cmake_occt__macros.cmake            | 17 ++++++++++++++++-
 .../files/patch-src_Standard_Standard__CString.cxx      |  4 ++--
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/cad/opencascade/Makefile b/cad/opencascade/Makefile
index be914a913f09..9704f68d1ecc 100644
--- a/cad/opencascade/Makefile
+++ b/cad/opencascade/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	opencascade
 PORTVERSION=	7.6.0
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	cad science
 MASTER_SITES=	LOCAL/thierry
 
@@ -63,6 +63,12 @@ CMAKE_ARGS+=	-DINSTALL_DIR=${OCCROOT}				\
 		-DUSE_RAPIDJSON:BOOL=ON					\
 		-DUSE_VTK:BOOL=ON					\
 		-D3RDPARTY_VTK_INCLUDE_DIR:PATH=${LOCALBASE}/include/vtk-${VTKVER}
+CONFIGURE_ENV+=	DESTDIR=${STAGEDIR}
+
+.if defined(MAINTAINER_MODE)
+CMAKE_ARGS+=	-DCMAKE_MESSAGE_CONTEXT_SHOW:BOOL=ON	\
+		-DCMAKE_MESSAGE_LOG_LEVEL:STRING=DEBUG
+.endif
 
 # TODO: TBB to be replaced by onetbb later
 #CMAKE_ARGS+=	-DUSE_EIGEN:BOOL=ON -DUSE_TBB:BOOL=ON
diff --git a/cad/opencascade/files/patch-adm_cmake_occt__macros.cmake b/cad/opencascade/files/patch-adm_cmake_occt__macros.cmake
index d56ea8699ddf..8ab6018984b8 100644
--- a/cad/opencascade/files/patch-adm_cmake_occt__macros.cmake
+++ b/cad/opencascade/files/patch-adm_cmake_occt__macros.cmake
@@ -1,4 +1,4 @@
---- adm/cmake/occt_macros.cmake.orig	2020-11-03 14:49:43 UTC
+--- adm/cmake/occt_macros.cmake.orig	2021-10-30 11:13:37 UTC
 +++ adm/cmake/occt_macros.cmake
 @@ -47,7 +47,7 @@ macro (OCCT_MAKE_OS_WITH_BITNESS)
    elseif(APPLE)
@@ -18,3 +18,18 @@
    
    string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
    message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
+@@ -592,12 +592,12 @@ 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*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}\")
+     foreach (line IN LISTS TARGET_FILE_CONTENT)
+-      string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
++      string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
+       file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\")
+     endforeach()
+   endforeach()
diff --git a/cad/opencascade/files/patch-src_Standard_Standard__CString.cxx b/cad/opencascade/files/patch-src_Standard_Standard__CString.cxx
index a8162b9e0c23..11083adad1b6 100644
--- a/cad/opencascade/files/patch-src_Standard_Standard__CString.cxx
+++ b/cad/opencascade/files/patch-src_Standard_Standard__CString.cxx
@@ -1,6 +1,6 @@
---- src/Standard/Standard_CString.cxx.orig	2020-11-03 14:50:08 UTC
+--- src/Standard/Standard_CString.cxx.orig	2021-10-30 11:13:58 UTC
 +++ src/Standard/Standard_CString.cxx
-@@ -83,7 +83,7 @@ Standard_Integer HashCodes (const Standard_CString the
+@@ -82,7 +82,7 @@ Standard_Integer HashCodes (const Standard_CString the
      // strtod, strtol, strtoll functions. For other system with locale-depended
      // implementations problems may appear if "C" locale is not set explicitly.
      #if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__MINGW32__)