pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

freecad: Fix build with pkgsrc-2025Q1



Module Name:	pkgsrc-wip
Committed By:	Paul Ripke <stix%stix.id.au@localhost>
Pushed By:	stix
Date:		Thu Apr 10 20:32:11 2025 +1000
Changeset:	6d3d508e9eb62c8c28ee8a1ff5ad6d7966807d06

Modified Files:
	freecad/Makefile
	freecad/PLIST
	freecad/distinfo
Added Files:
	freecad/patches/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp

Log Message:
freecad: Fix build with pkgsrc-2025Q1

- Use hdf5_110 as needed by med.
- Fix build with vtk 9.4.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6d3d508e9eb62c8c28ee8a1ff5ad6d7966807d06

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 freecad/Makefile                                   |  8 +++
 freecad/PLIST                                      |  2 +-
 freecad/distinfo                                   |  1 +
 ...salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp | 64 ++++++++++++++++++++++
 4 files changed, 74 insertions(+), 1 deletion(-)

diffs:
diff --git a/freecad/Makefile b/freecad/Makefile
index c061625cf3..6152946d8d 100644
--- a/freecad/Makefile
+++ b/freecad/Makefile
@@ -53,6 +53,14 @@ CMAKE_CONFIGURE_ARGS+=		-DUSE_CUDA="OFF"
 CMAKE_CONFIGURE_ARGS+=		-DUSE_OPENCV="OFF"
 CMAKE_CONFIGURE_ARGS+=		-Dpybind11_DIR=${PREFIX}/${PYSITELIB}/pybind11/share/cmake/pybind11
 
+# Workaround for med's hdf5_110 version requirement, borrowed from freebsd ports.
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_CFLAGS="-I${BUILDLINK_DIR}/include"
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_FOUND=TRUE
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_VERSION="1.10.11"
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_INCLUDE_DIRS="${BUILDLINK_DIR}/include/hdf5-110"
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_LIBRARIES="-L${BUILDLINK_DIR}/lib -lhdf5-110"
+CMAKE_CONFIGURE_ARGS+=		-DHDF5_LIBRARY_DIRS="${BUILDLINK_DIR}/lib"
+
 SUBST_CLASSES+=		eol
 SUBST_MESSAGE.eol=	Removing DOS line-ends
 SUBST_STAGE.eol=	post-extract
diff --git a/freecad/PLIST b/freecad/PLIST
index ff307a1e04..91e3e764b5 100644
--- a/freecad/PLIST
+++ b/freecad/PLIST
@@ -1989,7 +1989,7 @@ lib/libDriver.so
 lib/libDriverDAT.so
 lib/libDriverSTL.so
 lib/libDriverUNV.so
-lib/libE57Format.a
+lib/libE57Format.so
 lib/libFreeCADApp.so
 lib/libFreeCADBase.so
 lib/libFreeCADGui.so
diff --git a/freecad/distinfo b/freecad/distinfo
index 2429adf391..09d70c70de 100644
--- a/freecad/distinfo
+++ b/freecad/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
 BLAKE2s (freecad-1.0.0/freecad_source.tar.gz) = 46df6583750a869930bef177258973571f111862831a1a9fd6de0ae525f884fd
 SHA512 (freecad-1.0.0/freecad_source.tar.gz) = c3e4af7e247814afba5aeb18fb4ac8b4c799bf6a4dad84757efd72b8ca60717ad5fc7f75d4350a021c2b67aa1c90d3938d868adf0cb993386232068d4a5fb5cb
 Size (freecad-1.0.0/freecad_source.tar.gz) = 97174172 bytes
+SHA1 (patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp) = d449416af9191d94feff9aa15b43704311238e62
 SHA1 (patch-src_App_Application.cpp) = 5a86b727878e77cd5ce7f0634b0d8802e71204ed
diff --git a/freecad/patches/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp b/freecad/patches/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp
new file mode 100644
index 0000000000..87c778a504
--- /dev/null
+++ b/freecad/patches/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp
@@ -0,0 +1,64 @@
+$NetBSD$
+
+Fix build for vtk 9.4:
+https://github.com/FreeCAD/FreeCAD/commit/3b502359353e2a74dee8a8bcfed5750b69f32cdc
+
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp.orig	2025-04-10 08:44:05.488258553 +0000
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+@@ -32,6 +32,7 @@
+ #include <vtkDoubleArray.h>
+ #include <vtkIdTypeArray.h>
+ #include <vtkUnsignedCharArray.h>
++#include <vtkVersionMacros.h>
+ 
+ #include <list>
+ #include <climits>
+@@ -249,14 +250,16 @@ void SMDS_UnstructuredGrid::compactGrid(
+     }
+   }
+ 
+-  if (this->FaceLocations)
++  vtkIdTypeArray* thisFaceLocations = GetFaceLocations();
++  vtkIdTypeArray* thisFaces = GetFaces();
++  if (thisFaceLocations)
+     {
+       vtkIdTypeArray *newFaceLocations = vtkIdTypeArray::New();
+       newFaceLocations->Initialize();
+       newFaceLocations->Allocate(newTypes->GetSize());
+       vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
+       newFaces->Initialize();
+-      newFaces->Allocate(this->Faces->GetSize());
++      newFaces->Allocate(thisFaces->GetSize());
+       for (int i = 0; i < oldCellSize; i++)
+         {
+           if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
+@@ -265,16 +268,16 @@ void SMDS_UnstructuredGrid::compactGrid(
+           if (newTypes->GetValue(newCellId) == VTK_POLYHEDRON)
+             {
+                newFaceLocations->InsertNextValue(newFaces->GetMaxId()+1);
+-               int oldFaceLoc = this->FaceLocations->GetValue(i);
+-               int nCellFaces = this->Faces->GetValue(oldFaceLoc++);
++               int oldFaceLoc = thisFaceLocations->GetValue(i);
++               int nCellFaces = thisFaces->GetValue(oldFaceLoc++);
+                newFaces->InsertNextValue(nCellFaces);
+                for (int n=0; n<nCellFaces; n++)
+                  {
+-                   int nptsInFace = this->Faces->GetValue(oldFaceLoc++);
++                   int nptsInFace = thisFaces->GetValue(oldFaceLoc++);
+                    newFaces->InsertNextValue(nptsInFace);
+                    for (int k=0; k<nptsInFace; k++)
+                      {
+-                       int oldpt = this->Faces->GetValue(oldFaceLoc++);
++                       int oldpt = thisFaces->GetValue(oldFaceLoc++);
+                        newFaces->InsertNextValue(idNodesOldToNew[oldpt]);
+                      }
+                  }
+@@ -292,7 +295,7 @@ void SMDS_UnstructuredGrid::compactGrid(
+     }
+   else
+   {
+-    this->SetCells(newTypes, newLocations, newConnectivity, FaceLocations, Faces);
++    this->SetCells(newTypes, newLocations, newConnectivity, thisFaceLocations, thisFaces);
+   }
+ 
+   newPoints->Delete();


Home | Main Index | Thread Index | Old Index