slic3r: fix build with gcc6

authored by Samuel Leathers and committed by Robin Gloster 707ee765 f93a0198

+45
+5
pkgs/applications/misc/slic3r/default.nix
··· 12 12 sha256 = "1z8h11k29b7z49z5k8ikyfiijyycy1q3krlzi8hfd0vdybvymw21"; 13 13 }; 14 14 15 + patches = [ 16 + ./gcc6.patch 17 + ]; 18 + 15 19 buildInputs = with perlPackages; [ perl makeWrapper which 16 20 EncodeLocale MathClipper ExtUtilsXSpp threads 17 21 MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo ··· 31 35 32 36 buildPhase = '' 33 37 export SLIC3R_NO_AUTO=true 38 + export LD=$CXX 34 39 export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB" 35 40 36 41 substituteInPlace Build.PL \
+40
pkgs/applications/misc/slic3r/gcc6.patch
··· 1 + diff --git i/xs/src/libslic3r/Config.hpp w/xs/src/libslic3r/Config.hpp 2 + index 49e999b..d9b65d8 100644 3 + --- i/xs/src/libslic3r/Config.hpp 4 + +++ w/xs/src/libslic3r/Config.hpp 5 + @@ -65,7 +65,7 @@ class ConfigOptionFloat : public ConfigOption 6 + 7 + bool deserialize(std::string str) { 8 + std::istringstream iss(str); 9 + - return iss >> this->value; 10 + + return bool(iss >> this->value); 11 + }; 12 + }; 13 + 14 + @@ -124,7 +124,7 @@ class ConfigOptionInt : public ConfigOption 15 + 16 + bool deserialize(std::string str) { 17 + std::istringstream iss(str); 18 + - return iss >> this->value; 19 + + return bool(iss >> this->value); 20 + }; 21 + }; 22 + 23 + @@ -249,7 +249,7 @@ class ConfigOptionPercent : public ConfigOption 24 + bool deserialize(std::string str) { 25 + // don't try to parse the trailing % since it's optional 26 + std::istringstream iss(str); 27 + - return iss >> this->value; 28 + + return bool(iss >> this->value); 29 + }; 30 + }; 31 + 32 + @@ -279,7 +279,7 @@ class ConfigOptionFloatOrPercent : public ConfigOption 33 + bool deserialize(std::string str) { 34 + this->percent = str.find_first_of("%") != std::string::npos; 35 + std::istringstream iss(str); 36 + - return iss >> this->value; 37 + + return bool(iss >> this->value); 38 + }; 39 + }; 40 +