From 704f8bf58705ce68a751b8e38b565314123f98ca Mon Sep 17 00:00:00 2001 From: sinetek Date: Mon, 9 Jan 2023 18:03:58 +0100 Subject: [PATCH] PrusaSlicer: update to 2.5.0. --- .../PrusaSlicer/patches/boost-nowide.patch | 81 +++++++++++++++++++ .../patches/cereal-is-header-only.patch | 1 + .../patches/cmake-relax-occt-dependency.patch | 11 +++ srcpkgs/PrusaSlicer/template | 8 +- 4 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/PrusaSlicer/patches/boost-nowide.patch create mode 100644 srcpkgs/PrusaSlicer/patches/cmake-relax-occt-dependency.patch diff --git a/srcpkgs/PrusaSlicer/patches/boost-nowide.patch b/srcpkgs/PrusaSlicer/patches/boost-nowide.patch new file mode 100644 index 000000000000..f3ad855ad4de --- /dev/null +++ b/srcpkgs/PrusaSlicer/patches/boost-nowide.patch @@ -0,0 +1,81 @@ +From 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Mon Sep 17 00:00:00 2001 +From: Vojtech Bubnik +Date: Mon, 25 Apr 2022 08:33:48 +0200 +Subject: [PATCH] Fix of Boost 1.79 deprecated boost::filesystem::ofstream + #8238 Replacing boost::filesystem::fstream with boost::nowide::fstream + variants with the unfortunate cost of string path conversion on Windows from + 16 bits to UTF8 and back to 16 bits. + +Unfortunately we cannot use std::filesystem yet as it is missing +on older MACs and because the interface is crooked minefield on Windows +see https://github.com/microsoft/STL/issues/909 +--- + src/hints/HintsToPot.cpp | 2 +- + src/libslic3r/Preset.cpp | 2 +- + src/slic3r/GUI/HintNotification.cpp | 8 +++++--- + 3 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/hints/HintsToPot.cpp b/src/hints/HintsToPot.cpp +index 7c8029cdeb..4791f0612f 100644 +--- a/src/hints/HintsToPot.cpp ++++ b/src/hints/HintsToPot.cpp +@@ -9,7 +9,7 @@ + + bool write_to_pot(boost::filesystem::path path, const std::vector>& data) + { +- boost::filesystem::ofstream file(std::move(path), std::ios_base::app); ++ boost::nowide::ofstream file(path.string(), std::ios_base::app); + for (const auto& element : data) + { + //Example of .pot element +diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp +index f3a1c15b3e..f171cb14dd 100644 +--- a/src/libslic3r/Preset.cpp ++++ b/src/libslic3r/Preset.cpp +@@ -84,7 +84,7 @@ ConfigFileType guess_config_file_type(const ptree &tree) + VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all) + { + ptree tree; +- boost::filesystem::ifstream ifs(path); ++ boost::nowide::ifstream ifs(path.string()); + boost::property_tree::read_ini(ifs, tree); + return VendorProfile::from_ini(tree, path, load_all); + } +diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp +index 93e0fb3259..820b74eedb 100644 +--- a/src/slic3r/GUI/HintNotification.cpp ++++ b/src/slic3r/GUI/HintNotification.cpp +@@ -14,12 +14,14 @@ + #include "libslic3r/Config.hpp" + #include "libslic3r/PrintConfig.hpp" + ++#include ++ + #include + #include + #include + #include + #include +-#include ++ + #include + #include + #include +@@ -65,7 +67,7 @@ inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f + + void write_used_binary(const std::vector& ids) + { +- boost::filesystem::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary); ++ boost::nowide::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal").string(), std::ios::binary); + cereal::BinaryOutputArchive archive(file); + HintsCerealData cd { ids }; + try +@@ -84,7 +86,7 @@ void read_used_binary(std::vector& ids) + BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string(); + return; + } +- boost::filesystem::ifstream file(path); ++ boost::nowide::ifstream file(path.string()); + cereal::BinaryInputArchive archive(file); + HintsCerealData cd; + try diff --git a/srcpkgs/PrusaSlicer/patches/cereal-is-header-only.patch b/srcpkgs/PrusaSlicer/patches/cereal-is-header-only.patch index 10b9a29864ae..c29d9974e475 100644 --- a/srcpkgs/PrusaSlicer/patches/cereal-is-header-only.patch +++ b/srcpkgs/PrusaSlicer/patches/cereal-is-header-only.patch @@ -20,6 +20,7 @@ Index: PrusaSlicer-2.4.2/src/CMakeLists.txt -target_link_libraries(PrusaSlicer libslic3r cereal) +target_link_libraries(PrusaSlicer libslic3r) + if (APPLE) # add_compile_options(-stdlib=libc++) # add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE) diff --git a/srcpkgs/PrusaSlicer/patches/cmake-relax-occt-dependency.patch b/srcpkgs/PrusaSlicer/patches/cmake-relax-occt-dependency.patch new file mode 100644 index 000000000000..51d2c1124292 --- /dev/null +++ b/srcpkgs/PrusaSlicer/patches/cmake-relax-occt-dependency.patch @@ -0,0 +1,11 @@ +--- PrusaSlicer-version_2.5.0/src/occt_wrapper/CMakeLists.txt.orig 2022-09-17 11:47:02.398209546 +0200 ++++ PrusaSlicer-version_2.5.0/src/occt_wrapper/CMakeLists.txt 2022-09-17 11:47:30.092595307 +0200 +@@ -19,7 +19,7 @@ include(GenerateExportHeader) + + generate_export_header(OCCTWrapper) + +-find_package(OpenCASCADE 7.6.2 REQUIRED) ++find_package(OpenCASCADE 7.4.0...7.999.999 REQUIRED) + + set(OCCT_LIBS + TKXDESTEP diff --git a/srcpkgs/PrusaSlicer/template b/srcpkgs/PrusaSlicer/template index 676680fb4297..a3bf65d8c112 100644 --- a/srcpkgs/PrusaSlicer/template +++ b/srcpkgs/PrusaSlicer/template @@ -1,12 +1,12 @@ # Template file for 'PrusaSlicer' pkgname=PrusaSlicer -version=2.4.2 -revision=4 +version=2.5.0 +revision=1 build_style=cmake build_helper="qemu cmake-wxWidgets-gtk3" # Pre-Compiled Headers seems to be slower configure_args="-DSLIC3R_WX_STABLE=1 -DSLIC3R_FHS=1 -DSLIC3R_GTK=3 - -DSLIC3R_ENC_CHECK=0 -DUSE_BLOSC=ON -DUSE_EXR=ON -DSLIC3R_PCH=OFF" + -DSLIC3R_ENC_CHECK=0 -DUSE_BLOSC=ON -DUSE_EXR=ON -DSLIC3R_PCH=OFF -DSLIC3R_ENABLE_FORMAT_STEP=" hostmakedepends="pkg-config" makedepends=" boost-devel cereal cgal-devel dbus-devel eigen glew-devel glu-devel gmpxx-devel gtest-devel gtk+3-devel libcurl-devel libglib-devel @@ -17,7 +17,7 @@ maintainer="Jasper Chan " license="GPL-3.0-or-later" homepage="https://www.prusa3d.com/prusaslicer/" distfiles="https://github.com/prusa3d/Prusaslicer/archive/version_${version}.tar.gz" -checksum=ac3a77212260e8d0baf9df027c29e0ae965bc77f371e59fd27b8fe103ebb1f23 +checksum=dbbf3e10c812d1dc7bae4bd6879e60f864d763b2738b099dd34b9636d0e5eb6a post_extract() { # Mark tests that fail on certain targets