commit:     2af1afdd76734d65c950a5ead00e81674fb95cca
Author:     Dennis Lamm <expeditioneer <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  4 21:41:40 2020 +0000
Commit:     Dennis Lamm <expeditioneer <AT> gentoo <DOT> org>
CommitDate: Sun Dec  6 12:32:36 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2af1afdd

media-gfx/slic3r-1.3.0: fixed boost 1.73 build

also use system clipper

Bug: https://bugs.gentoo.org/722308
Signed-off-by: Dennis Lamm <expeditioneer <AT> gentoo.org>

 .../slic3r/files/slic3r-1.3.0-boost-1.73.patch     | 146 +++++++++++++++++++++
 .../files/slic3r-1.3.0-use-system-clipper.patch    |  44 +++++++
 media-gfx/slic3r/files/slic3r-1.3.0-wayland.patch  |  10 ++
 ...ic3r-1.3.0-r2.ebuild => slic3r-1.3.0-r3.ebuild} |  38 +++---
 4 files changed, 217 insertions(+), 21 deletions(-)

diff --git a/media-gfx/slic3r/files/slic3r-1.3.0-boost-1.73.patch 
b/media-gfx/slic3r/files/slic3r-1.3.0-boost-1.73.patch
new file mode 100644
index 00000000000..6b710a18f3a
--- /dev/null
+++ b/media-gfx/slic3r/files/slic3r-1.3.0-boost-1.73.patch
@@ -0,0 +1,146 @@
+--- a/xs/src/boost/nowide/cstdlib.hpp
++++ b/xs/src/boost/nowide/cstdlib.hpp
+@@ -8,7 +8,7 @@
+ #ifndef BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
+ #define BOOST_NOWIDE_CSTDLIB_HPP_INCLUDED
+
+-#include <boost/nowide/cenv.hpp>
++#include <boost/nowide/cstdlib.hpp>
+ #include <boost/nowide/system.hpp>
+
+ #endif
+--- a/xs/src/admesh/stl.h
++++ b/xs/src/admesh/stl.h
+@@ -26,11 +26,6 @@
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stddef.h>
+-#include <boost/detail/endian.hpp>
+-
+-#ifndef BOOST_LITTLE_ENDIAN
+-#error "admesh works correctly on little endian machines only!"
+-#endif
+
+ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+     #include "windows.h"
+
+--- a/xs/src/libslic3r/PrintObject.cpp
++++ b/xs/src/libslic3r/PrintObject.cpp
+@@ -2,11 +2,14 @@
+ #include "BoundingBox.hpp"
+ #include "ClipperUtils.hpp"
+ #include "Geometry.hpp"
++#include <boost/bind/bind.hpp>
+ #include <algorithm>
+ #include <vector>
+
+ namespace Slic3r {
+
++using boost::placeholders::_1;
++
+ PrintObject::PrintObject(Print* print, ModelObject* model_object, const 
BoundingBoxf3 &modobj_bbox)
+ :   layer_height_spline(model_object->layer_height_spline),
+     typed_slices(false),
+--- a/xs/src/libslic3r/GCodeSender.hpp
++++ b/xs/src/libslic3r/GCodeSender.hpp
+@@ -7,13 +7,17 @@
+ #include <string>
+ #include <vector>
+ #include <boost/asio.hpp>
+-#include <boost/bind.hpp>
++#include <boost/bind/bind.hpp>
++#include <boost/core/noncopyable.hpp>
+ #include <boost/thread.hpp>
+
+ namespace Slic3r {
+
+ namespace asio = boost::asio;
+
++using boost::placeholders::_1;
++using boost::placeholders::_2;
++
+ class GCodeSender : private boost::noncopyable {
+     public:
+     GCodeSender();
+--- a/xs/src/libslic3r/TriangleMesh.cpp
++++ b/xs/src/libslic3r/TriangleMesh.cpp
+@@ -14,6 +14,7 @@
+ #include <stdexcept>
+ #include <boost/config.hpp>
+ #include <boost/nowide/convert.hpp>
++#include <boost/bind/bind.hpp>
+
+ #ifdef SLIC3R_DEBUG
+ #include "SVG.hpp"
+@@ -21,6 +22,8 @@
+
+ namespace Slic3r {
+
++using boost::placeholders::_1;
++
+ TriangleMesh::TriangleMesh()
+     : repaired(false)
+ {
+--- a/xs/src/libslic3r/Config.cpp
++++ b/xs/src/libslic3r/Config.cpp
+@@ -14,6 +14,7 @@
+ #include <boost/foreach.hpp>
+ #include <boost/lexical_cast.hpp>
+ #include <boost/nowide/cenv.hpp>
++#include <boost/nowide/cstdlib.hpp>
+ #include <boost/nowide/fstream.hpp>
+ #include <boost/property_tree/ini_parser.hpp>
+ #include <boost/property_tree/ptree.hpp>
+--- a/xs/src/libslic3r/SLAPrint.cpp
++++ b/xs/src/libslic3r/SLAPrint.cpp
+@@ -7,9 +7,12 @@
+ #include <iostream>
+ #include <complex>
+ #include <cstdio>
++#include <boost/bind/bind.hpp>
+
+ namespace Slic3r {
+
++using boost::placeholders::_1;
++
+ void
+ SLAPrint::slice()
+ {
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -22,7 +22,7 @@
+ set(Boost_USE_STATIC_LIBS ON)
+ set(Boost_USE_STATIC_RUNTIME ON)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+-find_package(Boost COMPONENTS system thread filesystem)
++find_package(Boost MODULE REQUIRED)
+
+ set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/../xs/src/)
+
+--- a/xs/src/libslic3r/GCodeTimeEstimator.cpp
++++ b/xs/src/libslic3r/GCodeTimeEstimator.cpp
+@@ -1,9 +1,12 @@
+ #include "GCodeTimeEstimator.hpp"
+-#include <boost/bind.hpp>
++#include <boost/bind/bind.hpp>
+ #include <cmath>
+
+ namespace Slic3r {
+
++using boost::placeholders::_1;
++using boost::placeholders::_2;
++
+ void
+ GCodeTimeEstimator::parse(const std::string &gcode)
+ {
+--- a/xs/Build.PL
++++ b/xs/Build.PL
+@@ -142,7 +142,7 @@
+ }
+ # In order to generate the -l switches we need to know how Boost libraries 
are named
+ my $have_boost = 0;
+-my @boost_libraries = qw(system thread filesystem);  # we need these
++my @boost_libraries = qw(system thread filesystem nowide);  # we need these
+ # check without explicit lib path (works on Linux)
+ if (! $mswin) {
+     $have_boost = 1

diff --git a/media-gfx/slic3r/files/slic3r-1.3.0-use-system-clipper.patch 
b/media-gfx/slic3r/files/slic3r-1.3.0-use-system-clipper.patch
new file mode 100644
index 00000000000..9f9a5ef2fbd
--- /dev/null
+++ b/media-gfx/slic3r/files/slic3r-1.3.0-use-system-clipper.patch
@@ -0,0 +1,44 @@
+--- a/xs/src/libslic3r/ClipperUtils.hpp
++++ b/xs/src/libslic3r/ClipperUtils.hpp
+@@ -2,7 +2,7 @@
+ #define slic3r_ClipperUtils_hpp_
+ 
+ #include <libslic3r.h>
+-#include "clipper.hpp"
++#include <polyclipping/clipper.hpp>
+ #include "ExPolygon.hpp"
+ #include "Polygon.hpp"
+ #include "Surface.hpp"
+--- a/xs/src/libslic3r/Geometry.cpp
++++ b/xs/src/libslic3r/Geometry.cpp
+@@ -3,7 +3,7 @@
+ #include "ExPolygon.hpp"
+ #include "Line.hpp"
+ #include "PolylineCollection.hpp"
+-#include "clipper.hpp"
++#include <polyclipping/clipper.hpp>
+ #include <algorithm>
+ #include <cassert>
+ #include <cmath>
+--- a/xs/src/libslic3r/SVG.hpp
++++ b/xs/src/libslic3r/SVG.hpp
+@@ -2,7 +2,7 @@
+ #define slic3r_SVG_hpp_
+ 
+ #include "libslic3r.h"
+-#include "clipper.hpp"
++#include <polyclipping/clipper.hpp>
+ #include "ExPolygon.hpp"
+ #include "Line.hpp"
+ #include "TriangleMesh.hpp"
+--- a/xs/xsp/Clipper.xsp
++++ b/xs/xsp/Clipper.xsp
+@@ -2,7 +2,7 @@
+ 
+ %{
+ #include <xsinit.h>
+-#include "clipper.hpp"
++#include <polyclipping/clipper.hpp>
+ #include "libslic3r/ClipperUtils.hpp"
+ %}
+ 

diff --git a/media-gfx/slic3r/files/slic3r-1.3.0-wayland.patch 
b/media-gfx/slic3r/files/slic3r-1.3.0-wayland.patch
new file mode 100644
index 00000000000..d2dea0208d8
--- /dev/null
+++ b/media-gfx/slic3r/files/slic3r-1.3.0-wayland.patch
@@ -0,0 +1,10 @@
+--- a/slic3r.pl
++++ b/slic3r.pl
+@@ -20,6 +20,7 @@ use Time::HiRes qw(gettimeofday tv_interval);
+ $|++;
+ binmode STDOUT, ':utf8';
+ binmode STDERR, ':utf8';
++$ENV{GDK_BACKEND} = 'x11';
+ 
+ our %opt = ();
+ my %cli_options = ();

diff --git a/media-gfx/slic3r/slic3r-1.3.0-r2.ebuild 
b/media-gfx/slic3r/slic3r-1.3.0-r3.ebuild
similarity index 78%
rename from media-gfx/slic3r/slic3r-1.3.0-r2.ebuild
rename to media-gfx/slic3r/slic3r-1.3.0-r3.ebuild
index 60c8950aab4..5917a9210b8 100644
--- a/media-gfx/slic3r/slic3r-1.3.0-r2.ebuild
+++ b/media-gfx/slic3r/slic3r-1.3.0-r3.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-inherit eutils flag-o-matic perl-module
+inherit desktop eutils perl-module
 
 DESCRIPTION="A mesh slicer to generate G-code for fused-filament-fabrication 
(3D printers)"
 HOMEPAGE="https://slic3r.org";
@@ -17,7 +17,7 @@ RESTRICT="!test? ( test )"
 
 # check Build.PL for dependencies
 RDEPEND="!=dev-lang/perl-5.16*
-       >=dev-libs/boost-1.55[threads]
+       >=dev-libs/boost-1.73[threads]
        dev-perl/Class-XSAccessor
        dev-perl/Devel-CheckLib
        dev-perl/Devel-Size
@@ -53,6 +53,7 @@ RDEPEND="!=dev-lang/perl-5.16*
                x11-libs/libXmu
        )"
 DEPEND="${RDEPEND}
+       dev-libs/clipper
        dev-perl/Devel-CheckLib
        >=dev-perl/ExtUtils-CppGuess-0.70.0
        >=dev-perl/ExtUtils-Typemaps-Default-1.50.0
@@ -64,38 +65,33 @@ DEPEND="${RDEPEND}
        test? ( virtual/perl-Test-Harness
                virtual/perl-Test-Simple )"
 
-S="${WORKDIR}/Slic3r-${PV}/xs"
+S="${WORKDIR}/Slic3r-${PV}"
+PERL_S="${S}/xs"
 
-pkg_pretend() {
-       einfo "Checking for -std=c++11 support in compiler"
-       test-flags-CXX -std=c++11 > /dev/null || die
-}
+PATCHES=(
+       "${FILESDIR}/${P}-boost-1.73.patch"
+       "${FILESDIR}/${P}-no-locallib.patch"
+       "${FILESDIR}/${P}-use-system-clipper.patch"
+       "${FILESDIR}/${P}-wayland.patch"
+)
 
 src_prepare() {
-       pushd "${WORKDIR}/Slic3r-${PV}" || die
        sed -i lib/Slic3r.pm -e "s@FindBin::Bin@FindBin::RealBin@g" || die
-       eapply "${FILESDIR}"/${P}-no-locallib.patch
-       eapply "${FILESDIR}"/${P}-boost.patch
-       eapply_user
-       popd || die
-       # drop std=c++11 to compiler defaults...
-       sed \
-               -e '/c++11/d' \
-               -i Build.PL || die
+       perl-module_src_prepare
 }
 
 src_configure() {
+       cd "${PERL_S}" || die
        SLIC3R_NO_AUTO=1 perl-module_src_configure
 }
 
 src_test() {
+       cd "${PERL_S}" || die
        perl-module_src_test
-       pushd .. || die
-       prove -Ixs/blib/arch -Ixs/blib/lib/ t/ || die "Tests failed"
-       popd || die
 }
 
 src_install() {
+       cd "${PERL_S}" || die
        perl-module_src_install
 
        pushd .. || die
@@ -108,7 +104,7 @@ src_install() {
        exeinto "${VENDOR_LIB}"/Slic3r
        doexe slic3r.pl
 
-       dosym "${VENDOR_LIB}"/Slic3r/slic3r.pl /usr/bin/slic3r.pl
+       dosym "${VENDOR_LIB}/Slic3r/slic3r.pl" "${EPREFIX}/usr/bin/slic3r.pl"
 
        make_desktop_entry "slic3r.pl --gui %F" \
                Slic3r \

Reply via email to