From 5569971659ff988c27ea868756e7da935f42dea5 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Sat, 22 Apr 2023 12:24:32 +0200 Subject: gnu: prusa-slicer: Update to 2.5.2. * gnu/packages/patches/prusa-slicer-boost-fixes.patch: New file. * gnu/packages/patches/prusa-slicer-fix-tests.patch: New file. * gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch: New file. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/engineering.scm (prusa-slicer): Update to 2.5.2. [source]: Use patches. [inputs]: Replace cereal-1.3.0 by cereal. --- gnu/packages/engineering.scm | 9 +- .../patches/prusa-slicer-boost-fixes.patch | 97 ++++++++++++++++++++++ gnu/packages/patches/prusa-slicer-fix-tests.patch | 17 ++++ .../patches/prusa-slicer-with-cereal-1.3.1.patch | 52 ++++++++++++ 4 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/prusa-slicer-boost-fixes.patch create mode 100644 gnu/packages/patches/prusa-slicer-fix-tests.patch create mode 100644 gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch (limited to 'gnu/packages') diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 66f3769e68..44092e77c5 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -3508,7 +3508,7 @@ visualization, matrix manipulation.") (define-public prusa-slicer (package (name "prusa-slicer") - (version "2.5.0") + (version "2.5.2") (source (origin (method git-fetch) @@ -3517,7 +3517,10 @@ visualization, matrix manipulation.") (url "https://github.com/prusa3d/PrusaSlicer") (commit (string-append "version_" version)))) (file-name (git-file-name name version)) - (sha256 (base32 "17ic92ww2ny0frxyv7ajwdwa0fq70ygq562ik8sh94jx67jvxdy0")) + (sha256 (base32 "02qcrw3fa0d8ldbp73hp14l1qxbp3f4608j4csc07ny00ra42151")) + (patches (search-patches "prusa-slicer-boost-fixes.patch" + "prusa-slicer-fix-tests.patch" + "prusa-slicer-with-cereal-1.3.1.patch")) (modules '((guix build utils))) (snippet '(begin @@ -3553,7 +3556,7 @@ visualization, matrix manipulation.") (list pkg-config)) (inputs (list boost - cereal-1.3.0 + cereal cgal curl dbus diff --git a/gnu/packages/patches/prusa-slicer-boost-fixes.patch b/gnu/packages/patches/prusa-slicer-boost-fixes.patch new file mode 100644 index 0000000000..5bca271625 --- /dev/null +++ b/gnu/packages/patches/prusa-slicer-boost-fixes.patch @@ -0,0 +1,97 @@ +Fixes for Boost compatibility. +This patch comes from Gentoo: + portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_alpha2-boost-fixes.patch + +--- a/src/hints/HintsToPot.cpp ++++ b/src/hints/HintsToPot.cpp +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -9,7 +10,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(std::move(path), std::ios_base::app); + for (const auto& element : data) + { + //Example of .pot element +--- a/src/libslic3r/Preset.cpp ++++ b/src/libslic3r/Preset.cpp +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -84,7 +85,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); + boost::property_tree::read_ini(ifs, tree); + return VendorProfile::from_ini(tree, path, load_all); + } +--- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp ++++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp +@@ -10,6 +10,7 @@ + #include "libslic3r/Platform.hpp" + #include "libslic3r/Config.hpp" + ++#include + #include + #include + #include +@@ -503,4 +504,4 @@ DesktopIntegrationDialog::~DesktopIntegrationDialog() + + } // namespace GUI + } // namespace Slic3r +-#endif // __linux__ +\ No newline at end of file ++#endif // __linux__ +--- a/src/slic3r/GUI/GUI_App.cpp ++++ b/src/slic3r/GUI/GUI_App.cpp +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/src/slic3r/GUI/HintNotification.cpp ++++ b/src/slic3r/GUI/HintNotification.cpp +@@ -15,6 +15,7 @@ + #include "libslic3r/PrintConfig.hpp" + + #include ++#include + #include + #include + #include +@@ -65,7 +66,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"), std::ios::binary); + cereal::BinaryOutputArchive archive(file); + HintsCerealData cd { ids }; + try +@@ -84,7 +85,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); + cereal::BinaryInputArchive archive(file); + HintsCerealData cd; + try diff --git a/gnu/packages/patches/prusa-slicer-fix-tests.patch b/gnu/packages/patches/prusa-slicer-fix-tests.patch new file mode 100644 index 0000000000..da9a5307f9 --- /dev/null +++ b/gnu/packages/patches/prusa-slicer-fix-tests.patch @@ -0,0 +1,17 @@ +This patch comes from Gentoo: + portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_rc1-fix-tests.patch + +--- a/tests/fff_print/test_data.cpp ++++ b/tests/fff_print/test_data.cpp +@@ -4,10 +4,9 @@ + #include "libslic3r/GCodeReader.hpp" + #include "libslic3r/Config.hpp" + #include "libslic3r/Print.hpp" +-#include "libslic3r/Format/OBJ.hpp" +-#include "libslic3r/Format/STL.hpp" + + #include ++#include + #include + + #include diff --git a/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch b/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch new file mode 100644 index 0000000000..affa506b1c --- /dev/null +++ b/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch @@ -0,0 +1,52 @@ +Fix for building with cereal>=1.3.1. +This patch comes from Gentoo: + portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_rc1-cereal-1.3.1.patch + +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -127,7 +127,7 @@ + set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer") + endif () + +-target_link_libraries(PrusaSlicer libslic3r cereal) ++target_link_libraries(PrusaSlicer libslic3r libcereal) + + if (APPLE) + # add_compile_options(-stdlib=libc++) +--- a/src/slic3r/CMakeLists.txt ++++ b/src/slic3r/CMakeLists.txt +@@ -260,7 +260,7 @@ + + encoding_check(libslic3r_gui) + +-target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES}) ++target_link_libraries(libslic3r_gui libslic3r avrdude libcereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES}) + + if (MSVC) + target_link_libraries(libslic3r_gui Setupapi.lib) +--- a/src/libslic3r/CMakeLists.txt ++++ b/src/libslic3r/CMakeLists.txt +@@ -395,7 +395,7 @@ + target_link_libraries(libslic3r + libnest2d + admesh +- cereal ++ libcereal + libigl + miniz + boost_libs +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -446,6 +446,12 @@ + + # Find the Cereal serialization library + find_package(cereal REQUIRED) ++add_library(libcereal INTERFACE) ++if (NOT TARGET cereal::cereal) ++ target_link_libraries(libcereal INTERFACE cereal) ++else() ++ target_link_libraries(libcereal INTERFACE cereal::cereal) ++endif() + + # l10n + set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization") -- cgit v1.2.3