[packages/slic3r] - up to stable 1.2.9
arekm
arekm at pld-linux.org
Sun Jun 21 17:36:31 CEST 2015
commit 987c20e0dd717baf279e8d60fcdabd555d7239a9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Jun 21 17:36:03 2015 +0200
- up to stable 1.2.9
slic3r-admesh.patch | 12 ----
slic3r-clear-error.patch | 36 -----------
slic3r-linker.patch | 47 +++++++-------
slic3r-nowarn-datadir.patch | 20 +++---
slic3r-poly2tri-c.patch | 12 ++++
slic3r-test-out-of-memory.patch | 138 ----------------------------------------
slic3r.spec | 53 +++++++++------
7 files changed, 77 insertions(+), 241 deletions(-)
---
diff --git a/slic3r.spec b/slic3r.spec
index a32563c..53478b7 100644
--- a/slic3r.spec
+++ b/slic3r.spec
@@ -1,17 +1,28 @@
+#
%bcond_without tests
+# Don't turn on systems if test suite fails.
+# Test suite works fine with bundled libs, so the only way
+# to turn on system libs is to make sure test suite works
+# with them, too.
+%bcond_without system_admesh
%bcond_with system_poly2tri
+%bcond_with system_polyclipping
+#
+%define admesh_ver 0.98.1
+%define perl_encode_locale_ver 1.05
+%define perl_threads_ver 2.00
#
%include /usr/lib/rpm/macros.perl
Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
Name: slic3r
-Version: 1.2.8
+Version: 1.2.9
Release: 1
License: AGPLv3 and CC-BY
# Images are CC-BY, code is AGPLv3
Group: Applications/Engineering
URL: http://slic3r.org/
Source0: https://github.com/alexrj/Slic3r/archive/%{version}.tar.gz
-# Source0-md5: 8b9902eb089d5ce59b25a2c9b711ec69
+# Source0-md5: 05ac7b137cbb7b12f442776e4c12dcc2
Source1: %{name}.desktop
Source2: %{name}.appdata.xml
# Modify Build.PL so we are able to build this on Fedora
@@ -22,12 +33,9 @@ Patch0: %{name}-buildpl.patch
Patch1: %{name}-nowarn-datadir.patch
Patch2: %{name}-english-locale.patch
Patch3: %{name}-linker.patch
-Patch4: %{name}-clear-error.patch
-Patch5: %{name}-test-out-of-memory.patch
-Patch6: %{name}-clipper.patch
-Patch7: %{name}-admesh.patch
+Patch4: %{name}-clipper.patch
+Patch5: %{name}-poly2tri-c.patch
BuildRequires: ImageMagick
-BuildRequires: admesh-devel >= 0.98.1
BuildRequires: boost-devel
BuildRequires: desktop-file-utils
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.80
@@ -40,7 +48,7 @@ BuildRequires: perl(Math::PlanePath) >= 53
BuildRequires: perl(Module::Build::WithXSpp) >= 0.14
BuildRequires: perl(Moo) >= 1.003001
BuildRequires: perl-Class-XSAccessor
-BuildRequires: perl-Encode-Locale
+BuildRequires: perl-Encode-Locale >= %{perl_encode_locale_ver}
BuildRequires: perl-ExtUtils-Typemap
BuildRequires: perl-IO-stringy
BuildRequires: perl-Math-ConvexHull-MonotoneChain
@@ -50,11 +58,16 @@ BuildRequires: perl-XML-SAX
BuildRequires: perl-XML-SAX-ExpatXS
BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: perl-modules
+BuildRequires: perl-threads >= %{perl_threads_ver}
%{?with_system_poly2tri:BuildRequires: poly2tri-devel}
-BuildRequires: polyclipping-devel >= 6.2.0
+%{?with_system_polyclipping:BuildRequires: polyclipping-devel >= 6.2.9}
BuildRequires: rpm-perlprov >= 4.1-13
-Requires: admesh-libs >= 0.97.5
-Requires: perl-threads >= 2.00
+%if %{with system_admesh}
+BuildRequires: admesh-devel >= %{admesh_ver}
+Requires: admesh-libs >= %{admesh_ver}
+%endif
+Requires: perl-Encode-Locale >= %{perl_encode_locale_ver}
+Requires: perl-threads >= %{perl_threads_ver}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -69,23 +82,21 @@ more information.
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%if %{with system_poly2tri}
%patch3 -p1
-%else
-%patch7 -p1
-%endif
-#%patch4 -p1
-#%patch5 -p1
-%patch6 -p1
+%{?with_system_polyclipping:%patch4 -p1}
+%{?with_system_poly2tri:%patch5 -p1}
# Remove bundled admesh, clipper, poly2tri and boost
-rm -rf xs/src/admesh
-rm xs/src/clipper.*pp
-%{?with_system_poly2tri:rm -rf xs/src/poly2tri}
+%{?with_system_admesh:rm -rf xs/src/admesh}
+%{?with_system_polyclipping:rm xs/src/clipper.*pp}
+%{?with_system_poly2tri:rm -r xs/src/poly2tri}
rm -rf xs/src/boost
%build
cd xs
+%{?with_system_admesh:SYSTEM_ADMESH=1} \
+%{?with_system_polyclipping:SYSTEM_POLYCLIPPING=1} \
+%{?with_system_poly2tri:SYSTEM_POLY2TRI=1} \
%{__perl} ./Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS"
./Build
cd ..
diff --git a/slic3r-admesh.patch b/slic3r-admesh.patch
deleted file mode 100644
index 2144d87..0000000
--- a/slic3r-admesh.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- Slic3r-1.2.7/xs/Build.PL~ 2015-05-24 17:39:27.000000000 +0200
-+++ Slic3r-1.2.7/xs/Build.PL 2015-06-09 23:58:15.464105918 +0200
-@@ -41,6 +41,9 @@
- Module::Build::WithXSpp 0.13
- )},
- extra_compiler_flags => \@cflags,
-+ extra_linker_flags => [qw(
-+ -ladmesh
-+ -lpolyclipping)],
-
- # Provides extra C typemaps that are auto-merged
- extra_typemap_modules => {
diff --git a/slic3r-clear-error.patch b/slic3r-clear-error.patch
deleted file mode 100644
index 25599fb..0000000
--- a/slic3r-clear-error.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp
-index dc47832..14e9449 100644
---- a/xs/src/libslic3r/TriangleMesh.cpp
-+++ b/xs/src/libslic3r/TriangleMesh.cpp
-@@ -29,6 +29,7 @@ TriangleMesh::TriangleMesh(const TriangleMesh &other)
- {
- this->stl.heads = NULL;
- this->stl.tail = NULL;
-+ this->stl.error = other.stl.error;
- if (other.stl.facet_start != NULL) {
- this->stl.facet_start = (stl_facet*)calloc(other.stl.stats.number_of_facets, sizeof(stl_facet));
- std::copy(other.stl.facet_start, other.stl.facet_start + other.stl.stats.number_of_facets, this->stl.facet_start);
-@@ -125,6 +126,7 @@ TriangleMesh::repair() {
- // fill_holes
- if (stl.stats.connected_facets_3_edge < stl.stats.number_of_facets) {
- stl_fill_holes(&stl);
-+ stl_clear_error(&stl);
- }
-
- // normal_directions
-@@ -248,6 +250,7 @@ TriangleMesh::split() const
- mesh->stl.stats.type = inmemory;
- mesh->stl.stats.number_of_facets = facets.size();
- mesh->stl.stats.original_num_facets = mesh->stl.stats.number_of_facets;
-+ stl_clear_error(&mesh->stl);
- stl_allocate(&mesh->stl);
-
- int first = 1;
-@@ -349,6 +352,7 @@ TriangleMesh::to_SV() {
-
- void TriangleMesh::ReadFromPerl(SV* vertices, SV* facets)
- {
-+ stl.error = 0;
- stl.stats.type = inmemory;
-
- // count facets and allocate memory
diff --git a/slic3r-linker.patch b/slic3r-linker.patch
index ebe52a0..4ca6306 100644
--- a/slic3r-linker.patch
+++ b/slic3r-linker.patch
@@ -1,27 +1,30 @@
-diff --git a/xs/Build.PL b/xs/Build.PL
-index 5a10ac0..18d0611 100644
---- a/xs/Build.PL
-+++ b/xs/Build.PL
-@@ -41,6 +41,10 @@ my $build = Module::Build::WithXSpp->new(
+diff -urN Slic3r-1.2.9.org/xs/Build.PL Slic3r-1.2.9/xs/Build.PL
+--- Slic3r-1.2.9.org/xs/Build.PL 2015-06-17 10:38:28.000000000 +0200
++++ Slic3r-1.2.9/xs/Build.PL 2015-06-21 16:51:02.208189103 +0200
+@@ -14,6 +14,18 @@
+ # only on newer GCCs: -ftemplate-backtrace-limit=0
+ push @cflags, qw(-DSLIC3R_DEBUG -g);
+ }
++my @libs;
++if ($ENV{SYSTEM_ADMESH}) {
++ push @libs, qw(-ladmesh);
++}
++if ($ENV{SYSTEM_POLYCLIPPING}) {
++ push @libs, qw(-polyclipping);
++}
++if ($ENV{SYSTEM_POLY2TRI}) {
++ push @cflags, `pkg-config --cflags poly2tri-c`;
++ push @libs, `pkg-config --libs poly2tri-c`;
++}
++
+ if (ExtUtils::CppGuess->new->is_gcc) {
+ # check whether we're dealing with a buggy GCC version
+ # see https://github.com/alexrj/Slic3r/issues/1965
+@@ -41,6 +53,7 @@
Module::Build::WithXSpp 0.13
)},
-- extra_compiler_flags => \@cflags,
-+ extra_compiler_flags => [ @cflags, scalar `pkg-config --cflags poly2tri-c` ],
-+ extra_linker_flags => [qw(
-+ -ladmesh
-+ -lpolyclipping
-+ ), `pkg-config --libs poly2tri-c`],
+ extra_compiler_flags => \@cflags,
++ extra_linker_flags => \@libs,
# Provides extra C typemaps that are auto-merged
extra_typemap_modules => {
---- Slic3r-1.2.7/xs/src/libslic3r/ExPolygon.cpp~ 2015-05-24 17:39:27.000000000 +0200
-+++ Slic3r-1.2.7/xs/src/libslic3r/ExPolygon.cpp 2015-06-09 23:27:31.805045989 +0200
-@@ -5,7 +5,7 @@
- #include "Line.hpp"
- #include "ClipperUtils.hpp"
- #include "polypartition.h"
--#include "poly2tri/poly2tri.h"
-+#include "poly2tri-c/p2t/poly2tri.h"
-
- #include <algorithm>
- #include <list>
diff --git a/slic3r-nowarn-datadir.patch b/slic3r-nowarn-datadir.patch
index 74f2771..6f1bf50 100644
--- a/slic3r-nowarn-datadir.patch
+++ b/slic3r-nowarn-datadir.patch
@@ -1,15 +1,11 @@
---- Slic3r-1.2.6/lib/Slic3r.pm~ 2015-02-01 15:47:29.000000000 +0100
-+++ Slic3r-1.2.6/lib/Slic3r.pm 2015-05-15 11:24:02.024661971 +0200
-@@ -26,11 +26,8 @@
- $have_threads = 0 if $Moo::VERSION == 1.003000;
- }
+--- Slic3r-1.2.9/lib/Slic3r.pm~ 2015-06-17 10:38:28.000000000 +0200
++++ Slic3r-1.2.9/lib/Slic3r.pm 2015-06-17 18:14:18.542476760 +0200
+@@ -30,7 +30,7 @@ warn "Running Slic3r under Perl 5.16 is
+ if $^V == v5.16;
--warn "Running Slic3r under Perl 5.16 is not supported nor recommended\n"
-- if $^V == v5.16;
--
use FindBin;
--our $var = "$FindBin::Bin/var";
-+our $var = "/usr/share/slic3r";
+-our $var = decode_path($FindBin::Bin) . "/var";
++our $var = '/usr/share/slic3r';
+
+ use Moo 1.003001;
- use Encode;
- use Encode::Locale;
diff --git a/slic3r-poly2tri-c.patch b/slic3r-poly2tri-c.patch
new file mode 100644
index 0000000..7d067e9
--- /dev/null
+++ b/slic3r-poly2tri-c.patch
@@ -0,0 +1,12 @@
+--- Slic3r-1.2.7/xs/src/libslic3r/ExPolygon.cpp~ 2015-05-24 17:39:27.000000000 +0200
++++ Slic3r-1.2.7/xs/src/libslic3r/ExPolygon.cpp 2015-06-09 23:27:31.805045989 +0200
+@@ -5,7 +5,7 @@
+ #include "Line.hpp"
+ #include "ClipperUtils.hpp"
+ #include "polypartition.h"
+-#include "poly2tri/poly2tri.h"
++#include <poly2tri-c/p2t/poly2tri.h>
+
+ #include <algorithm>
+ #include <list>
+
diff --git a/slic3r-test-out-of-memory.patch b/slic3r-test-out-of-memory.patch
deleted file mode 100644
index 63e83b6..0000000
--- a/slic3r-test-out-of-memory.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From: Alessandro Ranellucci <aar at cpan.org>
-Date: Wed, 25 Jun 2014 14:57:06 +0200
-Subject: Fix compilation under 5.20 (untested). #2109
-
-Bug-Debian: #757798
-Bug: https://github.com/alexrj/Slic3r/issues/2109
-Origin: commit:67bf99633e48f9c8a5863b88c2a03fddc1cc247f
----
- xs/Build.PL | 2 +-
- xs/src/ClipperUtils.cpp | 2 +-
- xs/src/MultiPoint.cpp | 4 ++--
- xs/xsp/TriangleMesh.xsp | 6 ++++--
- xs/xsp/my.map | 17 +++++++++++------
- 5 files changed, 19 insertions(+), 12 deletions(-)
-
-diff --git a/xs/Build.PL b/xs/Build.PL
-index e21df5e..49195d7 100644
---- a/xs/Build.PL
-+++ b/xs/Build.PL
-@@ -30,7 +30,7 @@ my $build = Module::Build::WithXSpp->new(
- build_requires => {qw(
- ExtUtils::ParseXS 3.18
- ExtUtils::Typemap 1.00
-- ExtUtils::Typemaps::Default 1.03
-+ ExtUtils::Typemaps::Default 1.05
- ExtUtils::XSpp 0.17
- Module::Build 0.3601
- Test::More 0
-diff --git a/xs/src/ClipperUtils.cpp b/xs/src/ClipperUtils.cpp
-index 2989783..240cf3b 100644
---- a/xs/src/ClipperUtils.cpp
-+++ b/xs/src/ClipperUtils.cpp
-@@ -542,7 +542,7 @@ polynode_children_2_perl(const ClipperLib::PolyNode& node)
- {
- AV* av = newAV();
- const unsigned int len = node.ChildCount();
-- av_extend(av, len-1);
-+ if (len > 0) av_extend(av, len-1);
- for (int i = 0; i < len; ++i) {
- av_store(av, i, polynode2perl(*node.Childs[i]));
- }
-diff --git a/xs/src/MultiPoint.cpp b/xs/src/MultiPoint.cpp
-index 47830ce..5da3cb4 100644
---- a/xs/src/MultiPoint.cpp
-+++ b/xs/src/MultiPoint.cpp
-@@ -139,7 +139,7 @@ SV*
- MultiPoint::to_AV() {
- const unsigned int num_points = this->points.size();
- AV* av = newAV();
-- av_extend(av, num_points-1);
-+ if (num_points > 0) av_extend(av, num_points-1);
- for (unsigned int i = 0; i < num_points; i++) {
- av_store(av, i, perl_to_SV_ref(this->points[i]));
- }
-@@ -150,7 +150,7 @@ SV*
- MultiPoint::to_SV_pureperl() const {
- const unsigned int num_points = this->points.size();
- AV* av = newAV();
-- av_extend(av, num_points-1);
-+ if (num_points > 0) av_extend(av, num_points-1);
- for (unsigned int i = 0; i < num_points; i++) {
- av_store(av, i, this->points[i].to_SV_pureperl());
- }
-diff --git a/xs/xsp/TriangleMesh.xsp b/xs/xsp/TriangleMesh.xsp
-index 3338d97..be40543 100644
---- a/xs/xsp/TriangleMesh.xsp
-+++ b/xs/xsp/TriangleMesh.xsp
-@@ -151,10 +151,12 @@ TriangleMesh::slice(z)
- mslicer.slice(z_f, &layers);
-
- AV* layers_av = newAV();
-- av_extend(layers_av, layers.size()-1);
-+ size_t len = layers.size();
-+ if (len > 0) av_extend(layers_av, len-1);
- for (unsigned int i = 0; i < layers.size(); i++) {
- AV* expolygons_av = newAV();
-- av_extend(expolygons_av, layers[i].size()-1);
-+ len = layers[i].size();
-+ if (len > 0) av_extend(expolygons_av, len-1);
- unsigned int j = 0;
- for (ExPolygons::iterator it = layers[i].begin(); it != layers[i].end(); ++it) {
- av_store(expolygons_av, j++, perl_to_SV_clone_ref(*it));
-diff --git a/xs/xsp/my.map b/xs/xsp/my.map
-index e69ba04..994874d 100644
---- a/xs/xsp/my.map
-+++ b/xs/xsp/my.map
-@@ -235,7 +235,8 @@ T_ARRAYREF
- AV* av = newAV();
- $arg = newRV_noinc((SV*)av);
- sv_2mortal($arg);
-- av_extend(av, $var.size()-1);
-+ const unsigned int len = $var.size();
-+ if (len > 0) av_extend(av, len-1);
- int i = 0;
- for (${type}::const_iterator it = $var.begin(); it != $var.end(); ++it) {
- av_store(av, i++, perl_to_SV_clone_ref(*it));
-@@ -246,7 +247,8 @@ T_ARRAYREF_PTR
- AV* av = newAV();
- $arg = newRV_noinc((SV*)av);
- sv_2mortal($arg);
-- av_extend(av, $var->size()-1);
-+ const unsigned int len = $var->size();
-+ if (len > 0) av_extend(av, len-1);
- int i = 0;
- for (${ my $t = $type; $t =~ s/\*$//; \$t }::iterator it = $var->begin(); it != $var->end(); ++it) {
- av_store(av, i++, perl_to_SV_ref(*it));
-@@ -256,7 +258,8 @@ T_PTR_ARRAYREF_PTR
- AV* av = newAV();
- $arg = newRV_noinc((SV*)av);
- sv_2mortal($arg);
-- av_extend(av, $var->size()-1);
-+ const unsigned int len = $var->size();
-+ if (len > 0) av_extend(av, len-1);
- int i = 0;
- for (${ my $t = $type; $t =~ s/\*$//; \$t }::iterator it = $var->begin(); it != $var->end(); ++it) {
- av_store(av, i++, perl_to_SV_ref(**it));
-@@ -266,7 +269,8 @@ T_PTR_ARRAYREF
- AV* av = newAV();
- $arg = newRV_noinc((SV*)av);
- sv_2mortal($arg);
-- av_extend(av, $var.size()-1);
-+ const unsigned int len = $var.size();
-+ if (len > 0) av_extend(av, len-1);
- int i = 0;
- for (${type}::iterator it = $var.begin(); it != $var.end(); ++it) {
- av_store(av, i++, (*it)->to_SV());
-@@ -275,8 +279,9 @@ T_PTR_ARRAYREF
- T_LAYER_HEIGHT_RANGES
- AV* av = newAV();
- $arg = newRV_noinc((SV*)av);
-- sv_2mortal($arg);
-- av_extend(av, $var.size() - 1);
-+ sv_2mortal($arg);
-+ const unsigned int len = $var.size();
-+ if (len > 0) av_extend(av, len-1);
- // map is sorted, so we can just copy it in order
- int i = 0;
- for (${type}::iterator it = $var.begin(); it != $var.end(); ++it) {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/slic3r.git/commitdiff/987c20e0dd717baf279e8d60fcdabd555d7239a9
More information about the pld-cvs-commit
mailing list