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..b88701a --- /dev/null +++ b/fix_build_with_cgal-5.4.patch @@ -0,0 +1,34 @@ +Date: Sun, 03 Apr 2022 11:15:44 +0300 +Subject: Fix build with CGAL-5.4 +Upstream: modified from upstream commits +- c32efe043a65b7fd761751c8edb56f8deb6a9ed5 +- 71f2831c0484c3f35cbf44e1d1dc2c857384100b + +diff --git a/src/cgalutils-tess.cc b/src/cgalutils-tess.cc +index ec1cc1e..fb709fc 100644 +--- a/src/cgalutils-tess.cc ++++ b/src/cgalutils-tess.cc +@@ -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 < CGAL_VERSION_NUMBER(5, 4, 0) ++#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.changes b/openscad.changes index 164c589..01b5afa 100644 --- a/openscad.changes +++ b/openscad.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Mon Jul 4 10:02:04 UTC 2022 - Christophe Giboudeaux + +- Rebase fix_build_with_cgal-5.4.patch +- Spec cleanup + +------------------------------------------------------------------- +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 +34,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..d552303 100644 --- a/openscad.spec +++ b/openscad.spec @@ -24,22 +24,23 @@ License: GPL-3.0-or-later Group: Productivity/Graphics/CAD URL: https://www.openscad.org/ 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 +Patch0: fix_build_with_cgal-5.3.patch +Patch1: CVE-2022-0496.patch +Patch2: CVE-2022-0497.patch +Patch3: fix_build_with_cgal-5.4.patch +Patch4: fix_build_issue_with_overloaded_join.patch BuildRequires: bison BuildRequires: double-conversion-devel -BuildRequires: eigen3-devel BuildRequires: flex -BuildRequires: fontconfig-devel -BuildRequires: freetype2-devel BuildRequires: gcc-c++ -BuildRequires: harfbuzz-devel 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.0 BuildRequires: libqscintilla-qt5-devel BuildRequires: libspnav-devel BuildRequires: memory-constraints @@ -48,10 +49,17 @@ BuildRequires: pkgconfig BuildRequires: pkgconfig(Qt5Concurrent) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5DBus) +BuildRequires: pkgconfig(Qt5Gamepad) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Multimedia) +BuildRequires: pkgconfig(Qt5Network) BuildRequires: pkgconfig(Qt5OpenGL) BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(cairo) > 1.14 +BuildRequires: pkgconfig(eigen3) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libzip) # With v2019.05, openGL is required but Arm uses openGL ES @@ -64,24 +72,24 @@ creation of, say, computer-animated movies, but instead on the CAD aspects, e.g. modelling of machine parts. %prep -%setup -q - -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%autosetup -p1 %build -%qmake5 PREFIX=%{_prefix} CONFIG+=qopenglwidget CONFIG+=c++14 +%qmake5 PREFIX=%{_prefix} CONFIG+=qopenglwidget + # As of 08.05.2021, memoryperjob constraint is not working correctly, # so limit memory per job here. %limit_build -m 2500 %make_build %install -make INSTALL_ROOT=%{buildroot} install +%qmake5_install + install -D -m 0644 doc/openscad.1 %{buildroot}%{_mandir}/man1/openscad.1 + # remove bundled liberation fonts -rm -rf %{buildroot}%{_datadir}/openscad/fonts +rm -r %{buildroot}%{_datadir}/openscad/fonts + %find_lang %{name} rm %{buildroot}%{_datadir}/openscad/libraries/MCAD/.gitignore