From 707ee76522caeda8391dac9f7185c9c53993a548 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Mon, 4 Sep 2017 16:01:04 -0400 Subject: [PATCH] slic3r: fix build with gcc6 --- pkgs/applications/misc/slic3r/default.nix | 5 +++ pkgs/applications/misc/slic3r/gcc6.patch | 40 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/applications/misc/slic3r/gcc6.patch diff --git a/pkgs/applications/misc/slic3r/default.nix b/pkgs/applications/misc/slic3r/default.nix index 64bcb0e1921..8624cc9dda5 100644 --- a/pkgs/applications/misc/slic3r/default.nix +++ b/pkgs/applications/misc/slic3r/default.nix @@ -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 @@ -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 \ diff --git a/pkgs/applications/misc/slic3r/gcc6.patch b/pkgs/applications/misc/slic3r/gcc6.patch new file mode 100644 index 00000000000..f382a252f0d --- /dev/null +++ b/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); + }; + }; +