diff --git a/fix_build_issue_with_overloaded_join.patch b/fix_build_issue_with_overloaded_join.patch new file mode 100644 index 0000000..7b61fcc --- /dev/null +++ b/fix_build_issue_with_overloaded_join.patch @@ -0,0 +1,59 @@ +commit 9b79576c1ee9d57d0f4a5de5c1365bb87c548f36 +Author: Torsten Paul +Date: Wed Feb 2 00:50:43 2022 +0100 +Subject: Fix build issue with overloaded join(). +Upstream: yes + +Index: openscad-2021.01/src/openscad.cc +=================================================================== +--- openscad-2021.01.orig/src/openscad.cc ++++ openscad-2021.01/src/openscad.cc +@@ -65,7 +65,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -307,7 +306,7 @@ void set_render_color_scheme(const std:: + } + + if (exit_if_not_found) { +- LOG(message_group::None,Location::NONE,"",(boost::join(ColorMap::inst()->colorSchemeNames(), "\n"))); ++ LOG(message_group::None,Location::NONE,"",(boost::algorithm::join(ColorMap::inst()->colorSchemeNames(), "\n"))); + + exit(1); + } else { +@@ -885,7 +884,7 @@ struct CommaSeparatedVector + }; + + template +-std::string join(const Seq &seq, const std::string &sep, const ToString &toString) ++std::string str_join(const Seq &seq, const std::string &sep, const ToString &toString) + { + return boost::algorithm::join(boost::adaptors::transform(seq, toString), sep); + } +@@ -947,7 +946,7 @@ int main(int argc, char **argv) + ("P,P", po::value(), "customizer parameter set") + #ifdef ENABLE_EXPERIMENTAL + ("enable", po::value>(), ("enable experimental features: " + +- join(boost::make_iterator_range(Feature::begin(), Feature::end()), " | ", ++ str_join(boost::make_iterator_range(Feature::begin(), Feature::end()), " | ", + [](const Feature *feature) { + return feature->get_name(); + }) + +@@ -964,11 +963,11 @@ int main(int argc, char **argv) + ("render", po::value()->implicit_value(""), "for full geometry evaluation when exporting png") + ("preview", po::value()->implicit_value(""), "[=throwntogether] -for ThrownTogether preview png") + ("animate", po::value(), "export N animated frames") +- ("view", po::value(), ("=view options: " + boost::join(viewOptions.names(), " | ")).c_str()) ++ ("view", po::value(), ("=view options: " + boost::algorithm::join(viewOptions.names(), " | ")).c_str()) + ("projection", po::value(), "=(o)rtho or (p)erspective when exporting png") + ("csglimit", po::value(), "=n -stop rendering at n CSG elements when exporting png") + ("colorscheme", po::value(), ("=colorscheme: " + +- join(ColorMap::inst()->colorSchemeNames(), " | ", ++ str_join(ColorMap::inst()->colorSchemeNames(), " | ", + [](const std::string& colorScheme) { + return (colorScheme == ColorMap::inst()->defaultColorSchemeName() ? "*" : "") + colorScheme; + }) + diff --git a/fix_build_with_cgal-5.3.patch b/fix_build_with_cgal-5.3.patch index eff3dc0..a15e06d 100644 --- a/fix_build_with_cgal-5.3.patch +++ b/fix_build_with_cgal-5.3.patch @@ -6,11 +6,11 @@ Subject: Upstream patch to fix build with cgal-5.3. Fix build failure with "generic_print_polyhedron" on CGAL-5.3. -diff --git a/src/cgalutils-polyhedron.cc b/src/cgalutils-polyhedron.cc -index 0e5c72c36..14bddb7f4 100644 ---- a/src/cgalutils-polyhedron.cc -+++ b/src/cgalutils-polyhedron.cc -@@ -335,19 +335,6 @@ namespace CGALUtils { +Index: openscad-2021.01/src/cgalutils-polyhedron.cc +=================================================================== +--- openscad-2021.01.orig/src/cgalutils-polyhedron.cc ++++ openscad-2021.01/src/cgalutils-polyhedron.cc +@@ -337,19 +337,6 @@ namespace CGALUtils { } }; @@ -30,11 +30,11 @@ index 0e5c72c36..14bddb7f4 100644 }; // namespace CGALUtils #endif /* ENABLE_CGAL */ -diff --git a/src/cgalutils.h b/src/cgalutils.h -index 231762ebc..7da5a25ca 100644 ---- a/src/cgalutils.h -+++ b/src/cgalutils.h -@@ -33,7 +33,6 @@ namespace CGALUtils { +Index: openscad-2021.01/src/cgalutils.h +=================================================================== +--- openscad-2021.01.orig/src/cgalutils.h ++++ openscad-2021.01/src/cgalutils.h +@@ -45,7 +45,6 @@ namespace CGALUtils { bool is_approximately_convex(const PolySet &ps); Geometry const* applyMinkowski(const Geometry::Geometries &children); diff --git a/fix_build_with_cgal-5.4.patch b/fix_build_with_cgal-5.4.patch new file mode 100644 index 0000000..1782103 --- /dev/null +++ b/fix_build_with_cgal-5.4.patch @@ -0,0 +1,22 @@ +Date: Sun, 03 Apr 2022 11:15:44 +0300 +Subject: Fix build with CGAL-5.4 +Upstream: modified from upstream commits +- c32efe043a65b7fd761751c8edb56f8deb6a9ed5 +- 71f2831c0484c3f35cbf44e1d1dc2c857384100b + +Index: openscad-2021.01/src/cgalutils-tess.cc +=================================================================== +--- openscad-2021.01.orig/src/cgalutils-tess.cc ++++ openscad-2021.01/src/cgalutils-tess.cc +@@ -6,7 +6,10 @@ + #pragma push_macro("NDEBUG") + #undef NDEBUG + #include +-#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0) ++#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(5,4,0) ++#include ++typedef CGAL::Filtered_projection_traits_3 Projection; ++#elif CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0) + #include + #else + #include diff --git a/openscad.changes b/openscad.changes index 164c589..02839bb 100644 --- a/openscad.changes +++ b/openscad.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sun Apr 3 07:42:33 UTC 2022 - Samu Voutilainen + +- Disable build with GCAL-5.4 or newer. + Upstream has dropped pre-cgal-5.0 support and with that, reworked + CGAL integration fully. Backporting relevant patches does not + make sense. +- Add patch to fix compilation with CGAL-5.4 + + fix_build_with_cgal-5.4.patch +- Add patch to fix compilation with newer Boost versions + + fix_build_issue_with_overloaded_join.patch + ------------------------------------------------------------------- Sun Feb 6 19:02:05 UTC 2022 - John Paul Adrian Glaubitz @@ -16,7 +28,7 @@ Fri Aug 27 07:43:42 UTC 2021 - Samu Voutilainen Sat May 8 07:00:15 UTC 2021 - Samu Voutilainen - Reintroduce memory-contraints macro %limit_build -m 2500. - Constraint memoryperjob is allowing too small workers for + Constraint memoryperjob is allowing too small workers for the jobs it provides. ------------------------------------------------------------------- diff --git a/openscad.spec b/openscad.spec index f0c4b1a..8828574 100644 --- a/openscad.spec +++ b/openscad.spec @@ -27,6 +27,8 @@ Source: https://files.openscad.org/%{name}-%{version}.src.tar.gz Patch1: fix_build_with_cgal-5.3.patch Patch2: CVE-2022-0496.patch Patch3: CVE-2022-0497.patch +Patch4: fix_build_with_cgal-5.4.patch +Patch5: fix_build_issue_with_overloaded_join.patch BuildRequires: bison BuildRequires: double-conversion-devel BuildRequires: eigen3-devel @@ -39,7 +41,10 @@ BuildRequires: libboost_filesystem-devel BuildRequires: libboost_program_options-devel BuildRequires: libboost_regex-devel BuildRequires: libboost_thread-devel -BuildRequires: libcgal-devel +# Upstream has dropped pre-cgal-5.0 support and with that, reworked +# CGAL integration fully. +# Backporting relevant patches does not make sense. +BuildRequires: libcgal-devel < 5.4 BuildRequires: libqscintilla-qt5-devel BuildRequires: libspnav-devel BuildRequires: memory-constraints @@ -69,6 +74,8 @@ aspects, e.g. modelling of machine parts. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build %qmake5 PREFIX=%{_prefix} CONFIG+=qopenglwidget CONFIG+=c++14