spot / rpms / slic3r

Forked from rpms/slic3r 6 years ago
Clone
Blob Blame History Raw
Upstream constantly refuses to support Perl >= 5.16.
They say it handles locales incorrectly, but it might be caused by bad code
design. Running Slic3r with locales using other char than point as a decimal
separator causes crashes. This patch removes the warning about unsupported
Perl version (it is very annoying) and forces Slic3r to use English decimal
separator by setting the LC_NUMERIC environment variable. Setting it in more
Perl way doesn't work and is overwritten in some of imported modules.
https://github.com/alexrj/Slic3r/issues/935
https://github.com/alexrj/Slic3r/pull/936#issuecomment-12544383
https://github.com/alexrj/Slic3r/issues/538#issuecomment-14560494

diff -ruN a/lib/Slic3r.pm b/lib/Slic3r.pm
--- a/lib/Slic3r.pm	2013-04-03 16:12:40.569377442 +0200
+++ b/lib/Slic3r.pm	2013-04-03 16:13:39.837329382 +0200
@@ -21,9 +21,6 @@
     $have_threads = $Config{useithreads} && eval "use threads; use threads::shared; use Thread::Queue; 1";
 }
 
-warn "Running Slic3r under Perl >= 5.16 is not supported nor recommended\n"
-    if $^V >= v5.16;
-
 our $var = "/usr/share/slic3r";
 
 use Encode;
diff -ruN a/slic3r.pl b/slic3r.pl
--- a/slic3r.pl	2013-03-30 15:59:17.000000000 +0100
+++ b/slic3r.pl	2013-04-03 16:13:29.837337497 +0200
@@ -10,6 +10,7 @@
 
 use Getopt::Long qw(:config no_auto_abbrev);
 use List::Util qw(first);
+$ENV{LC_NUMERIC} = 'en_US.UTF-8';
 use Slic3r;
 $|++;