opencascade: update to 7.9.2

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2025-10-22 10:02:49 +01:00
parent f4313bf7bf
commit cffbf413fa
14 changed files with 154 additions and 80364 deletions

View File

@@ -0,0 +1,12 @@
--- a/adm/cmake/occt_defs_flags.cmake
+++ b/adm/cmake/occt_defs_flags.cmake
@@ -200,9 +200,6 @@
endif()
endif()
if(MINGW)
- add_definitions(-D_WIN32_WINNT=0x0601)
- # _WIN32_WINNT=0x0601 (use Windows 7 SDK)
- #set (CMAKE_SYSTEM_VERSION "6.1")
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wattributes")

View File

@@ -1,12 +0,0 @@
diff -ur occt-V7_5_0.orig/src/Aspect/Aspect_OpenVRSession.cxx occt-V7_5_0/src/Aspect/Aspect_OpenVRSession.cxx
--- occt-V7_5_0.orig/src/Aspect/Aspect_OpenVRSession.cxx 2020-11-26 11:27:09.822443300 +0100
+++ occt-V7_5_0/src/Aspect/Aspect_OpenVRSession.cxx 2020-11-26 11:30:38.912514000 +0100
@@ -168,7 +168,7 @@
vr::IVRSystem* System; //!< OpenVR session object
//! Empty constructor.
- Aspect_OpenVRSession::VRContext() : System (NULL)
+ VRContext() : System (NULL)
{
memset (TrackedPoses, 0, sizeof(TrackedPoses));
}

View File

@@ -1,23 +0,0 @@
Subject: [PATCH 2/7] GeomPlate_BuildAveragePlane: BasePlan: Don't set yvector to zero. See Following:
From: blobfish <blobfish@gmx.com>
Date: Tue, 29 Sep 2020 06:36:13 -0400
When we return, the yvector is crossed with x and we crash.
The z vector is passed in and we calculate the x vector, so just cross those 2 in this case to get y.
---
src/GeomPlate/GeomPlate_BuildAveragePlane.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx
+++ b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx
@@ -436,7 +436,7 @@
|| ((Abs(n2)<=myTol)&&(Abs(n3)<=myTol))
|| ((Abs(n1)<=myTol)&&(Abs(n3)<=myTol))) {
myOX.SetCoord(V3(1),V3(2),V3(3));
- myOY.SetCoord(0,0,0);
+ myOY = OZ ^ myOX;
}
else {
myOX.SetCoord(V3(1),V3(2),V3(3));

View File

@@ -10,7 +10,7 @@ Date: Tue, 29 Sep 2020 06:41:32 -0400
--- a/src/BRepFill/BRepFill_Filling.cxx
+++ b/src/BRepFill/BRepFill_Filling.cxx
@@ -105,6 +105,7 @@
@@ -95,6 +95,7 @@
while (!Edges.IsEmpty())
{
TopTools_ListIteratorOfListOfShape itl(Edges);
@@ -18,16 +18,18 @@ Date: Tue, 29 Sep 2020 06:41:32 -0400
for (; itl.More(); itl.Next())
{
anEdge = TopoDS::Edge(itl.Value());
@@ -127,11 +128,17 @@
@@ -116,6 +117,7 @@
anEdge.Reverse();
V2 = V3;
}
+ found = true;
+ found=true;
break;
}
}
- BB.Add(aWire, anEdge);
- Edges.Remove(itl);
@@ -127,6 +129,13 @@
}
BB.Add(aWire, anEdge);
Edges.Remove(itl);
+ if (found)
+ {
+ BB.Add(aWire, anEdge);

View File

@@ -10,46 +10,46 @@ Date: Tue, 29 Sep 2020 07:47:55 -0400
--- a/src/BRepFill/BRepFill_Filling.cxx
+++ b/src/BRepFill/BRepFill_Filling.cxx
@@ -332,6 +332,15 @@
CurFace = SeqOfConstraints(i).myFace;
CurOrder = SeqOfConstraints(i).myOrder;
+ // this silently defaults to C0 with an invalid value,
+ // where before an exception would be
+ // thrown out of curve constraints. Good, Bad?
+ Standard_Integer orderAdapt = 0;
+ if (CurOrder == GeomAbs_G1)
+ orderAdapt = 1;
+ else if (CurOrder == GeomAbs_G2)
+ orderAdapt = 2;
+
if (CurFace.IsNull()) {
if (CurOrder == GeomAbs_C0) {
Handle( BRepAdaptor_Curve ) HCurve = new BRepAdaptor_Curve();
@@ -339,7 +348,7 @@
const Handle(Adaptor3d_Curve)& aHCurve = HCurve; // to avoid ambiguity
Constr = new BRepFill_CurveConstraint(aHCurve,
- CurOrder,
+ orderAdapt,
myNbPtsOnCur,
myTol3d );
}
else { // Pas de representation Topologique
@@ -362,7 +371,7 @@
Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf );
Constr = new GeomPlate_CurveConstraint(HCurvOnSurf,
- CurOrder,
+ orderAdapt,
myNbPtsOnCur,
myTol3d,
myTolAng,
@@ -382,7 +391,7 @@
Handle (Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface( CurvOnSurf );
@@ -323,6 +323,15 @@
CurFace = SeqOfConstraints(i).myFace;
CurOrder = SeqOfConstraints(i).myOrder;
Constr = new BRepFill_CurveConstraint( HCurvOnSurf,
- CurOrder,
+ orderAdapt,
myNbPtsOnCur,
myTol3d,
myTolAng,
+ // this silently defaults to C0 with an invalid value,
+ // where before an exception would be
+ // thrown out of curve constraints. Good, Bad?
+ Standard_Integer orderAdapt = 0;
+ if (CurOrder == GeomAbs_G1)
+ orderAdapt = 1;
+ else if (CurOrder == GeomAbs_G2)
+ orderAdapt = 2;
+
if (CurFace.IsNull())
{
if (CurOrder == GeomAbs_C0)
@@ -330,7 +339,7 @@
Handle(BRepAdaptor_Curve) HCurve = new BRepAdaptor_Curve();
HCurve->Initialize(CurEdge);
const Handle(Adaptor3d_Curve)& aHCurve = HCurve; // to avoid ambiguity
- Constr = new BRepFill_CurveConstraint(aHCurve, CurOrder, myNbPtsOnCur, myTol3d);
+ Constr = new BRepFill_CurveConstraint(aHCurve, orderAdapt, myNbPtsOnCur, myTol3d);
}
else
{ // Pas de representation Topologique
@@ -354,7 +363,7 @@
Handle(Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface(CurvOnSurf);
Constr = new GeomPlate_CurveConstraint(HCurvOnSurf,
- CurOrder,
+ orderAdapt,
myNbPtsOnCur,
myTol3d,
myTolAng,
@@ -374,7 +383,7 @@
Handle(Adaptor3d_CurveOnSurface) HCurvOnSurf = new Adaptor3d_CurveOnSurface(CurvOnSurf);
Constr = new BRepFill_CurveConstraint(HCurvOnSurf,
- CurOrder,
+ orderAdapt,
myNbPtsOnCur,
myTol3d,
myTolAng,

View File

@@ -1,25 +0,0 @@
Subject: [PATCH 5/7] BRepFill_Filling: Don't even attempt to build with empty boundary
From: blobfish <blobfish@gmx.com>
Date: Thu, 1 Oct 2020 10:06:35 -0400
---
src/BRepFill/BRepFill_Filling.cxx | 6 ++++++
1 file changed, 6 insertions(+)
--- a/src/BRepFill/BRepFill_Filling.cxx
+++ b/src/BRepFill/BRepFill_Filling.cxx
@@ -588,6 +588,12 @@
{
myBuilder.reset (new GeomPlate_BuildPlateSurface (myDegree, myNbPtsOnCur, myNbIter,
myTol2d, myTol3d, myTolAng, myTolCurv, myAnisotropie));
+ if (myBoundary.IsEmpty())
+ {
+ myIsDone = Standard_False;
+ return;
+ }
+
TopoDS_Edge CurEdge;
TopoDS_Face CurFace;
Standard_Integer i, j;

View File

@@ -10,13 +10,13 @@ Date: Mon, 18 Jan 2021 22:26:33 -0500
--- a/src/BRepOffset/BRepOffset_Tool.cxx
+++ b/src/BRepOffset/BRepOffset_Tool.cxx
@@ -1894,7 +1894,8 @@
TopoDS_Edge CurE = TopoDS::Edge(it.Value());
Handle(Geom_Curve) C = BRep_Tool::Curve(CurE,L,f,l);
if (C.IsNull()) {
- BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE));
+ if (!BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE)))
@@ -1897,7 +1897,8 @@
Handle(Geom_Curve) C = BRep_Tool::Curve(CurE, L, f, l);
if (C.IsNull())
{
- BRepLib::BuildCurve3d(CurE, BRep_Tool::Tolerance(CurE));
+ if (!BRepLib::BuildCurve3d(CurE, BRep_Tool::Tolerance(CurE)))
+ continue;
C = BRep_Tool::Curve(CurE,L,f,l);
}
C = new Geom_TrimmedCurve(C,f,l);
C = BRep_Tool::Curve(CurE, L, f, l);
if (C.IsNull()) // not 3d curve, can be degenerated, need to skip
{

View File

@@ -2,10 +2,9 @@ Do not build DRAWEXE.exe in static build. This would require installing a lot
of build dependencies. And we are not installing that executable anyway.
Do not declare functions with "dllimport" attribute when linking to static library.
diff -urN occt-V7_6_2/CMakeLists.txt.orig occt-V7_6_2/CMakeLists.txt
--- occt-V7_6_2/CMakeLists.txt.orig 2022-04-26 11:59:16.000000000 +0200
+++ occt-V7_6_2/CMakeLists.txt 2022-05-20 10:08:25.434683400 +0200
@@ -460,6 +460,10 @@ endforeach()
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -413,6 +413,10 @@
# accumulate all used toolkits
list (REMOVE_DUPLICATES BUILD_TOOLKITS)
@@ -14,15 +13,15 @@ diff -urN occt-V7_6_2/CMakeLists.txt.orig occt-V7_6_2/CMakeLists.txt
+endif()
+
set (RAW_BUILD_TOOLKITS)
set (OCCT_FULL_LIST_OF_INCLUDES)
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
@@ -614,6 +618,9 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
if (CAN_USE_OPENVR)
if (USE_OPENVR)
add_definitions (-DHAVE_OPENVR)
+ if (NOT BUILD_SHARED_LIBS)
+ add_definitions (-DOPENVR_BUILD_STATIC)
+ endif()
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
@@ -570,6 +570,9 @@
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
if (CAN_USE_OPENVR AND USE_OPENVR)
add_definitions (-DHAVE_OPENVR)
+ if (NOT BUILD_SHARED_LIBS)
+ add_definitions (-DOPENVR_BUILD_STATIC)
+ endif()
OCCT_ADD_VCPKG_FEATURE ("openvr")
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/openvr")
elseif (NOT CAN_USE_OPENVR)

File diff suppressed because it is too large Load Diff

View File

@@ -4,34 +4,24 @@ Date: Thu, 24 Oct 2024 11:59:16 +0200
Subject: [PATCH] SSE2 detection gcc See
https://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/X86-Built-in-Functions.html
---
src/Standard/Standard.cxx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx
index bb06de71fd..8467bc3bd1 100644
--- a/src/Standard/Standard.cxx
+++ b/src/Standard/Standard.cxx
@@ -249,6 +249,7 @@ namespace
// if not then use MMgrRaw instead of MMgrTBBalloc.
// It is to avoid runtime crash when running on a CPU
// that supports SSE but does not support SSE2 (some modifications of AMD Sempron).
@@ -239,6 +239,7 @@
// platform, if not then use MMgrRaw instead of MMgrTBBalloc. It is to avoid runtime crash when
// running on a CPU that supports SSE but does not support SSE2 (some modifications of AMD
// Sempron).
+ #if defined(_MSC_VER)
static const DWORD _SSE2_FEATURE_BIT(0x04000000);
DWORD volatile dwFeature;
_asm
@@ -270,6 +271,11 @@ namespace
}
if ((dwFeature & _SSE2_FEATURE_BIT) == 0)
anAllocId = 0;
+ #elif defined(__GNUC__)
+ __builtin_cpu_init();
+ if (__builtin_cpu_supports("sse2"))
+ anAllocId = 0;
+ #endif
static const DWORD _SSE2_FEATURE_BIT(0x04000000);
DWORD volatile dwFeature;
_asm
@@ -259,6 +260,10 @@
pop eax
}
#endif
if ((dwFeature & _SSE2_FEATURE_BIT) == 0) anAllocId = 0;
+ #elif defined(__GNUC__)
+ __builtin_cpu_init();
+ if (__builtin_cpu_supports("sse2")) anAllocId = 0;
+ #endif
}
#endif
--
2.44.0.windows.1

View File

@@ -1,19 +0,0 @@
From 890d0b1a13f5f04a53494c0e1ab0787e7b55be19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de>
Date: Thu, 24 Oct 2024 14:02:58 +0200
Subject: [PATCH] Fix linking TKDE
---
src/TKDE/EXTERNLIB | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/TKDE/EXTERNLIB b/src/TKDE/EXTERNLIB
index 58c24f0d95..1a12b23444 100644
--- a/src/TKDE/EXTERNLIB
+++ b/src/TKDE/EXTERNLIB
@@ -1 +1,2 @@
TKernel
+TKMath
--
2.44.0.windows.1

View File

@@ -1,36 +0,0 @@
From 42401d20186a00701dbd18edd4cec1abc7cc64ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de>
Date: Thu, 24 Oct 2024 12:44:41 +0200
Subject: [PATCH] Avoid invalid conversion error.
Fixes:
```
FAILED: src/TKV3d/CMakeFiles/TKV3d.dir/__/StdPrs/StdPrs_BRepFont.cxx.obj
C:\msys64\mingw64\bin\g++.exe -DHAVE_D3D -DHAVE_FFMPEG -DHAVE_FREEIMAGE -DHAVE_FREETYPE -DHAVE_OPENGL -DHAVE_OPENGL_EXT -DHAVE_OPENVR -DHAVE_RAPIDJSON -DHAVE_TBB -DHAVE_TK -DHAVE_VTK -DOCC_CONVERT_SIGNALS -DOPENVR_BUILD_STATIC -DUNICODE -DVTK_OPENGL2_BACKEND -D_UNICODE -D_WIN32_WINNT=0x0601 -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include/vtk -IC:/msys64/mingw64/include/ffmpeg4.4 -ID:/repo/MSYS2/MINGW-packages/mingw-w64-opencascade/src/build-MINGW64-static/include/opencascade -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -fexceptions -fPIC -Wall -Wextra -O3 -DNDEBUG -s -DNo_Exception -std=gnu++11 -DOCCT_NO_PLUGINS -DOCCT_STATIC_BUILD -D__V3d_DLL -D__Select3D_DLL -D__Prs3d_DLL -D__StdPrs_DLL -D__SelectBasics_DLL -D__SelectMgr_DLL -D__PrsMgr_DLL -D__AIS_DLL -D__StdSelect_DLL -D__DsgPrs_DLL -D__PrsDim_DLL -MD -MT src/TKV3d/CMakeFiles/TKV3d.dir/__/StdPrs/StdPrs_BRepFont.cxx.obj -MF src\TKV3d\CMakeFiles\TKV3d.dir\__\StdPrs\StdPrs_BRepFont.cxx.obj.d -o src/TKV3d/CMakeFiles/TKV3d.dir/__/StdPrs/StdPrs_BRepFont.cxx.obj -c D:/repo/MSYS2/MINGW-packages/mingw-w64-opencascade/src/occt-V7_8_1/src/StdPrs/StdPrs_BRepFont.cxx
D:/repo/MSYS2/MINGW-packages/mingw-w64-opencascade/src/occt-V7_8_1/src/StdPrs/StdPrs_BRepFont.cxx: In member function 'Standard_Boolean StdPrs_BRepFont::renderGlyph(Standard_Utf32Char, TopoDS_Shape&)':
D:/repo/MSYS2/MINGW-packages/mingw-w64-opencascade/src/occt-V7_8_1/src/StdPrs/StdPrs_BRepFont.cxx:460:30: error: invalid conversion from 'unsigned char*' to 'const char*' [-fpermissive]
460 | const char* aTags = &anOutline->tags[aStartIndex];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned char*
```
---
src/StdPrs/StdPrs_BRepFont.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/StdPrs/StdPrs_BRepFont.cxx b/src/StdPrs/StdPrs_BRepFont.cxx
index ab2d9b3c9f..51ca6be839 100644
--- a/src/StdPrs/StdPrs_BRepFont.cxx
+++ b/src/StdPrs/StdPrs_BRepFont.cxx
@@ -457,7 +457,7 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour)
{
const FT_Vector* aPntList = &anOutline->points[aStartIndex];
- const char* aTags = &anOutline->tags[aStartIndex];
+ const char* aTags = reinterpret_cast<const char*>(&anOutline->tags[aStartIndex]);
const short anEndIndex = anOutline->contours[aContour];
const short aPntsNb = (anEndIndex - aStartIndex) + 1;
aStartIndex = anEndIndex + 1;
--
2.44.0.windows.1

View File

@@ -12,33 +12,30 @@ diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx
index 8467bc3bd1..250d7c0e6a 100644
--- a/src/Standard/Standard.cxx
+++ b/src/Standard/Standard.cxx
@@ -25,7 +25,7 @@
@@ -26,7 +26,7 @@
#if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
#include <malloc.h>
-#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
+#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
#include <mm_malloc.h>
#include <malloc.h>
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
#include <mm_malloc.h>
#else
extern "C" int posix_memalign(void** thePtr, size_t theAlign, size_t theSize);
@@ -508,7 +508,7 @@ Standard_Address Standard::AllocateAligned(const Standard_Size theSize,
return _aligned_malloc(theSize, theAlign);
#elif defined(__ANDROID__) || defined(__QNX__)
@@ -479,7 +479,7 @@
#elif defined(__ANDROID__) || defined(__QNX__)
return memalign(theAlign, theSize);
-#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
+#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
return _mm_malloc(theSize, theAlign);
#else
#else
void* aPtr;
@@ -536,7 +536,7 @@ return je_free(thePtrAligned);
_aligned_free(thePtrAligned);
#elif defined(__ANDROID__) || defined(__QNX__)
@@ -506,7 +506,7 @@
#elif defined(__ANDROID__) || defined(__QNX__)
free(thePtrAligned);
-#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
+#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
- && (defined(__i386) || defined(__x86_64)))
+ && (defined(__i386) || defined(__x86_64) || defined(__aarch64__)))
_mm_free(thePtrAligned);
#else
#else
free(thePtrAligned);
--
2.44.0.windows.1

View File

@@ -3,16 +3,17 @@
_realname=opencascade
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=7.8.1
pkgver=7.9.2
_pkgver=${pkgver//./_}
pkgrel=2
pkgrel=1
pkgdesc='Open CASCADE Technology, 3D modeling & numerical simulation (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://dev.opencascade.org'
msys2_repository_url="https://github.com/Open-Cascade-SAS/OCCT"
license=('spdx:LGPL-2.1-or-later WITH OCCT-exception-1.0')
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg4.4"
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-ffmpeg4.4"
"${MINGW_PACKAGE_PREFIX}-freeimage"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-tbb"
@@ -24,46 +25,33 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-doxygen"
"${MINGW_PACKAGE_PREFIX}-qt5-base"
"${MINGW_PACKAGE_PREFIX}-rapidjson"
"${MINGW_PACKAGE_PREFIX}-nlohmann-json")
source=("https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V${_pkgver}/${_realname}-${pkgver}.tar.gz"
"0001-fix-compile-openvr.patch"
0001-do-not-redefine-WIN32_WINNT.patch
# The following patches are ported from the Debian Science Team
# https://salsa.debian.org/science-team/opencascade/-/tree/master/debian/patches
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/master/debian/patches/0002-GeomPlate_BuildAveragePlane-BasePlan-Don-t-set-yvect.patch
"0002-GeomPlate_BuildAveragePlane-BasePlan-Don-t-set-yvect.patch"
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/master/debian/patches/0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch
# https://salsa.debian.org/science-team/opencascade/-/tree/debian/experimental/debian/patches
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/debian/experimental/debian/patches/0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch
"0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch"
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/master/debian/patches/0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/debian/experimental/debian/patches/0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch
"0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch"
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/master/debian/patches/0005-BRepFill_Filling-Don-t-even-attempt-to-build-with-em.patch
"0005-BRepFill_Filling-Don-t-even-attempt-to-build-with-em.patch"
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/master/debian/patches/0006-BRepOffset_Tool-TryProject-Check-return-of-BRepLib-B.patch
# Source: https://salsa.debian.org/science-team/opencascade/-/blob/debian/experimental/debian/patches/0006-BRepOffset_Tool-TryProject-Check-return-of-BRepLib-B.patch
"0006-BRepOffset_Tool-TryProject-Check-return-of-BRepLib-B.patch"
"0007-static-build.patch"
"0008-clang-dllexport-attributes.patch"
"0009-SSE2-detection-gcc.patch"
"0010-Fix-TBB-detection.patch"
"0011-Fix-linking-TKDE.patch"
"0012-Avoid-invalid-conversion-error.patch"
"0013-ExpToCasExe-Fix-building-static.patch"
"0014-aarch64-mm_alloc.patch")
sha256sums=('7321af48c34dc253bf8aae3f0430e8cb10976961d534d8509e72516978aa82f5'
'0bbba5858e3e478759dac3d4802f821ec633304a63aeef542e0e4e0e0674e205'
'9e72d389359899d959fa66b131c9871c15a136bb600c246fcf7e05910d277335'
'f126465de547d606c4af2e95bd550ba7d5528d53a9b73693078952f9a40b3cae'
'1f6062eece494ccec34b2b7fae0004d3970d477835f78a3fbacb0180a60f279f'
'fa627467f355b541216a90ca9170fb87893652d6608c129bd913b19b7d1c9ee5'
'd39ce849914e6349161675b9d412351684eb6af4bed1aa31afbdc54fa153a532'
'c202fa3d21b3342595a15690be9e870488154a37cbfbea0a847fff62b7466f3a'
'ffacd5229719b17ba89f1f8cd078294507d09f4dec6cdf29e2a6084f14c2c642'
'84582a55b2421562f84a50e2c0ade4df0de63ec0a43ce8632aec0a68c7742fd7'
sha256sums=('3cd080d3fc33ba0c6c157e110afe3e015859524c4694dbb09812ec9d61595639'
'018829156bc3fc0f44c600c67cd21f141c0051c1f15fe6bdcf3f3246a19dc141'
'42edcf398e0670012bf2668bd493997a43ab82a24a1c889bfb080e5256776619'
'c6f06b012f3ff6b4355151af4981593f87c12ccb2aaaa15c2cd65799f9efc336'
'c3cdd50ddeace18259341a25041b90ed18e73898161b81242868ae6a53a2c848'
'3efa1efaad5983100fc736e36a40ea0dba46cbdfe4e7f2f6e7853c582e127aa0'
'226c000886a901d62cc09ca550009e4bbae84933a3b1bbded5c4f9f246734b08'
'3d927cd0b2def78db8def263cd40bfc8520b8c8520bf5a7543f0775e02e5e86e'
'24e2814c352bc4141f24b1652a5b5d3c49649c8cd852faea017e0584245a4331'
'214c120c465029412e8c61c04aa6caf1845f9df6597983c39ca07415de252c7f'
'6c1e3cfebecc398424d94de43d501d2718800bf101f90a156c086fad4ba042e0'
'b23f2278da8c90fad69aaea2ffec3e439702a24278ea804062e9c0207c93e915')
'b375c36d5c8a3e12f428db905570fa3ae53ab444caf50ae674069749f78f1918')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
@@ -77,18 +65,13 @@ apply_patch_with_msg() {
prepare() {
cd "${srcdir}"/OCCT-${_pkgver}
apply_patch_with_msg \
0001-fix-compile-openvr.patch \
0002-GeomPlate_BuildAveragePlane-BasePlan-Don-t-set-yvect.patch \
0001-do-not-redefine-WIN32_WINNT.patch \
0003-BRepFill_Filling-WireFromList-We-can-t-assume-that-a.patch \
0004-BRepFill_Filling-Curve-constraints-confused-by-impli.patch \
0005-BRepFill_Filling-Don-t-even-attempt-to-build-with-em.patch \
0006-BRepOffset_Tool-TryProject-Check-return-of-BRepLib-B.patch \
0007-static-build.patch \
0008-clang-dllexport-attributes.patch \
0009-SSE2-detection-gcc.patch \
0010-Fix-TBB-detection.patch \
0011-Fix-linking-TKDE.patch \
0012-Avoid-invalid-conversion-error.patch \
0013-ExpToCasExe-Fix-building-static.patch \
0014-aarch64-mm_alloc.patch
@@ -98,7 +81,7 @@ prepare() {
build() {
local common_config
common_config=(
-DUSE_D3D=1
-DUSE_D3D=ON
-D3RDPARTY_DIR="${MINGW_PREFIX}"
-D3RDPARTY_TK_DIR="${MINGW_PREFIX}"
-D3RDPARTY_TK_DLL_DIR="${MINGW_PREFIX}/bin/"
@@ -114,34 +97,41 @@ build() {
-D3RDPARTY_FREETYPE_DLL_DIR="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FREETYPE_DLL="${MINGW_PREFIX}/bin/libfreetype-6.dll"
-D3RDPARTY_FREETYPE_LIBRARY_DIR="${MINGW_PREFIX}/lib/"
-DUSE_FFMPEG=1
-D3RDPARTY_FREETYPE_LIBRARY="${MINGW_PREFIX}/lib/libfreetype.dll.a"
-DUSE_FFMPEG=ON
-D3RDPARTY_FFMPEG_DIR="${MINGW_PREFIX}"
-D3RDPARTY_FFMPEG_INCLUDE_DIR="${MINGW_PREFIX}/include/ffmpeg4.4"
-D3RDPARTY_FFMPEG_DLL_DIR_avformat="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FFMPEG_DLL_avformat="${MINGW_PREFIX}/bin/avformat-58.dll"
-D3RDPARTY_FFMPEG_LIBRARY_DIR_avformat="${MINGW_PREFIX}/lib/ffmpeg4.4"
-D3RDPARTY_FFMPEG_LIBRARY_avformat="${MINGW_PREFIX}/lib/ffmpeg4.4/libavformat.dll.a"
-D3RDPARTY_FFMPEG_DLL_DIR_avutil="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FFMPEG_DLL_avutil="${MINGW_PREFIX}/bin/avutil-56.dll"
-D3RDPARTY_FFMPEG_LIBRARY_DIR_avutil="${MINGW_PREFIX}/lib/ffmpeg4.4"
-D3RDPARTY_FFMPEG_LIBRARY_avutil="${MINGW_PREFIX}/lib/ffmpeg4.4/libavutil.dll.a"
-D3RDPARTY_FFMPEG_DLL_DIR_avcodec="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FFMPEG_DLL_avcodec="${MINGW_PREFIX}/bin/avcodec-58.dll"
-D3RDPARTY_FFMPEG_LIBRARY_DIR_avcodec="${MINGW_PREFIX}/lib/ffmpeg4.4"
-D3RDPARTY_FFMPEG_LIBRARY_avcodec="${MINGW_PREFIX}/lib/ffmpeg4.4/libavcodec.dll.a"
-D3RDPARTY_FFMPEG_DLL_DIR_swscale="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FFMPEG_DLL_swscale="${MINGW_PREFIX}/bin/swscale-5.dll"
-D3RDPARTY_FFMPEG_LIBRARY_DIR_swscale="${MINGW_PREFIX}/lib/ffmpeg4.4"
-DUSE_OPENVR=1
-D3RDPARTY_FFMPEG_LIBRARY_swscale="${MINGW_PREFIX}/lib/ffmpeg4.4/libswscale.dll.a"
-DUSE_OPENVR=ON
-D3RDPARTY_OPENVR_DIR="${MINGW_PREFIX}"
-D3RDPARTY_OPENVR_DLL_DIR_openvr_api="${MINGW_PREFIX}/bin/"
-D3RDPARTY_OPENVR_DLL_openvr_api="${MINGW_PREFIX}/bin/libopenvr_api.dll"
-D3RDPARTY_OPENVR_LIBRARY_DIR_openvr_api="${MINGW_PREFIX}/lib/"
-DUSE_RAPIDJSON=1
-D3RDPARTY_OPENVR_LIBRARY_openvr_api="${MINGW_PREFIX}/lib/libopenvr_api.dll.a"
-DUSE_RAPIDJSON=ON
-D3RDPARTY_RAPIDJSON_DIR="${MINGW_PREFIX}"
-DUSE_FREEIMAGE=1
-DUSE_FREEIMAGE=ON
-D3RDPARTY_FREEIMAGE_DIR="${MINGW_PREFIX}"
-D3RDPARTY_FREEIMAGE_DLL_DIR_freeimage="${MINGW_PREFIX}/bin/"
-D3RDPARTY_FREEIMAGE_DLL_freeimage="${MINGW_PREFIX}/bin/libfreeimage-3.dll"
-D3RDPARTY_FREEIMAGE_LIBRARY_DIR_freeimage="${MINGW_PREFIX}/lib/"
-DUSE_TBB=1
-D3RDPARTY_FREEIMAGE_LIBRARY="${MINGW_PREFIX}/lib/libfreeimage.dll.a"
-DUSE_TBB=ON
-D3RDPARTY_TBB_DLL_DIR="${MINGW_PREFIX}/bin/"
-D3RDPARTY_TBB_LIBRARY_DIR="${MINGW_PREFIX}/lib/"
-D3RDPARTY_TBB_LIBRARY="${MINGW_PREFIX}/lib/libtbb12.dll.a"
@@ -160,34 +150,22 @@ build() {
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
msg2 "Building shared libraries"
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${_extra_config[@]}" \
-DINSTALL_DIR_LAYOUT="Unix" \
-DBUILD_LIBRARY_TYPE="Shared" \
"${common_config[@]}" \
-D3RDPARTY_FREETYPE_LIBRARY="${MINGW_PREFIX}/lib/libfreetype.dll.a" \
-D3RDPARTY_FFMPEG_LIBRARY_avformat="${MINGW_PREFIX}/lib/ffmpeg4.4/libavformat.dll.a" \
-D3RDPARTY_FFMPEG_LIBRARY_avutil="${MINGW_PREFIX}/lib/ffmpeg4.4/libavutil.dll.a" \
-D3RDPARTY_FFMPEG_LIBRARY_avcodec="${MINGW_PREFIX}/lib/ffmpeg4.4/libavcodec.dll.a" \
-D3RDPARTY_FFMPEG_LIBRARY_swscale="${MINGW_PREFIX}/lib/ffmpeg4.4/libswscale.dll.a" \
-D3RDPARTY_FREEIMAGE_LIBRARY="${MINGW_PREFIX}/lib/libfreeimage.dll.a" \
-D3RDPARTY_OPENVR_LIBRARY_openvr_api="${MINGW_PREFIX}/lib/libopenvr_api.dll.a" \
../OCCT-${_pkgver}
-S OCCT-${_pkgver} \
-B build-${MSYSTEM}
${MINGW_PREFIX}/bin/cmake --build .
${MINGW_PREFIX}/bin/cmake --build build-${MSYSTEM}
}
package() {
# Shared Install
cd "${srcdir}/build-${MSYSTEM}-shared"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install build-${MSYSTEM}
install -Dm644 "${srcdir}"/OCCT-${_pkgver}/LICENSE_LGPL_21.txt \
"${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE_LGPL_21.txt