Accepting request 1107872 from science

- Add PrusaSlicer-pr11154-fix-cgal-c++-error.patch
  * gh#prusa3d/PrusaSlicer#11154
  * Fixes error on CGAL 5.6 (forwarded request 1107871 from bnavigator)

OBS-URL: https://build.opensuse.org/request/show/1107872
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/PrusaSlicer?expand=0&rev=29
This commit is contained in:
Ana Guerrero 2023-08-30 08:19:32 +00:00 committed by Git OBS Bridge
commit d7a69d04cd
3 changed files with 62 additions and 9 deletions

View File

@ -0,0 +1,43 @@
From dcc281f3604b8508ec01e6649c883d7fff4bd3d1 Mon Sep 17 00:00:00 2001
From: Chow Loong Jin <hyperair@debian.org>
Date: Tue, 22 Aug 2023 15:35:56 +0800
Subject: [PATCH] Fix compilation errors with -std=gnu++17
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the following error:
[ 19%] Built target imgui
/<<PKGBUILDDIR>>/src/libslic3r/MeshBoolean.cpp: In instantiation of indexed_triangle_set Slic3r::MeshBoolean::cgal::cgal_to_indexed_triangle_set(const _Mesh&) [with _Mesh = CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick> >]:
/<<PKGBUILDDIR>>/src/libslic3r/MeshBoolean.cpp:185:53: required from here
/<<PKGBUILDDIR>>/src/libslic3r/MeshBoolean.cpp:151:5: error: cannot bind non-const lvalue reference of type CGAL::SM_Vertex_index& to an rvalue of type boost::iterators::detail::iterator_facade_base<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick> >::Index_iterator<CGAL::SM_Vertex_index>, CGAL::SM_Vertex_index, std::random_access_iterator_tag, CGAL::SM_Vertex_index, long int, false, false>::reference {aka CGAL::SM_Vertex_index}
151 | for (auto &vi : vertices) {
| ^~~
/<<PKGBUILDDIR>>/src/libslic3r/MeshBoolean.cpp:156:5: error: cannot bind non-const lvalue reference of type CGAL::SM_Face_index& to an rvalue of type boost::iterators::detail::iterator_facade_base<CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick> >::Index_iterator<CGAL::SM_Face_index>, CGAL::SM_Face_index, std::random_access_iterator_tag, CGAL::SM_Face_index, long int, false, false>::reference {aka CGAL::SM_Face_index}
156 | for (auto &face : faces) {
| ^~~
make[3]: *** [src/libslic3r/CMakeFiles/libslic3r_cgal.dir/build.make:121: src/libslic3r/CMakeFiles/libslic3r_cgal.dir/MeshBoolean.cpp.o] Error 1
---
src/libslic3r/MeshBoolean.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libslic3r/MeshBoolean.cpp b/src/libslic3r/MeshBoolean.cpp
index c7ebcbd19e0..06fa5f35fce 100644
--- a/src/libslic3r/MeshBoolean.cpp
+++ b/src/libslic3r/MeshBoolean.cpp
@@ -148,12 +148,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;

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Tue Aug 29 07:23:22 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Add PrusaSlicer-pr11154-fix-cgal-c++-error.patch
* gh#prusa3d/PrusaSlicer#11154
* Fixes error on CGAL 5.6
-------------------------------------------------------------------
Sun Aug 20 16:01:37 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Limit to CGAL < 5.6 as it introduced breaking changes which
PrusaSlicer is not compatible yet
- Disable failing ix86 build
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 21 10:32:11 UTC 2023 - Ben Greiner <code@bnavigator.de> Fri Jul 21 10:32:11 UTC 2023 - Ben Greiner <code@bnavigator.de>

View File

@ -32,9 +32,11 @@ Patch1: PrusaSlicer-2.6.0-octoprint-name-fix.patch
Patch2: PrusaSlicer-2.6.0-wxWidgets-CheckResizerFlags-assert-fix.patch Patch2: PrusaSlicer-2.6.0-wxWidgets-CheckResizerFlags-assert-fix.patch
# PATCH-FIX-UPSTREAM PrusaSlicer-drop-wx3.0.patch gh#prusa3d/PrusaSlicer#11027 - wxWidgets >= 3.1.6 is required # PATCH-FIX-UPSTREAM PrusaSlicer-drop-wx3.0.patch gh#prusa3d/PrusaSlicer#11027 - wxWidgets >= 3.1.6 is required
Patch3: PrusaSlicer-drop-wx3.0.patch Patch3: PrusaSlicer-drop-wx3.0.patch
# PATCH-FIX-UPSTREAM PrusaSlicer-pr11154-fix-cgal-c++-error.patch gh#prusa3d/PrusaSlicer#11154
Patch4: PrusaSlicer-pr11154-fix-cgal-c++-error.patch
BuildRequires: blosc-devel BuildRequires: blosc-devel
BuildRequires: cereal-devel BuildRequires: cereal-devel
BuildRequires: cgal-devel >= 4.13.2 BuildRequires: cgal-devel >= 5.6
BuildRequires: cmake BuildRequires: cmake
BuildRequires: eigen3-devel >= 3 BuildRequires: eigen3-devel >= 3
BuildRequires: expat BuildRequires: expat
@ -80,6 +82,8 @@ BuildRequires: pkgconfig(qhullcpp)
BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-egl)
Requires: noto-sans-fonts Requires: noto-sans-fonts
# Cannot allocate memory to build
ExcludeArch: %{ix86}
%description %description
PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code
@ -112,15 +116,7 @@ sed -i 's|slic3r_jobs_tests.cpp||' tests/slic3rutils/CMakeLists.txt
# https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.build_job_constraints.html # https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.build_job_constraints.html
# https://en.opensuse.org/openSUSE:Specfile_guidelines#Parallel_make # https://en.opensuse.org/openSUSE:Specfile_guidelines#Parallel_make
%limit_build -m 3072 %limit_build -m 3072
# sse2 flags for 32-bit: see gh#prusa3d/PrusaSlicer#3781
%ifarch %ix86
export CFLAGS="%optflags -mfpmath=sse -msse2"
export CXXFLAGS="$CFLAGS"
%endif
export CC=gcc-%gcc_ver CXX=g++-%gcc_ver export CC=gcc-%gcc_ver CXX=g++-%gcc_ver
# rh#2059646
#sed -i tests/libslic3r/CMakeLists.txt -e '\@test_voronoi.cpp@d'
%cmake \ %cmake \
-DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_STANDARD=17 \
-DSLIC3R_FHS=1 \ -DSLIC3R_FHS=1 \