From 1fd845a5cc6c149ad10bba115782a3bff8464f03 Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Fri, 11 Feb 2022 14:02:31 -0500 Subject: [PATCH] apply upstream fix for build issue with overloaded join(), fix build against new CGAL 5.4 --- openscad-2021.01-cgal-build-fix.patch | 27 +++++++++++ openscad-2021.01-fix-overloaded-join.patch | 52 ++++++++++++++++++++++ openscad.spec | 12 ++++- 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 openscad-2021.01-cgal-build-fix.patch create mode 100644 openscad-2021.01-fix-overloaded-join.patch diff --git a/openscad-2021.01-cgal-build-fix.patch b/openscad-2021.01-cgal-build-fix.patch new file mode 100644 index 0000000..5883294 --- /dev/null +++ b/openscad-2021.01-cgal-build-fix.patch @@ -0,0 +1,27 @@ +diff -up openscad-2021.01/src/cgalutils-tess.cc.cgal-build-fix openscad-2021.01/src/cgalutils-tess.cc +--- openscad-2021.01/src/cgalutils-tess.cc.cgal-build-fix 2022-02-11 18:47:52.034828460 +0000 ++++ openscad-2021.01/src/cgalutils-tess.cc 2022-02-11 18:49:37.655228014 +0000 +@@ -6,10 +6,12 @@ + #pragma push_macro("NDEBUG") + #undef NDEBUG + #include +-#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0) +- #include ++#if CGAL_VERSION_NR < 1050401000 ++#include ++typedef CGAL::Triangulation_2_filtered_projection_traits_3 Projection; + #else +- #include ++#include ++typedef CGAL::Filtered_projection_traits_3 Projection; + #endif + #include + #pragma pop_macro("NDEBUG") +@@ -19,7 +21,6 @@ struct FaceInfo { + bool in_domain() { return nesting_level%2 == 1; } + }; + +-typedef CGAL::Triangulation_2_filtered_projection_traits_3 Projection; + typedef CGAL::Triangulation_face_base_with_info_2 Fbb; + typedef CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_vertex_base_2, diff --git a/openscad-2021.01-fix-overloaded-join.patch b/openscad-2021.01-fix-overloaded-join.patch new file mode 100644 index 0000000..d22ac6b --- /dev/null +++ b/openscad-2021.01-fix-overloaded-join.patch @@ -0,0 +1,52 @@ +diff -up openscad-2021.01/src/openscad.cc.fix-overloaded-join openscad-2021.01/src/openscad.cc +--- openscad-2021.01/src/openscad.cc.fix-overloaded-join 2022-02-11 18:40:36.655669905 +0000 ++++ openscad-2021.01/src/openscad.cc 2022-02-11 18:42:36.479585278 +0000 +@@ -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/openscad.spec b/openscad.spec index 96aa73a..53199c8 100644 --- a/openscad.spec +++ b/openscad.spec @@ -1,7 +1,7 @@ Name: openscad Version: 2021.01 %global upversion %{version} -Release: 6%{?dist} +Release: 7%{?dist} Summary: The Programmers Solid 3D CAD Modeller # COPYING contains a linking exception for CGAL # Appdata file is CC0 @@ -17,7 +17,11 @@ Patch1: %{name}-cgal5.3.patch # Upstream backports: %global github https://github.com/openscad/openscad -# ... no backports now ... +# https://github.com/openscad/openscad/commit/9b79576c1ee9d57d0f4a5de5c1365bb87c548f36 +Patch2: %{name}-2021.01-fix-overloaded-join.patch +# https://github.com/openscad/openscad/commit/71f2831c0484c3f35cbf44e1d1dc2c857384100b +Patch3: %{name}-2021.01-cgal-build-fix.patch + BuildRequires: CGAL-devel >= 3.6 BuildRequires: ImageMagick @@ -220,6 +224,10 @@ cd - %{_datadir}/%{name}/libraries/MCAD/bitmap/*.scad %changelog +* Fri Feb 11 2022 Tom Callaway - 2021.01-7 +- apply upstream fix for build issue with overloaded join() +- fix build against new CGAL 5.4 + * Thu Feb 10 2022 Orion Poplawski - 2021.01-6 - Rebuild for glew 2.2