From fb7446f4283f295340b92d67542d74fc9f6fe676 Mon Sep 17 00:00:00 2001 From: Hutzdog Date: Wed, 28 Sep 2022 10:10:58 -0700 Subject: [PATCH] New package: SuperSlicer-2.4.58.5 --- srcpkgs/SuperSlicer/files/SuperSlicer.desktop | 11 +++++ ...-sys-unistd.h-with-unistd.h-for-musl.patch | 25 ++++++++++ ...ace-get_current_thread_name-for-musl.patch | 30 ++++++++++++ .../patches/cmake-is-very-good.patch | 25 ++++++++++ srcpkgs/SuperSlicer/patches/fstream.patch | 10 ++++ srcpkgs/SuperSlicer/patches/string_file.patch | 6 +++ srcpkgs/SuperSlicer/patches/tdd-gcode.patch | 36 ++++++++++++++ srcpkgs/SuperSlicer/template | 47 +++++++++++++++++++ 8 files changed, 190 insertions(+) create mode 100644 srcpkgs/SuperSlicer/files/SuperSlicer.desktop create mode 100644 srcpkgs/SuperSlicer/patches/0001-Replace-sys-unistd.h-with-unistd.h-for-musl.patch create mode 100644 srcpkgs/SuperSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch create mode 100644 srcpkgs/SuperSlicer/patches/cmake-is-very-good.patch create mode 100644 srcpkgs/SuperSlicer/patches/fstream.patch create mode 100644 srcpkgs/SuperSlicer/patches/string_file.patch create mode 100644 srcpkgs/SuperSlicer/patches/tdd-gcode.patch create mode 100644 srcpkgs/SuperSlicer/template diff --git a/srcpkgs/SuperSlicer/files/SuperSlicer.desktop b/srcpkgs/SuperSlicer/files/SuperSlicer.desktop new file mode 100644 index 000000000000..66a0b0f9318c --- /dev/null +++ b/srcpkgs/SuperSlicer/files/SuperSlicer.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=SuperSlicer +Exec=/usr/bin/ +Icon=SuperSlicer +Terminal=false +Type=Application +StartupNotify=false +MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; +Icon=/usr/share/SuperSlicer/icons/SuperSlicer_192px.png +Categories=Graphics;3DGraphics; +Keywords=3D;Printing;Slicer; diff --git a/srcpkgs/SuperSlicer/patches/0001-Replace-sys-unistd.h-with-unistd.h-for-musl.patch b/srcpkgs/SuperSlicer/patches/0001-Replace-sys-unistd.h-with-unistd.h-for-musl.patch new file mode 100644 index 000000000000..c759e84879aa --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/0001-Replace-sys-unistd.h-with-unistd.h-for-musl.patch @@ -0,0 +1,25 @@ +From 7cdeb3dfbe01fc681c35e89e3f509c8e7ac9522e Mon Sep 17 00:00:00 2001 +From: Jasper Chan +Date: Mon, 27 May 2019 18:54:59 -0700 +Subject: [PATCH] Replace sys/unistd.h with unistd.h for musl + +--- + src/slic3r/Utils/Serial.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/slic3r/Utils/Serial.cpp src/slic3r/Utils/Serial.cpp +index 601719b50..43dab2390 100644 +--- a/src/slic3r/Utils/Serial.cpp ++++ b/src/slic3r/Utils/Serial.cpp +@@ -42,7 +42,7 @@ + #ifndef _WIN32 + #include + #include +- #include ++ #include + #include + #endif + +-- +2.21.0 + diff --git a/srcpkgs/SuperSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch b/srcpkgs/SuperSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch new file mode 100644 index 000000000000..1dca187b2bae --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch @@ -0,0 +1,30 @@ +--- a/src/libslic3r/Thread.cpp 2021-01-24 13:50:00.469444149 +0100 ++++ b/src/libslic3r/Thread.cpp 2021-01-24 13:51:17.109443201 +0100 +@@ -171,16 +171,27 @@ bool set_thread_name(boost::thread &thre + return true; + } + ++#ifndef __GLIBC__ ++thread_local char current_thread_name[16] = { 0 }; ++#endif ++ + bool set_current_thread_name(const char *thread_name) + { ++#ifndef __GLIBC__ ++ strncpy(current_thread_name, thread_name, 15); ++#endif + pthread_setname_np(pthread_self(), thread_name); + return true; + } + + std::optional get_current_thread_name() + { ++#ifdef __GLIBC__ + char buf[16]; + return std::string(pthread_getname_np(pthread_self(), buf, 16) == 0 ? buf : ""); ++#else ++ return std::string(current_thread_name); ++#endif + } + + #endif diff --git a/srcpkgs/SuperSlicer/patches/cmake-is-very-good.patch b/srcpkgs/SuperSlicer/patches/cmake-is-very-good.patch new file mode 100644 index 000000000000..f2ca8e0c1f76 --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/cmake-is-very-good.patch @@ -0,0 +1,25 @@ +get_prerequisites will go straight to run ldd on the libraries. + +get_prerequisites supports objdump, but only on Windows +--- a/cmake/modules/FindOpenVDB.cmake ++++ b/cmake/modules/FindOpenVDB.cmake +@@ -381,19 +381,6 @@ set(_EXCLUDE_SYSTEM_PREREQUISITES 1) + set(_RECURSE_PREREQUISITES 0) + set(_OPENVDB_PREREQUISITE_LIST) + +-if(NOT OPENVDB_USE_STATIC_LIBS) +-get_prerequisites(${OpenVDB_openvdb_LIBRARY} +- _OPENVDB_PREREQUISITE_LIST +- ${_EXCLUDE_SYSTEM_PREREQUISITES} +- ${_RECURSE_PREREQUISITES} +- "" +- "${SYSTEM_LIBRARY_PATHS}" +-) +-endif() +- +-unset(_EXCLUDE_SYSTEM_PREREQUISITES) +-unset(_RECURSE_PREREQUISITES) +- + # As the way we resolve optional libraries relies on library file names, use + # the configuration options from the main CMakeLists.txt to allow users + # to manually identify the requirements of OpenVDB builds if they know them. diff --git a/srcpkgs/SuperSlicer/patches/fstream.patch b/srcpkgs/SuperSlicer/patches/fstream.patch new file mode 100644 index 000000000000..936593209c53 --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/fstream.patch @@ -0,0 +1,10 @@ +--- a/src/hints/HintsToPot.cpp ++++ b/src/hints/HintsToPot.cpp +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/srcpkgs/SuperSlicer/patches/string_file.patch b/srcpkgs/SuperSlicer/patches/string_file.patch new file mode 100644 index 000000000000..76040869f404 --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/string_file.patch @@ -0,0 +1,6 @@ +--- a/src/slic3r/GUI/ScriptExecutor.cpp ++++ b/src/slic3r/GUI/ScriptExecutor.cpp +@@ -7,2 +7,3 @@ + #include ++#include + diff --git a/srcpkgs/SuperSlicer/patches/tdd-gcode.patch b/srcpkgs/SuperSlicer/patches/tdd-gcode.patch new file mode 100644 index 000000000000..3d9ed1f79260 --- /dev/null +++ b/srcpkgs/SuperSlicer/patches/tdd-gcode.patch @@ -0,0 +1,36 @@ +--- a/src/libslic3r/GCode.cpp ++++ b/src/libslic3r/GCode.cpp +@@ -2073,13 +2073,13 @@ + + // The pipeline elements are joined using const references, thus no copying is performed. + output_stream.find_replace_supress(); +- tbb::filter pipeline_to_layerresult = generator; ++ auto pipeline_to_layerresult = generator; + if (m_spiral_vase) + pipeline_to_layerresult = pipeline_to_layerresult & spiral_vase; +- tbb::filter pipeline_to_string = pipeline_to_layerresult & cooling & fan_mover; ++ auto pipeline_to_string = pipeline_to_layerresult & cooling & fan_mover; + if (m_find_replace) + pipeline_to_string = pipeline_to_string & find_replace; +- tbb::filter full_pipeline = pipeline_to_string & output; ++ auto full_pipeline = pipeline_to_string & output; + tbb::parallel_pipeline(12, full_pipeline); + output_stream.find_replace_enable(); + } +@@ -2147,13 +2147,13 @@ + + // The pipeline elements are joined using const references, thus no copying is performed. + output_stream.find_replace_supress(); +- tbb::filter pipeline_to_layerresult = generator; ++ auto pipeline_to_layerresult = generator; + if (m_spiral_vase) + pipeline_to_layerresult = pipeline_to_layerresult & spiral_vase; +- tbb::filter pipeline_to_string = pipeline_to_layerresult & cooling & fan_mover; ++ auto pipeline_to_string = pipeline_to_layerresult & cooling & fan_mover; + if (m_find_replace) + pipeline_to_string = pipeline_to_string & find_replace; +- tbb::filter full_pipeline = pipeline_to_string & output; ++ auto full_pipeline = pipeline_to_string & output; + tbb::parallel_pipeline(12, full_pipeline); + output_stream.find_replace_enable(); + } diff --git a/srcpkgs/SuperSlicer/template b/srcpkgs/SuperSlicer/template new file mode 100644 index 000000000000..65100eddda99 --- /dev/null +++ b/srcpkgs/SuperSlicer/template @@ -0,0 +1,47 @@ +# Template file for 'SuperSlicer' +pkgname=SuperSlicer +version=2.4.58.5 +revision=1 +wrksrc="SuperSlicer-${version}" +build_style=cmake +build_helper="qemu cmake-wxWidgets-gtk3" +configure_args="-DSLIC3R_WX_STABLE=1 -DSLIC3R_FHS=ON -DSLIC3R_GTK=3 + -DSLIC3R_ENC_CHECK=0 -DUSE_BLOSC=ON -DUSE_EXR=ON -DSLIC3R_ALPHA=OFF + -DCMAKE_BUILD_TYPE=Release" +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 + libpng-devel nlopt-devel openvdb-devel tbb-devel wxWidgets-devel + c-blosc-devel ilmbase-devel libopenexr-devel wxWidgets-gtk3-devel" +short_desc="G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)" +maintainer="Danielle Hutzley " +license="AGPL-3.0-or-later" +homepage="https://github.com/supermerill/SuperSlicer" +distfiles="https://github.com/supermerill/SuperSlicer/archive/refs/tags/${version}.tar.gz + https://github.com/slic3r/slic3r-profiles/archive/refs/heads/main.tar.gz" +checksum="6bfb4198ff009cf1c5109ceb994fc2a701c6add35b5237abb2aec8b561214821 + a1fb0ce0133346f22e71b38072506642d0c3205fc19b9365d4a39876dee15a33" + +post_extract() { + # Move profiles to resources + mv ../slic3r-profiles-*/* resources/profiles/ + + # Mark tests that fail on certain targets + case "$XBPS_TARGET_MACHINE" in + *-musl) + vsed -i tests/libslic3r/test_mutable_priority_queue.cpp \ + -e 's/\(TEST_CASE("Mutable priority queue - first pop", "\[MutableSkipHeapPriorityQueue\]\)\(")\)/\1[!mayfail]\2/' + ;; + i686*) + vsed -i tests/libslic3r/test_voronoi.cpp \ + -e 's/\(TEST_CASE("Voronoi offset 2", "\[VoronoiOffset\]\)\(")\)/\1[!mayfail]\2/' + vsed -i tests/fff_print/test_trianglemesh.cpp \ + -e 's/\(SCENARIO( "make_xxx functions produce meshes."\)\()\)/\1, "[!mayfail]"\2/' + ;; + esac +} + +post_install() { + vinstall ${FILESDIR}/SuperSlicer.desktop 644 usr/share/applications + vlicense LICENSE +}