Skip to content

Commit a342d6d

Browse files
Samuel Leathersbjornfor
Samuel Leathers
authored andcommittedSep 9, 2017
slic3r: fix build with gcc6
(cherry picked from commit 707ee76)
1 parent 85567a0 commit a342d6d

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
 

‎pkgs/applications/misc/slic3r/default.nix

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
1212
sha256 = "1z8h11k29b7z49z5k8ikyfiijyycy1q3krlzi8hfd0vdybvymw21";
1313
};
1414

15+
patches = [
16+
./gcc6.patch
17+
];
18+
1519
buildInputs = with perlPackages; [ perl makeWrapper which
1620
EncodeLocale MathClipper ExtUtilsXSpp threads
1721
MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
@@ -31,6 +35,7 @@ stdenv.mkDerivation rec {
3135

3236
buildPhase = ''
3337
export SLIC3R_NO_AUTO=true
38+
export LD=$CXX
3439
export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
3540
3641
substituteInPlace Build.PL \
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

0 commit comments

Comments
 (0)
Please sign in to comment.