about summary refs log tree commit diff
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2024-03-11 21:50:01 +1300
committerGitHub <noreply@github.com>2024-03-11 21:50:01 +1300
commitb0c17f0c63bc4a33290658d164c3444fcdc88aa8 (patch)
treefa0cc5a0b89ad0321482d3b35821e1196d6aebc7
parent238e2e601f9136ace5f4cc67bc97ecc710fcaa24 (diff)
parentc5eaf0ed83f9865133ecbbba3c29a75250fd4a61 (diff)
Merge pull request #293618 from adisbladis/bambu-studio-fix-cgal
bambu-studio: Fix build
-rw-r--r--pkgs/applications/misc/bambu-studio/default.nix2
-rw-r--r--pkgs/applications/misc/bambu-studio/meshboolean-const.patch21
2 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/applications/misc/bambu-studio/default.nix b/pkgs/applications/misc/bambu-studio/default.nix
index 1455558dcc2e0..60559768994ef 100644
--- a/pkgs/applications/misc/bambu-studio/default.nix
+++ b/pkgs/applications/misc/bambu-studio/default.nix
@@ -113,6 +113,8 @@ stdenv.mkDerivation rec {
   patches = [
     # Fix for webkitgtk linking
     ./0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
+    # Fix build with cgal-5.6.1+
+    ./meshboolean-const.patch
   ];
 
   doCheck = true;
diff --git a/pkgs/applications/misc/bambu-studio/meshboolean-const.patch b/pkgs/applications/misc/bambu-studio/meshboolean-const.patch
new file mode 100644
index 0000000000000..68e72591d8f48
--- /dev/null
+++ b/pkgs/applications/misc/bambu-studio/meshboolean-const.patch
@@ -0,0 +1,21 @@
+Fix build with cgal 5.6.1+
+
+diff --git a/src/libslic3r/MeshBoolean.cpp b/src/libslic3r/MeshBoolean.cpp
+index 50bbc099..b05245d3 100644
+--- a/src/libslic3r/MeshBoolean.cpp
++++ b/src/libslic3r/MeshBoolean.cpp
+@@ -200,12 +200,12 @@ indexed_triangle_set cgal_to_indexed_triangle_set(const _Mesh &cgalmesh)
+     const auto &vertices = cgalmesh.vertices();
+     int vsize = int(vertices.size());
+
+-    for (auto &vi : vertices) {
++    for (const auto &vi : vertices) {
+         auto &v = cgalmesh.point(vi); // Don't ask...
+         its.vertices.emplace_back(to_vec3f(v));
+     }
+
+-    for (auto &face : faces) {
++    for (const auto &face : faces) {
+         auto vtc = cgalmesh.vertices_around_face(cgalmesh.halfedge(face));
+
+         int i = 0;