Commit 8530b99e authored by Samuel Rounce's avatar Samuel Rounce Committed by Cabia Rangris
Browse files

super-slicer: 2.3.57.12 -> 2.5.59.13, super-slicer-latest: 2.4.58.5 ->...

super-slicer: 2.3.57.12 -> 2.5.59.13, super-slicer-latest: 2.4.58.5 -> 2.5.59.13, super-slicer-beta: 2.5.59.6 -> 2.5.60.0

* Update all super-slicer packages to latest stable verison or pre-release where applicable
* Add patches for boost 1.86 support
* Remove patches for boost 1.79
parent 1c8385ab
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
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<std::pair<std::string, std::string>>& 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/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
index 2f8ac96a1a..f0f95c9459 100644
--- a/src/slic3r/GUI/RemovableDriveManager.cpp
+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
@@ -22,7 +22,8 @@
 #include <pwd.h>
 #include <boost/filesystem.hpp>
 #include <boost/system/error_code.hpp>
-#include <boost/filesystem/convenience.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
 #include <boost/process.hpp>
 #endif
 
diff --git a/src/slic3r/GUI/ScriptExecutor.cpp b/src/slic3r/GUI/ScriptExecutor.cpp
index 3e10680e46..374915ee34 100644
--- a/src/slic3r/GUI/ScriptExecutor.cpp
+++ b/src/slic3r/GUI/ScriptExecutor.cpp
@@ -825,6 +825,19 @@ void as_back_custom_initial_value(int preset_type, std::string& key) {
     set_custom_option(preset_type, serialized_vars);
 }
 
+inline void load_string_file(boost::filesystem::path const& p, std::string& str)
+{
+    boost::filesystem::ifstream file;
+    file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
+    file.open(p, std::ios_base::binary);
+    const boost::uintmax_t sz = boost::filesystem::file_size(p);
+    if (BOOST_UNLIKELY(sz > static_cast< boost::uintmax_t >((std::numeric_limits< std::streamsize >::max)())))
+        BOOST_FILESYSTEM_THROW(std::length_error("File size exceeds max read size"));
+    str.resize(static_cast< std::size_t >(sz), '\0');
+    if (sz > 0u)
+        file.read(&str[0], static_cast< std::streamsize >(sz));
+}
+
 /////// main script fucntions //////
 
 //TODO: add "unset" function, that revert to last value (befoer a scripted set) if a set has been made since last not-scripted change.
@@ -960,7 +973,7 @@ void ScriptContainer::init(const std::string& tab_key, Tab* tab)
         //res = builder.AddSectionFromFile(ui_script_file.string().c_str()); //seems to be problematic on cyrillic locale
         {
             std::string all_file;
-            boost::filesystem::load_string_file(ui_script_file, all_file);
+            load_string_file(ui_script_file, all_file);
             res = builder.AddSectionFromMemory(ui_script_file.string().c_str(), all_file.c_str(), (unsigned int)(all_file.length()), 0);
         }
         if (res < 0) throw CompileErrorException("Error, can't build the script for tab " + tab_key);
+8 −18
Original line number Diff line number Diff line
@@ -13,38 +13,28 @@ let
  description = "PrusaSlicer fork with more features and faster development cycle";

  patches = [
    # Fix compile error with boost 1.79. See https://github.com/supermerill/SuperSlicer/issues/2823
    (fetchpatch {
      url = "https://raw.githubusercontent.com/gentoo/gentoo/81e3ca3b7c131e8345aede89e3bbcd700e1ad567/media-gfx/superslicer/files/superslicer-2.4.58.3-boost-1.79-port-v2.patch";
      # Excludes Linux-only patches
      excludes = [
        "src/slic3r/GUI/FreeCADDialog.cpp"
        "src/slic3r/GUI/Tab.cpp"
        "src/slic3r/Utils/Http.cpp"
      ];
      hash = "sha256-v0q2MhySayij7+qBTE5q01IOq/DyUcWnjpbzB/AV34c=";
    })
    # Drop if this fix gets merged upstream
    (fetchpatch {
      url = "https://github.com/supermerill/SuperSlicer/commit/fa7c545efa5d1880cf24af32083094fc872d3692.patch";
      hash = "sha256-fh31qrqjQiRQL03pQl4KJAEtbKMwG8/nJroqIDOIePw=";
    })
    ./super-slicer-use-boost186.patch
  ];

  versions = {
    stable = {
      version = "2.3.57.12";
      hash = "sha256-lePhDRHI++9zs54bTt2/Lu6ZQ7egjJCWb752aI0s7Mw==";
      patches = null;
      version = "2.5.59.13";
      hash = "sha256-FkoGcgVoBeHSZC3W5y30TBPmPrWnZSlO66TgwskgqAU=";
      inherit patches;
    };
    latest = {
      version = "2.4.58.5";
      hash = "sha256-UywxEGedXaBUTKojEkbkuejI6SdPSkPxTJMwUDNW6W0=";
      version = "2.5.59.13";
      hash = "sha256-FkoGcgVoBeHSZC3W5y30TBPmPrWnZSlO66TgwskgqAU=";
      inherit patches;
    };
    beta = {
      version = "2.5.59.6";
      hash = "sha256-4ivhkcvVw5NlPsDz3J840aWc0qnp/XzCnTTCICwi3/c=";
      version = "2.5.60.0";
      hash = "sha256-dDRK07SatLLhuoc2fJKbHUwAofRRvBUoXWO61W2blFM=";
      inherit patches;
    };
  };