From ddd3cc90514a49692ed8c06b4aedf87402bdd1cf Mon Sep 17 00:00:00 2001 From: Dennis Lamm Date: Tue, 15 Dec 2020 19:03:30 +0100 Subject: [PATCH] media-gfx/prusaslicer: added new ebuild Closes: https://bugs.gentoo.org/652100 Signed-off-by: Dennis Lamm Closes: https://github.com/gentoo/gentoo/pull/18668 Signed-off-by: Dennis Lamm --- media-gfx/prusaslicer/Manifest | 1 + .../files/PrusaGcodeviewer.desktop | 9 +++ .../prusaslicer/files/PrusaSlicer.desktop | 12 +++ .../files/prusaslicer-2.2.0-atomic.patch | 10 +++ .../files/prusaslicer-2.2.0-boost-1.73.patch | 60 ++++++++++++++ media-gfx/prusaslicer/metadata.xml | 19 +++++ .../prusaslicer/prusaslicer-2.2.0.ebuild | 79 +++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 media-gfx/prusaslicer/Manifest create mode 100644 media-gfx/prusaslicer/files/PrusaGcodeviewer.desktop create mode 100644 media-gfx/prusaslicer/files/PrusaSlicer.desktop create mode 100644 media-gfx/prusaslicer/files/prusaslicer-2.2.0-atomic.patch create mode 100644 media-gfx/prusaslicer/files/prusaslicer-2.2.0-boost-1.73.patch create mode 100644 media-gfx/prusaslicer/metadata.xml create mode 100644 media-gfx/prusaslicer/prusaslicer-2.2.0.ebuild diff --git a/media-gfx/prusaslicer/Manifest b/media-gfx/prusaslicer/Manifest new file mode 100644 index 0000000000000..ac05bb7cb7d37 --- /dev/null +++ b/media-gfx/prusaslicer/Manifest @@ -0,0 +1 @@ +DIST prusaslicer-2.2.0.tar.gz 30811929 BLAKE2B cde004add53ee025728d566cb7331cb7b1eac5412e9ad3bee037d13277c24dcdc6024c91f09bb9ef0653a12a3ee7c5cb5cec21e2a00825d185472ea7036e08f5 SHA512 5c8dc5b581e04208a1ae53771ef2607da189ee85aadf501ce1480008f5a6ddb10bb528ddc2608d3f04acd26c583ff895ad4148d6a1397f002292e20098971e1d diff --git a/media-gfx/prusaslicer/files/PrusaGcodeviewer.desktop b/media-gfx/prusaslicer/files/PrusaGcodeviewer.desktop new file mode 100644 index 0000000000000..4b73cc905c6ce --- /dev/null +++ b/media-gfx/prusaslicer/files/PrusaGcodeviewer.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Prusa GCode viewer +Exec=prusa-slicer --gcodeviewer %F +Icon=PrusaSlicer +Terminal=false +Type=Application +MimeType=text/x.gcode; +Categories=Graphics;3DGraphics; +Keywords=3D;Printing;Slicer; diff --git a/media-gfx/prusaslicer/files/PrusaSlicer.desktop b/media-gfx/prusaslicer/files/PrusaSlicer.desktop new file mode 100644 index 0000000000000..dae507b54abb5 --- /dev/null +++ b/media-gfx/prusaslicer/files/PrusaSlicer.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=PrusaSlicer +GenericName=3D Printing Software +Icon=PrusaSlicer +Exec=prusa-slicer %F +Terminal=false +Type=Application +MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; +Categories=Graphics;3DGraphics;Engineering; +Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA +StartupNotify=false +StartupWMClass=prusa-slicer \ No newline at end of file diff --git a/media-gfx/prusaslicer/files/prusaslicer-2.2.0-atomic.patch b/media-gfx/prusaslicer/files/prusaslicer-2.2.0-atomic.patch new file mode 100644 index 0000000000000..4319ad0f14632 --- /dev/null +++ b/media-gfx/prusaslicer/files/prusaslicer-2.2.0-atomic.patch @@ -0,0 +1,10 @@ +--- a/src/slic3r/GUI/Mouse3DController.hpp ++++ b/src/slic3r/GUI/Mouse3DController.hpp +@@ -8,6 +8,7 @@ + + #include "hidapi.h" + ++#include + #include + #include + #include diff --git a/media-gfx/prusaslicer/files/prusaslicer-2.2.0-boost-1.73.patch b/media-gfx/prusaslicer/files/prusaslicer-2.2.0-boost-1.73.patch new file mode 100644 index 0000000000000..50abea11b3284 --- /dev/null +++ b/media-gfx/prusaslicer/files/prusaslicer-2.2.0-boost-1.73.patch @@ -0,0 +1,60 @@ +--- a/src/admesh/stlinit.cpp ++++ b/src/admesh/stlinit.cpp +@@ -28,7 +28,6 @@ + + #include + #include +-#include + + #include "stl.h" + +@@ -36,9 +35,9 @@ + #error "SEEK_SET not defined" + #endif + +-#ifndef BOOST_LITTLE_ENDIAN ++#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + extern void stl_internal_reverse_quads(char *buf, size_t cnt); +-#endif /* BOOST_LITTLE_ENDIAN */ ++#endif /* __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ */ + + static FILE* stl_open_count_facets(stl_file *stl, const char *file) + { +@@ -89,10 +88,10 @@ + // Read the int following the header. This should contain # of facets. + uint32_t header_num_facets; + bool header_num_faces_read = fread(&header_num_facets, sizeof(uint32_t), 1, fp) != 0; +-#ifndef BOOST_LITTLE_ENDIAN ++#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + // Convert from little endian to big endian. + stl_internal_reverse_quads((char*)&header_num_facets, 4); +-#endif /* BOOST_LITTLE_ENDIAN */ ++#endif /* __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ */ + if (! header_num_faces_read || num_facets != header_num_facets) + BOOST_LOG_TRIVIAL(info) << "stl_open_count_facets: Warning: File size doesn't match number of facets in the header: " << file; + } +@@ -158,10 +157,10 @@ + // Read a single facet from a binary .STL file. We assume little-endian architecture! + if (fread(&facet, 1, SIZEOF_STL_FACET, fp) != SIZEOF_STL_FACET) + return false; +-#ifndef BOOST_LITTLE_ENDIAN ++#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + // Convert the loaded little endian data to big endian. + stl_internal_reverse_quads((char*)&facet, 48); +-#endif /* BOOST_LITTLE_ENDIAN */ ++#endif /* __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ */ + } else { + // Read a single facet from an ASCII .STL file + // skip solid/endsolid + +--- a/CMakeLists.txt (revision 3b2c51fd5ab04a72592bfdba1cd39cd6298b66c2) ++++ b/CMakeLists.txt (date 1607811414000) +@@ -260,7 +260,7 @@ + # set(Boost_COMPILER "-mgw81") + if(NOT WIN32) + # boost::process was introduced first in version 1.64.0 +- set(MINIMUM_BOOST_VERSION "1.64.0") ++ set(MINIMUM_BOOST_VERSION "1.72.0") + endif() + set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time") + find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components}) diff --git a/media-gfx/prusaslicer/metadata.xml b/media-gfx/prusaslicer/metadata.xml new file mode 100644 index 0000000000000..0d7a4d353499f --- /dev/null +++ b/media-gfx/prusaslicer/metadata.xml @@ -0,0 +1,19 @@ + + + + + 3dprint@gentoo.org + Gentoo 3D Printer Project + + + PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for FFF printers or PNG + layers for mSLA 3D printers. It's compatible with any modern printer based on the RepRap toolchain, including + all those based on the Marlin, Prusa, Sprinter and Repetier firmware. It also works with Mach3, LinuxCNC and + Machinekit controllers. + + PrusaSlicer is based on Slic3r by Alessandro Ranellucci and the RepRap community. + + + prusa3d/PrusaSlicer + + diff --git a/media-gfx/prusaslicer/prusaslicer-2.2.0.ebuild b/media-gfx/prusaslicer/prusaslicer-2.2.0.ebuild new file mode 100644 index 0000000000000..24f2f870cb8df --- /dev/null +++ b/media-gfx/prusaslicer/prusaslicer-2.2.0.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +WX_GTK_VER="3.0-gtk3" + +inherit cmake desktop wxwidgets xdg-utils + +MY_PN="PrusaSlicer" + +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/${MY_PN}/archive/version_${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="AGPL-3 CC-BY-3.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="gui test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-cpp/eigen:3 + dev-cpp/tbb + >=dev-libs/boost-1.73.0[threads] + dev-libs/cereal + dev-libs/expat + dev-libs/miniz + media-libs/glew:0= + media-libs/qhull + >=media-gfx/openvdb-5.0.0 + net-misc/curl + >=sci-mathematics/cgal-5.0 + sci-libs/libigl + sci-libs/nlopt + sys-libs/zlib + x11-libs/wxGTK:${WX_GTK_VER}[X] + " +DEPEND="${RDEPEND}" + +S="${WORKDIR}/PrusaSlicer-version_${PV}" +PATCHES=( + "${FILESDIR}/${P}-atomic.patch" + "${FILESDIR}/${P}-boost-1.73.patch" +) + +src_prepare() { + setup-wxwidgets + cmake_src_prepare +} + +src_configure() { + CMAKE_BUILD_TYPE=Release + + local mycmakeargs=( + -DSLIC3R_BUILD_TESTS=$(usex test) + -DSLIC3R_FHS=1 + -DSLIC3R_GUI=$(usex gui) + -DSLIC3R_PCH=0 + -SLIC3R_STATIC=0 + -DSLIC3R_WX_STABLE=1 + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + doicon resources/icons/PrusaSlicer.png || die + domenu "${FILESDIR}/PrusaGcodeviewer.desktop" || die + domenu "${FILESDIR}/PrusaSlicer.desktop" || die +} + +pkg_postinst() { + xdg_mimeinfo_database_update + xdg_desktop_database_update +}