[arch-commits] Commit in (7 files)

Maxime Gauduin alucryd at gemini.archlinux.org
Wed Jun 15 13:55:56 UTC 2022


    Date: Wednesday, June 15, 2022 @ 13:55:55
  Author: alucryd
Revision: 1238032

add superslicer

Added:
  superslicer/
  superslicer/trunk/
  superslicer/trunk/PKGBUILD
  superslicer/trunk/superslicer-boost1.79.patch
  superslicer/trunk/superslicer-cereal.patch
  superslicer/trunk/superslicer-openexr3.patch
  superslicer/trunk/superslicer-wxgtk3-wayland.patch

----------------------------------+
 PKGBUILD                         |   80 ++++++++++++++++++++++++++++++++++++
 superslicer-boost1.79.patch      |   81 +++++++++++++++++++++++++++++++++++++
 superslicer-cereal.patch         |   70 +++++++++++++++++++++++++++++++
 superslicer-openexr3.patch       |   77 +++++++++++++++++++++++++++++++++++
 superslicer-wxgtk3-wayland.patch |   21 +++++++++
 5 files changed, 329 insertions(+)

Added: superslicer/trunk/PKGBUILD
===================================================================
--- superslicer/trunk/PKGBUILD	                        (rev 0)
+++ superslicer/trunk/PKGBUILD	2022-06-15 13:55:55 UTC (rev 1238032)
@@ -0,0 +1,80 @@
+# Maintainer: Lukas1818 aur at lukas1818 dot de
+
+pkgname=superslicer
+pkgver=2.4.58.2
+pkgrel=1
+epoch=1
+pkgdesc='G-code generator for 3D printers'
+arch=(x86_64)
+url=https://github.com/supermerill/SuperSlicer
+license=(AGPL3)
+options=(!emptydirs)
+depends=(
+  boost-libs
+  cgal
+  glew
+  imath
+  libspnav
+  nlopt
+  openvdb
+  qhull
+  wxgtk3
+)
+makedepends=(
+  boost
+  cereal
+  cmake
+  eigen
+  git
+  libigl
+  ninja
+  wxgtk2
+)
+optdepends=('superslicer-profiles: Predefined printer profiles')
+_tag=6fcfe8fc9b70e2e5b0aefd122153c27815bb7c8f
+source=(
+  git+https://github.com/supermerill/SuperSlicer.git#tag=${_tag}
+  superslicer-wxgtk3-wayland.patch
+  superslicer-cereal.patch
+  superslicer-openexr3.patch
+  superslicer-boost1.79.patch
+)
+b2sums=('SKIP'
+        '6b8abda2bfee9294bd5cd97380403680d6b2c6187af178e5eb4be2665280d1ff0d66036525b485e64d38d1d464756388fd4b53c6277d691079f51e6ee0c12372'
+        'a652af374ca4cdd2b1db87bac9a1a6263a3c0df954c8afa4fddea3041659b159412fe3ab850d804a27dcb4b3ca8d64de511ef11769d353d7d2a0f7021dc38e99'
+        'd351d05190977e55047504d13ab4172c7eaf7fb2077a61a448dd29a8a27084ee4b13284143102b7ea3dff0edc8b20675dff0014e9f26cd5f448e50c04a1d6779'
+        '45ff3ab349a92b072eed57a511aead233e4356fcc9ab9382902af9702aee22f73c9a9f07a58420ca20c7c2cd41e81637f1d0114033c2fdb7f597cbcb484fa8ff')
+
+prepare() {
+  cd SuperSlicer
+  patch -Np1 -i "$srcdir/superslicer-wxgtk3-wayland.patch"
+  patch -Np1 -i "$srcdir/superslicer-cereal.patch"
+  patch -Np1 -i "$srcdir/superslicer-openexr3.patch"
+  patch -Np1 -i "$srcdir/superslicer-boost1.79.patch"
+}
+
+pkgver() {
+  cd SuperSlicer
+  git describe --tags
+}
+
+build() {
+  cmake -S SuperSlicer -B build -G Ninja \
+    -DCMAKE_BUILD_TYPE=None \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DOpenGL_GL_PREFERENCE=GLVND \
+    -DSLIC3R_ALPHA=OFF \
+    -DSLIC3R_BUILD_TESTS=OFF \
+    -DSLIC3R_FHS=ON \
+    -DSLIC3R_GTK=3 \
+    -DSLIC3R_STATIC=OFF \
+    -DSLIC3R_WX_STABLE=ON
+  cmake --build build
+}
+
+package() {
+  DESTDIR="${pkgdir}" cmake --install build
+  test ! -h "${pkgdir}/usr/share/SuperSlicer/resources" || rm "${pkgdir}/usr/share/SuperSlicer/resources"
+}
+
+# vim: ts=2 sw=2 et:

Added: superslicer/trunk/superslicer-boost1.79.patch
===================================================================
--- superslicer/trunk/superslicer-boost1.79.patch	                        (rev 0)
+++ superslicer/trunk/superslicer-boost1.79.patch	2022-06-15 13:55:55 UTC (rev 1238032)
@@ -0,0 +1,81 @@
+From 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Mon Sep 17 00:00:00 2001
+From: Vojtech Bubnik <bubnikv at gmail.com>
+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<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/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 <map>
++
+ #include <boost/algorithm/string/replace.hpp>
+ #include <boost/filesystem.hpp>
+ #include <boost/nowide/fstream.hpp>
+ #include <boost/log/trivial.hpp>
+ #include <boost/property_tree/ini_parser.hpp>
+-#include <map>
++
+ #include <cereal/archives/binary.hpp>
+ #include <cereal/types/string.hpp>
+ #include <cereal/types/vector.hpp>
+@@ -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<std::string>& 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<std::string>& 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

Added: superslicer/trunk/superslicer-cereal.patch
===================================================================
--- superslicer/trunk/superslicer-cereal.patch	                        (rev 0)
+++ superslicer/trunk/superslicer-cereal.patch	2022-06-15 13:55:55 UTC (rev 1238032)
@@ -0,0 +1,70 @@
+diff --git a/cmake/modules/Findcereal.cmake b/cmake/modules/Findcereal.cmake
+deleted file mode 100644
+index b4829757e..000000000
+--- a/cmake/modules/Findcereal.cmake
++++ /dev/null
+@@ -1,26 +0,0 @@
+-set(_q "")
+-if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
+-    set(_q QUIET)
+-    set(_quietly TRUE)
+-endif()
+-find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
+-
+-if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
+-    # Fall-back solution to find the Cereal serialization library header file
+-    include(CheckIncludeFileCXX)
+-    add_library(cereal INTERFACE)
+-    target_include_directories(cereal INTERFACE include)
+-
+-    if (_quietly)
+-        set(CMAKE_REQUIRED_QUIET ON)
+-    endif()
+-    CHECK_INCLUDE_FILE_CXX("cereal/cereal.hpp" HAVE_CEREAL_H)
+-
+-    if (NOT HAVE_CEREAL_H)
+-        if (${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+-            message(FATAL_ERROR "Cereal library not found. Please install the dependency.")
+-        elseif(NOT _quietly)
+-            message(WARNING "Cereal library not found.")
+-        endif()
+-    endif ()
+-endif()
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 01ef37905..98dbafa01 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -139,7 +139,7 @@ if (NOT WIN32)
+     set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}")
+ endif ()
+ 
+-target_link_libraries(Slic3r libslic3r cereal)
++target_link_libraries(Slic3r 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/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt
+index 7048fb60c..95c5ed9e2 100644
+--- a/src/libslic3r/CMakeLists.txt
++++ b/src/libslic3r/CMakeLists.txt
+@@ -356,7 +356,6 @@ target_include_directories(libslic3r PUBLIC ${EXPAT_INCLUDE_DIRS})
+ target_link_libraries(libslic3r
+     libnest2d
+     admesh
+-    cereal
+     libigl
+     miniz
+     boost_libs
+diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
+index fe3d15425..24be67592 100644
+--- a/src/slic3r/CMakeLists.txt
++++ b/src/slic3r/CMakeLists.txt
+@@ -291,7 +291,7 @@ target_compile_definitions(libslic3r_gui PRIVATE $<$<BOOL:${SLIC3R_ALPHA}>:SLIC3
+ 
+ encoding_check(libslic3r_gui)
+ 
+-target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui GLEW::GLEW OpenGL::GL hidapi exif angelscript libcurl ${wxWidgets_LIBRARIES})
++target_link_libraries(libslic3r_gui libslic3r avrdude imgui GLEW::GLEW OpenGL::GL hidapi exif angelscript libcurl ${wxWidgets_LIBRARIES})
+ 
+ if (MSVC)
+     target_link_libraries(libslic3r_gui Setupapi.lib)

Added: superslicer/trunk/superslicer-openexr3.patch
===================================================================
--- superslicer/trunk/superslicer-openexr3.patch	                        (rev 0)
+++ superslicer/trunk/superslicer-openexr3.patch	2022-06-15 13:55:55 UTC (rev 1238032)
@@ -0,0 +1,77 @@
+diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake
+index 4fde5fa4a..566e73a5e 100644
+--- a/cmake/modules/FindOpenVDB.cmake
++++ b/cmake/modules/FindOpenVDB.cmake
+@@ -347,28 +347,10 @@ macro(just_fail msg)
+   return()
+ endmacro()
+ 
+-find_package(IlmBase QUIET)
+-if(NOT IlmBase_FOUND)
+-  pkg_check_modules(IlmBase QUIET IlmBase)
+-endif()
+-if (IlmBase_FOUND AND NOT TARGET IlmBase::Half)
+-  message(STATUS "Falling back to IlmBase found by pkg-config...")
+-
+-  find_library(IlmHalf_LIBRARY NAMES Half)
+-  if(IlmHalf_LIBRARY-NOTFOUND OR NOT IlmBase_INCLUDE_DIRS)
+-    just_fail("IlmBase::Half can not be found!")
+-  endif()
+-  
+-  add_library(IlmBase::Half UNKNOWN IMPORTED)
+-  set_target_properties(IlmBase::Half PROPERTIES
+-    IMPORTED_LOCATION "${IlmHalf_LIBRARY}"
+-    INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}")
+-elseif(NOT IlmBase_FOUND)
+-  just_fail("IlmBase::Half can not be found!")
+-endif()
+ find_package(TBB ${_quiet} ${_required} COMPONENTS tbb)
+ find_package(ZLIB ${_quiet} ${_required})
+ find_package(Boost ${_quiet} ${_required} COMPONENTS iostreams system )
++find_package(Imath CONFIG)
+ 
+ # Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
+ # which we can query for optional deps. This basically runs ldd/otoll/objdump
+@@ -419,7 +401,7 @@ foreach(PREREQUISITE ${_OPENVDB_PREREQUISITE_LIST})
+     set(OpenVDB_USES_LOG4CPLUS ON)
+   endif()
+ 
+-  string(FIND ${PREREQUISITE} "IlmImf" _HAS_DEP)
++  string(FIND ${PREREQUISITE} "OpenEXR" _HAS_DEP)
+   if(NOT ${_HAS_DEP} EQUAL -1)
+     set(OpenVDB_USES_ILM ON)
+   endif()
+@@ -450,11 +432,7 @@ if(OpenVDB_USES_LOG4CPLUS)
+   find_package(Log4cplus ${_quiet} ${_required})
+ endif()
+ 
+-if(OpenVDB_USES_ILM)
+-  find_package(IlmBase ${_quiet} ${_required})
+-endif()
+-
+-if(OpenVDB_USES_EXR)
++if(OpenVDB_USES_ILM OR OpenVDB_USES_EXR)
+   find_package(OpenEXR ${_quiet} ${_required})
+ endif()
+ 
+@@ -471,7 +449,7 @@ endif()
+ set(_OPENVDB_VISIBLE_DEPENDENCIES
+   Boost::iostreams
+   Boost::system
+-  IlmBase::Half
++  Imath::Imath
+ )
+ 
+ set(_OPENVDB_DEFINITIONS)
+@@ -481,10 +459,7 @@ endif()
+ 
+ if(OpenVDB_USES_EXR)
+   list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES
+-    IlmBase::IlmThread
+-    IlmBase::Iex
+-    IlmBase::Imath
+-    OpenEXR::IlmImf
++    OpenEXR::OpenEXR
+   )
+   list(APPEND _OPENVDB_DEFINITIONS "-DOPENVDB_TOOLS_RAYTRACER_USE_EXR")
+ endif()

Added: superslicer/trunk/superslicer-wxgtk3-wayland.patch
===================================================================
--- superslicer/trunk/superslicer-wxgtk3-wayland.patch	                        (rev 0)
+++ superslicer/trunk/superslicer-wxgtk3-wayland.patch	2022-06-15 13:55:55 UTC (rev 1238032)
@@ -0,0 +1,21 @@
+diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp
+index 4e85967a5..f141aabb5 100644
+--- a/src/slic3r/GUI/GUI.cpp
++++ b/src/slic3r/GUI/GUI.cpp
+@@ -35,6 +35,16 @@
+ 
+ namespace Slic3r { namespace GUI {
+ 
++// wxgtk3 is broken on wayland: https://trac.wxwidgets.org/ticket/17702
++#ifdef __WXGTK3__
++struct ForceX11 {
++    ForceX11() {
++        setenv("GDK_BACKEND", "x11", 1);
++    }
++};
++static struct ForceX11 forcex11;
++#endif
++
+ #if __APPLE__
+ IOPMAssertionID assertionID;
+ #endif



More information about the arch-commits mailing list