summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Karbowski <slashbeast@gentoo.org>2022-12-27 21:11:19 +0100
committerPiotr Karbowski <slashbeast@gentoo.org>2022-12-27 21:12:28 +0100
commit6a714bb602a25290d2aedf74eb1232fb9efd5979 (patch)
tree50dc53844e29f67ab7285aa52838b5f5ab69a687 /media-gfx/prusaslicer
parentmedia-gfx/superslicer: fix building with boost-1.81. (diff)
downloadgentoo-6a714bb602a25290d2aedf74eb1232fb9efd5979.tar.gz
gentoo-6a714bb602a25290d2aedf74eb1232fb9efd5979.tar.bz2
gentoo-6a714bb602a25290d2aedf74eb1232fb9efd5979.zip
media-gfx/prusaslicer: fix building with boost-1.81.
Patch contributed by Bradley Jarvis. Closes: https://bugs.gentoo.org/887055 Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>
Diffstat (limited to 'media-gfx/prusaslicer')
-rw-r--r--media-gfx/prusaslicer/files/prusaslicer-2.5.0_boost-1.81-std-wxString-to-std-wstring.patch40
-rw-r--r--media-gfx/prusaslicer/prusaslicer-2.5.0-r1.ebuild88
2 files changed, 128 insertions, 0 deletions
diff --git a/media-gfx/prusaslicer/files/prusaslicer-2.5.0_boost-1.81-std-wxString-to-std-wstring.patch b/media-gfx/prusaslicer/files/prusaslicer-2.5.0_boost-1.81-std-wxString-to-std-wstring.patch
new file mode 100644
index 000000000000..1cb0d9f1afff
--- /dev/null
+++ b/media-gfx/prusaslicer/files/prusaslicer-2.5.0_boost-1.81-std-wxString-to-std-wstring.patch
@@ -0,0 +1,40 @@
+--- a/src/slic3r/GUI/PrintHostDialogs.cpp 2022-12-21 10:21:43.583075853 +1100
++++ b/src/slic3r/GUI/PrintHostDialogs.cpp 2022-12-21 10:23:03.902694287 +1100
+@@ -79,8 +79,8 @@ PrintHostSendDialog::PrintHostSendDialog
+ if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos)
+ m_valid_suffix = recent_path.substr(extension_start);
+ // .gcode suffix control
+- auto validate_path = [this](const wxString &path) -> bool {
+- if (! path.Lower().EndsWith(m_valid_suffix.Lower())) {
++ auto validate_path = [this](const std::wstring &path) -> bool {
++ if (! wxString(path).Lower().EndsWith(m_valid_suffix.Lower())) {
+ MessageDialog msg_wingow(this, wxString::Format(_L("Upload filename doesn't end with \"%s\". Do you wish to continue?"), m_valid_suffix), wxString(SLIC3R_APP_NAME), wxYES | wxNO);
+ if (msg_wingow.ShowModal() == wxID_NO)
+ return false;
+@@ -90,7 +90,7 @@ PrintHostSendDialog::PrintHostSendDialog
+
+ auto* btn_ok = add_button(wxID_OK, true, _L("Upload"));
+ btn_ok->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
+- if (validate_path(txt_filename->GetValue())) {
++ if (validate_path(txt_filename->GetValue().ToStdWstring())) {
+ post_upload_action = PrintHostPostUploadAction::None;
+ EndDialog(wxID_OK);
+ }
+@@ -100,7 +100,7 @@ PrintHostSendDialog::PrintHostSendDialog
+ if (post_actions.has(PrintHostPostUploadAction::StartPrint)) {
+ auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print"));
+ btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
+- if (validate_path(txt_filename->GetValue())) {
++ if (validate_path(txt_filename->GetValue().ToStdWstring())) {
+ post_upload_action = PrintHostPostUploadAction::StartPrint;
+ EndDialog(wxID_OK);
+ }
+@@ -111,7 +111,7 @@ PrintHostSendDialog::PrintHostSendDialog
+ // Using wxID_MORE as a button identifier to be different from the other buttons, wxID_MORE has no other meaning here.
+ auto* btn_simulate = add_button(wxID_MORE, false, _L("Upload and Simulate"));
+ btn_simulate->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
+- if (validate_path(txt_filename->GetValue())) {
++ if (validate_path(txt_filename->GetValue().ToStdWstring())) {
+ post_upload_action = PrintHostPostUploadAction::StartSimulation;
+ EndDialog(wxID_OK);
+ }
diff --git a/media-gfx/prusaslicer/prusaslicer-2.5.0-r1.ebuild b/media-gfx/prusaslicer/prusaslicer-2.5.0-r1.ebuild
new file mode 100644
index 000000000000..2e02b49090b4
--- /dev/null
+++ b/media-gfx/prusaslicer/prusaslicer-2.5.0-r1.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+WX_GTK_VER="3.0-gtk3"
+MY_PN="PrusaSlicer"
+MY_PV="$(ver_rs 3 -)"
+
+inherit cmake wxwidgets xdg
+
+DESCRIPTION="A mesh slicer to generate G-code for fused-filament-fabrication (3D printers)"
+HOMEPAGE="https://www.prusa3d.com/prusaslicer/"
+SRC_URI="https://github.com/prusa3d/PrusaSlicer/archive/refs/tags/version_${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="AGPL-3 Boost-1.0 GPL-2 LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RESTRICT="test"
+
+RDEPEND="
+ dev-cpp/eigen:3
+ dev-cpp/tbb:=
+ dev-libs/boost:=[nls]
+ dev-libs/cereal
+ dev-libs/expat
+ dev-libs/glib:2
+ dev-libs/gmp:=
+ dev-libs/mpfr:=
+ >=media-gfx/openvdb-8.2:=
+ net-misc/curl[adns]
+ media-libs/glew:0=
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:0=
+ media-libs/qhull:=
+ sci-libs/libigl
+ sci-libs/nlopt
+ =sci-libs/opencascade-7.6*:=
+ >=sci-mathematics/cgal-5.0:=
+ sys-apps/dbus
+ sys-libs/zlib:=
+ virtual/opengl
+ x11-libs/gtk+:3
+ x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
+"
+DEPEND="${RDEPEND}
+ media-libs/qhull[static-libs]
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.5.0_alpha2-boost-fixes.patch"
+ "${FILESDIR}/${PN}-2.5.0_rc1-cereal-1.3.1.patch"
+ "${FILESDIR}/${PN}-2.5.0_rc1-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.5.0_boost-1.81-std-wxString-to-std-wstring.patch"
+)
+
+S="${WORKDIR}/${MY_PN}-version_${MY_PV}"
+
+src_prepare() {
+ sed -i -e 's/PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN/PrusaSlicer-${SLIC3R_VERSION}+Gentoo/g' version.inc || die
+
+ sed -i -e 's/find_package(OpenCASCADE 7.6.2 REQUIRED)/find_package(OpenCASCADE REQUIRED)/g' \
+ src/occt_wrapper/CMakeLists.txt || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ CMAKE_BUILD_TYPE="Release"
+
+ setup-wxwidgets
+
+ local mycmakeargs=(
+ -DOPENVDB_FIND_MODULE_PATH="/usr/$(get_libdir)/cmake/OpenVDB"
+
+ -DSLIC3R_BUILD_TESTS=$(usex test)
+ -DSLIC3R_FHS=ON
+ -DSLIC3R_GTK=3
+ -DSLIC3R_GUI=ON
+ -DSLIC3R_PCH=OFF
+ -DSLIC3R_STATIC=OFF
+ -DSLIC3R_WX_STABLE=ON
+ -Wno-dev
+ )
+
+ cmake_src_configure
+}