Skip to content

Commit

Permalink
slic3r: fix build with gcc6
Browse files Browse the repository at this point in the history
(cherry picked from commit 707ee76)
  • Loading branch information
Samuel Leathers authored and bjornfor committed Sep 9, 2017
1 parent 85567a0 commit a342d6d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/applications/misc/slic3r/default.nix
Expand Up @@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
sha256 = "1z8h11k29b7z49z5k8ikyfiijyycy1q3krlzi8hfd0vdybvymw21";
};

patches = [
./gcc6.patch
];

buildInputs = with perlPackages; [ perl makeWrapper which
EncodeLocale MathClipper ExtUtilsXSpp threads
MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
Expand All @@ -31,6 +35,7 @@ stdenv.mkDerivation rec {

buildPhase = ''
export SLIC3R_NO_AUTO=true
export LD=$CXX
export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
substituteInPlace Build.PL \
Expand Down
40 changes: 40 additions & 0 deletions pkgs/applications/misc/slic3r/gcc6.patch
@@ -0,0 +1,40 @@
diff --git i/xs/src/libslic3r/Config.hpp w/xs/src/libslic3r/Config.hpp
index 49e999b..d9b65d8 100644
--- i/xs/src/libslic3r/Config.hpp
+++ w/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 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 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 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 bool(iss >> this->value);
};
};

0 comments on commit a342d6d

Please sign in to comment.