diff --git a/testing/prusa-slicer/6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6.patch b/testing/prusa-slicer/6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6d20275c682722431fd95424dc5a88d01d5a22c --- /dev/null +++ b/testing/prusa-slicer/6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6.patch @@ -0,0 +1,43 @@ +From 6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6 Mon Sep 17 00:00:00 2001 +From: Filip Sykala <filip.sykala@prusa3d.cz> +Date: Fri, 6 May 2022 13:37:35 +0200 +Subject: [PATCH] Fix mismatch of data types. Separate checks. + +--- + tests/libslic3r/test_mutable_priority_queue.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/libslic3r/test_mutable_priority_queue.cpp b/tests/libslic3r/test_mutable_priority_queue.cpp +index 40ed5a1586..3e99eef08a 100644 +--- a/tests/libslic3r/test_mutable_priority_queue.cpp ++++ b/tests/libslic3r/test_mutable_priority_queue.cpp +@@ -343,7 +343,7 @@ TEST_CASE("Mutable priority queue - reshedule first", "[MutableSkipHeapPriorityQ + TEST_CASE("Mutable priority queue - first pop", "[MutableSkipHeapPriorityQueue]") + { + struct MyValue{ +- int id; ++ size_t id; + float val; + }; + size_t count = 50000; +@@ -356,15 +356,15 @@ TEST_CASE("Mutable priority queue - first pop", "[MutableSkipHeapPriorityQueue]" + [](MyValue &l, MyValue &r) { return l.val < r.val; }); + q.reserve(count); + for (size_t id = 0; id < count; id++) { +- MyValue mv; +- mv.id = id; +- mv.val = rand(); ++ MyValue mv{ id, rand()}; + q.push(mv); + } + MyValue it = q.top(); // copy + q.pop(); +- bool valid = (it.id != 0) && (idxs[0] < 3 * count); +- CHECK(valid); ++ // is valid id (no initial value default value) ++ CHECK(it.id != 0); ++ // is first item in queue valid value ++ CHECK(idxs[0] != std::numeric_limits<size_t>::max()); + } + + TEST_CASE("Mutable priority queue complex", "[MutableSkipHeapPriorityQueue]") diff --git a/testing/prusa-slicer/APKBUILD b/testing/prusa-slicer/APKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..9039f427ebc991cee5392ad3083a249bcaa29b7c --- /dev/null +++ b/testing/prusa-slicer/APKBUILD @@ -0,0 +1,78 @@ +# Contributor: Clayton Craft <clayton@craftyguy.net> +# Maintainer: Clayton Craft <clayton@craftyguy.net> +pkgname=prusa-slicer +pkgver=2.4.2 +pkgrel=0 +pkgdesc="g-code generator for 3D printers" +url="https://github.com/prusa3d/PrusaSlicer" +arch="all !armhf !armv7 !ppc64le !s390x !x86 " # no openvdb +license="AGPL-3.0" +makedepends=" + boost-dev + cereal + cgal-dev + cmake + curl-dev + dbus-dev + expat-dev + glew-dev + gmp-dev + ilmbase-dev + libpng-dev + libtbb-dev + mesa-dev + mpfr-dev + nlopt-dev + openvdb-dev + openvdb-tools + samurai + wxgtk3-dev + " +subpackages="$pkgname-doc" +source=" + https://github.com/prusa3d/PrusaSlicer/archive/refs/tags/version_$pkgver.tar.gz + unistd.patch + use-namespaces-to-link-against-libcereal.patch + fix-buildbwith-boost-1.77.patch + 6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6.patch + " +builddir="$srcdir/PrusaSlicer-version_$pkgver" + +build() { + + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DSLIC3R_FHS=1 \ + -DSLIC3R_GTK=3 \ + -DSLIC3R_STATIC=0 \ + -DSLIC3R_WX_STABLE=1 \ + -DSLIC3R_PCH=0 \ + -DwxWidgets_CONFIG_EXECUTABLE=$(which wx-config-gtk3) \ + $CMAKE_CROSSOPTS . + + cmake --build build +} + +check() { + cd build + CTEST_OUTPUT_ON_FAILURE=TRUE ctest +} + +package() { + DESTDIR="$pkgdir" ninja -C build install +} + +sha512sums=" +d480c608eadb58b53ee220317a749c0363db580759322ed7a9aebe2ea5c1acc30dbd3bdf9ed9849c23ba5c125ee6f923de6ac01987bf85abf7aeb3f91c2ae23f version_2.4.2.tar.gz +462d821f11d6dca97574fe1da7e22a924755a2fc1dc9df7bd295af3e9cf748b8649952baee5072cc97165f1a5f3d6c3089be08526bd296da95763715ceb42ecb unistd.patch +b9d44476278520d46687cadfaf14c3664f6f914a1620124ab49c0cdf4762dcd7941a6c5052e4798345e721d0490960f14ecd79c811f486601c54038a57eb6d93 use-namespaces-to-link-against-libcereal.patch +ccfc641cc5d458ebf7eca8aaa99c99fb866be27cd80bb82d413aea92749d0760b564702403623a6ee70aeeab7b87942d36356ddcf6edfba33ee71e9c13a6c862 fix-buildbwith-boost-1.77.patch +ec4bdd15b6b33a261e76345aa98cb4e88d8644f33c27e633bf3599b63c8863720ea8baa10c0eca2b3557ca405c5130f5414da79e1e844c11db4286ce3f537fe5 6ab517187fa5f3a8e2b87a59b6a50f26b3a49da6.patch +" diff --git a/testing/prusa-slicer/fix-buildbwith-boost-1.77.patch b/testing/prusa-slicer/fix-buildbwith-boost-1.77.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a4c671b77c0d1537d70efebcb72a3fd9b1f0ae0 --- /dev/null +++ b/testing/prusa-slicer/fix-buildbwith-boost-1.77.patch @@ -0,0 +1,29 @@ +From 47284ec0228925ef0a6f7edc6a9ef588677ed146 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 28 Aug 2021 21:00:30 +0100 +Subject: [PATCH] Fix build with Boost 1.77 (missing include) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We're relying on boost::geometry so we need to include the "main" +header for it. + +Fixes errors like: +error: ‘boost::geometry::strategy::disjoint’ has not been declared + +Bug: https://bugs.gentoo.org/808771 +--- + src/libslic3r/SLA/Clustering.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/libslic3r/SLA/Clustering.cpp b/src/libslic3r/SLA/Clustering.cpp +index 41ff1d4f09..6d909951eb 100644 +--- a/src/libslic3r/SLA/Clustering.cpp ++++ b/src/libslic3r/SLA/Clustering.cpp +@@ -1,4 +1,5 @@ + #include "Clustering.hpp" ++#include "boost/geometry.hpp" + #include "boost/geometry/index/rtree.hpp" + + #include <libslic3r/SLA/SpatIndex.hpp> diff --git a/testing/prusa-slicer/unistd.patch b/testing/prusa-slicer/unistd.patch new file mode 100644 index 0000000000000000000000000000000000000000..f1370458a5f5bf67513fd544cd9992b69dd95f7f --- /dev/null +++ b/testing/prusa-slicer/unistd.patch @@ -0,0 +1,13 @@ +diff --git a/src/slic3r/Utils/Serial.cpp b/src/slic3r/Utils/Serial.cpp +index 4db1acc..8181065 100644 +--- a/src/slic3r/Utils/Serial.cpp ++++ b/src/slic3r/Utils/Serial.cpp +@@ -45,7 +45,7 @@ + #ifndef _WIN32 + #include <sys/ioctl.h> + #include <sys/time.h> +- #include <sys/unistd.h> ++ #include <unistd.h> + #include <sys/select.h> + #endif + diff --git a/testing/prusa-slicer/use-namespaces-to-link-against-libcereal.patch b/testing/prusa-slicer/use-namespaces-to-link-against-libcereal.patch new file mode 100644 index 0000000000000000000000000000000000000000..ffd6c736611e55d69f9e376e44c582d2023f41a1 --- /dev/null +++ b/testing/prusa-slicer/use-namespaces-to-link-against-libcereal.patch @@ -0,0 +1,66 @@ +From ac486108bdc7ca0548b5d8bb696fa382d68d1801 Mon Sep 17 00:00:00 2001 +From: Yuri D'Elia <wavexx@thregr.org> +Date: Mon, 24 Jan 2022 20:21:24 +0100 +Subject: [PATCH] Use namespaces to link against libcereal >= 1.3.1 + +Create an alias for previous versions. +--- + CMakeLists.txt | 3 +++ + src/CMakeLists.txt | 2 +- + src/libslic3r/CMakeLists.txt | 2 +- + src/slic3r/CMakeLists.txt | 2 +- + 4 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a37e7a1b92..42d0693bc7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -474,6 +474,9 @@ endif () + + # Find the Cereal serialization library + find_package(cereal REQUIRED) ++if (NOT TARGET cereal::cereal) ++ add_library(cereal::cereal ALIAS cereal) ++endif () + + # l10n + set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9e89e82f67..9adeb94eea 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -125,7 +125,7 @@ if (NOT WIN32 AND NOT APPLE) + set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer") + endif () + +-target_link_libraries(PrusaSlicer libslic3r cereal) ++target_link_libraries(PrusaSlicer libslic3r cereal::cereal) + 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 99d010d9c7..2abb3ae5b4 100644 +--- a/src/libslic3r/CMakeLists.txt ++++ b/src/libslic3r/CMakeLists.txt +@@ -337,7 +337,7 @@ target_include_directories(libslic3r PUBLIC ${EXPAT_INCLUDE_DIRS}) + target_link_libraries(libslic3r + libnest2d + admesh +- cereal ++ cereal::cereal + libigl + miniz + boost_libs +diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt +index 34cc980513..50c5fcabc4 100644 +--- a/src/slic3r/CMakeLists.txt ++++ b/src/slic3r/CMakeLists.txt +@@ -260,7 +260,7 @@ add_library(libslic3r_gui STATIC ${SLIC3R_GUI_SOURCES}) + + 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 cereal::cereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES}) + + if (MSVC) + target_link_libraries(libslic3r_gui Setupapi.lib)