[packages/slic3r] - added build fixes from fedora - rel 7
baggins
baggins at pld-linux.org
Thu Jun 22 23:29:14 CEST 2017
commit a38a3408ca5628f96e4661874f4df97d6c3d95ee
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu Jun 22 23:28:54 2017 +0200
- added build fixes from fedora
- rel 7
slic3r-boolcast.patch | 40 +++++++++++++++++
slic3r-opengl070.patch | 117 +++++++++++++++++++++++++++++++++++++++++++++++++
slic3r-wxclose.patch | 13 ++++++
slic3r.spec | 8 +++-
4 files changed, 177 insertions(+), 1 deletion(-)
---
diff --git a/slic3r.spec b/slic3r.spec
index 383021f..2e61145 100644
--- a/slic3r.spec
+++ b/slic3r.spec
@@ -18,7 +18,7 @@ Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
Summary(pl.UTF-8): Generator G-code dla drukarek 3D (RepRap, Makerbot, Ultimaker itp.)
Name: slic3r
Version: 1.2.9
-Release: 6
+Release: 7
License: AGPL v3 (code), CC-BY (images)
Group: Applications/Engineering
Source0: https://github.com/alexrj/Slic3r/archive/%{version}.tar.gz
@@ -35,6 +35,9 @@ Patch2: %{name}-english-locale.patch
Patch3: %{name}-linker.patch
Patch4: %{name}-clipper.patch
Patch5: boost-1.60.patch
+Patch6: %{name}-boolcast.patch
+Patch7: %{name}-opengl070.patch
+Patch8: %{name}-wxclose.patch
URL: http://slic3r.org/
BuildRequires: ImageMagick
BuildRequires: boost-devel
@@ -92,6 +95,9 @@ Slic3r.
%patch3 -p1
%{?with_system_polyclipping:%patch4 -p1}
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
# Remove bundled admesh, clipper, poly2tri and boost
%{?with_system_admesh:%{__rm} -r xs/src/admesh}
diff --git a/slic3r-boolcast.patch b/slic3r-boolcast.patch
new file mode 100644
index 0000000..8fb6c98
--- /dev/null
+++ b/slic3r-boolcast.patch
@@ -0,0 +1,40 @@
+diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp
+index 49e999b..e3344e7 100644
+--- a/xs/src/libslic3r/Config.hpp
++++ b/xs/src/libslic3r/Config.hpp
+@@ -65,7 +65,7 @@ class ConfigOptionFloat : public ConfigOption
+
+ bool deserialize(std::string str) {
+ std::istringstream iss(str);
+- return iss >> this->value;
++ return static_cast<bool>(iss >> this->value);
+ };
+ };
+
+@@ -124,7 +124,7 @@ class ConfigOptionInt : public ConfigOption
+
+ bool deserialize(std::string str) {
+ std::istringstream iss(str);
+- return iss >> this->value;
++ return static_cast<bool>(iss >> this->value);
+ };
+ };
+
+@@ -249,7 +249,7 @@ class ConfigOptionPercent : public ConfigOption
+ bool deserialize(std::string str) {
+ // don't try to parse the trailing % since it's optional
+ std::istringstream iss(str);
+- return iss >> this->value;
++ return static_cast<bool>(iss >> this->value);
+ };
+ };
+
+@@ -279,7 +279,7 @@ class ConfigOptionFloatOrPercent : public ConfigOption
+ bool deserialize(std::string str) {
+ this->percent = str.find_first_of("%") != std::string::npos;
+ std::istringstream iss(str);
+- return iss >> this->value;
++ return static_cast<bool>(iss >> this->value);
+ };
+ };
+
diff --git a/slic3r-opengl070.patch b/slic3r-opengl070.patch
new file mode 100644
index 0000000..b89515b
--- /dev/null
+++ b/slic3r-opengl070.patch
@@ -0,0 +1,117 @@
+diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm
+index 7628a6c..d37199b 100644
+--- a/lib/Slic3r/GUI/3DScene.pm
++++ b/lib/Slic3r/GUI/3DScene.pm
+@@ -1,9 +1,9 @@
+ package Slic3r::GUI::3DScene::Base;
+ use strict;
+ use warnings;
+-
+ use Wx::Event qw(EVT_PAINT EVT_SIZE EVT_ERASE_BACKGROUND EVT_IDLE EVT_MOUSEWHEEL EVT_MOUSE_EVENTS);
+ # must load OpenGL *before* Wx::GLCanvas
++
+ use OpenGL qw(:glconstants :glfunctions :glufunctions :gluconstants);
+ use base qw(Wx::GLCanvas Class::Accessor);
+ use Math::Trig qw(asin);
+@@ -48,6 +48,12 @@ use constant DEFAULT_COLOR => [1,1,0];
+ use constant SELECTED_COLOR => [0,1,0,1];
+ use constant HOVER_COLOR => [0.4,0.9,0,1];
+
++# Constant to determine if Vertex Buffer objects are used to draw
++# bed grid and the cut plane for object separation.
++# Old Perl (5.10.x) should set to 0.
++use constant HAS_VBO => 1;
++
++
+ # make OpenGL::Array thread-safe
+ {
+ no warnings 'redefine';
+@@ -114,6 +120,7 @@ sub new {
+ $self->Refresh;
+ });
+ EVT_MOUSE_EVENTS($self, \&mouse_event);
++
+
+ return $self;
+ }
+@@ -741,9 +748,19 @@ sub Render {
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
++ if (HAS_VBO) {
++ my ($triangle_vertex);
++ ($triangle_vertex) =
++ glGenBuffersARB_p(1);
++ $self->bed_triangles->bind($triangle_vertex);
++ glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $self->bed_triangles, GL_STATIC_DRAW_ARB);
++ glVertexPointer_c(3, GL_FLOAT, 0, 0);
++ } else {
++ # fall back on old behavior
++ glVertexPointer_p(3, $self->bed_triangles);
++ }
+ glColor4f(0.8, 0.6, 0.5, 0.4);
+ glNormal3d(0,0,1);
+- glVertexPointer_p(3, $self->bed_triangles);
+ glDrawArrays(GL_TRIANGLES, 0, $self->bed_triangles->elements / 3);
+ glDisableClientState(GL_VERTEX_ARRAY);
+
+@@ -753,13 +770,29 @@ sub Render {
+
+ # draw grid
+ glLineWidth(3);
+- glColor4f(0.2, 0.2, 0.2, 0.4);
+ glEnableClientState(GL_VERTEX_ARRAY);
+- glVertexPointer_p(3, $self->bed_grid_lines);
++ if (HAS_VBO) {
++ my ($grid_vertex);
++ ($grid_vertex) =
++ glGenBuffersARB_p(1);
++ $self->bed_grid_lines->bind($grid_vertex);
++ glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $self->bed_grid_lines, GL_STATIC_DRAW_ARB);
++ glVertexPointer_c(3, GL_FLOAT, 0, 0);
++ } else {
++ # fall back on old behavior
++ glVertexPointer_p(3, $self->bed_grid_lines);
++ }
++ glColor4f(0.2, 0.2, 0.2, 0.4);
++ glNormal3d(0,0,1);
+ glDrawArrays(GL_LINES, 0, $self->bed_grid_lines->elements / 3);
+ glDisableClientState(GL_VERTEX_ARRAY);
+
+ glDisable(GL_BLEND);
++ if (HAS_VBO) {
++ # Turn off buffer objects to let the rest of the draw code work.
++ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
++ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
++ }
+ }
+
+ my $volumes_bb = $self->volumes_bounding_box;
+@@ -899,10 +932,26 @@ sub draw_volumes {
+ glDisable(GL_BLEND);
+
+ if (defined $self->cutting_plane_z) {
++ if (HAS_VBO) {
++ # Use Vertex Buffer Object for cutting plane (previous method crashes on modern POGL).
++ my ($cut_vertex) = glGenBuffersARB_p(1);
++ $self->cut_lines_vertices->bind($cut_vertex);
++ glBufferDataARB_p(GL_ARRAY_BUFFER_ARB, $self->cut_lines_vertices, GL_STATIC_DRAW_ARB);
++ glVertexPointer_c(3, GL_FLOAT, 0, 0);
++ } else {
++ # Use legacy method.
++ glVertexPointer_p(3, $self->cut_lines_vertices);
++ }
+ glLineWidth(2);
+ glColor3f(0, 0, 0);
+- glVertexPointer_p(3, $self->cut_lines_vertices);
+ glDrawArrays(GL_LINES, 0, $self->cut_lines_vertices->elements / 3);
++
++ if (HAS_VBO) {
++ # Turn off buffer objects to let the rest of the draw code work.
++ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
++ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
++ }
++
+ }
+ glDisableClientState(GL_VERTEX_ARRAY);
+ }
diff --git a/slic3r-wxclose.patch b/slic3r-wxclose.patch
new file mode 100644
index 0000000..cffe02e
--- /dev/null
+++ b/slic3r-wxclose.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/Slic3r/GUI/AboutDialog.pm b/lib/Slic3r/GUI/AboutDialog.pm
+index 6fc83b6..78f89ef 100644
+--- a/lib/Slic3r/GUI/AboutDialog.pm
++++ b/lib/Slic3r/GUI/AboutDialog.pm
+@@ -66,7 +66,7 @@ sub new {
+ $vsizer->Add($html, 1, wxEXPAND | wxALIGN_LEFT | wxRIGHT | wxBOTTOM, 20);
+ EVT_HTML_LINK_CLICKED($self, $html, \&link_clicked);
+
+- my $buttons = $self->CreateStdDialogButtonSizer(wxCLOSE);
++ my $buttons = $self->CreateStdDialogButtonSizer(wxOK);
+ $self->SetEscapeId(wxID_CLOSE);
+ EVT_BUTTON($self, wxID_CLOSE, sub {
+ $self->EndModal(wxID_CLOSE);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/slic3r.git/commitdiff/a38a3408ca5628f96e4661874f4df97d6c3d95ee
More information about the pld-cvs-commit
mailing list